> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Set up your environment and make your first API call in minutes

# Getting Started

Get up and running with the OpenMetadata API and SDKs. This guide walks you through authentication, SDK installation, and making your first API call.

> [!NOTE]
>
> Most Python examples in this API reference use SDK 2.0 (`metadata.sdk`). The Topics and ML model services pages use the original client, because SDK 2.0 has no class for them. The pages under the SDK section also show the original client. For more information, see [Which Python SDK Should I Use?](https://docs.open-metadata.org/v2.1.x/api-reference/sdk/python/overview.md#which-python-sdk-should-i-use).

## Prerequisites

* A OpenMetadata account (cloud or self-hosted instance)
* Your instance base URL, for example `https://your-company.open-metadata.org/api`
* **Python 3.11+**, **Java 21+**, or **Go 1.19+** (depending on your SDK choice)

**1. Get Your API Credentials**

You need a JWT token to authenticate API requests. There are two ways to get one:

**Bot Token** (recommended for automation)

> [!NOTE]
>
> **Note**: The **Bots** tile under **Settings** is only visible to users with Admin privileges. If you don't see it, ask your organization's OpenMetadata Admin to generate a bot token for you or grant you Admin access.

1. Navigate to **Settings > Bots** in the OpenMetadata UI
2. Click on the **ingestion-bot** (or create a new bot for your use case)
3. Copy the JWT token from the bot details page

![Navigate to Settings > Bots to find available bots](https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?fit=max\&auto=format\&n=jnmJU3MTF_OBREw9\&q=85\&s=ba7bf834c20766ab797feb8b5ec74cc6)

![Copy the JWT token from the bot details page](https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots-token.png?fit=max\&auto=format\&n=jnmJU3MTF_OBREw9\&q=85\&s=f6e22220e1040aca4fba086ee9d014f5)

**Personal Access Token** (for development)

1. Click your profile image in the top-right corner
2. Go to the **Access Token** tab
3. Click **Generate New Token**

![Navigate to your user profile](https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/users/user-profile-page.png?fit=max\&auto=format\&n=jnmJU3MTF_OBREw9\&q=85\&s=55bf4c4cf2041cca4ce89e12b567b13d)

![Generate a personal access token](https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/users/user-profile-access-token.png?fit=max\&auto=format\&n=jnmJU3MTF_OBREw9\&q=85\&s=0087de219e205b66ce8db4f39011b206)

> [!WARNING]
>
> Your JWT token carries full API privileges. Keep it secure — never share tokens in publicly accessible areas such as GitHub repositories or client-side code.

**2. Install an SDK**

Choose your preferred language and install the SDK:

```bash Python theme={null}
pip install "openmetadata-ingestion~=2.1.0.0"
```

```xml Java (Maven) theme={null}
<dependency>
  <groupId>org.open-metadata</groupId>
  <artifactId>openmetadata-sdk</artifactId>
  <version>2.1.0.1</version>
</dependency>
```

```bash Go theme={null}
go get github.com/open-metadata/openmetadata-sdk/openmetadata-go-client
```

Or skip SDK installation and use cURL to interact with the REST API directly.

**3. Initialize Your Client**

Set up the connection to your OpenMetadata instance:

```python Python theme={null}
from metadata.sdk import configure

# The host must end with /api
configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token",
)
```

```java Java theme={null}
import org.openmetadata.sdk.client.OpenMetadataClient;
import org.openmetadata.sdk.config.OpenMetadataConfig;

OpenMetadataConfig config = OpenMetadataConfig.builder()
    .serverUrl("https://your-company.open-metadata.org/api")
    .accessToken("your-jwt-token")
    .build();

OpenMetadataClient client = new OpenMetadataClient(config);
```

```go Go theme={null}
import ometa "github.com/open-metadata/openmetadata-sdk/openmetadata-go-client/pkg/ometa"

client := ometa.NewClient(
    "https://your-company.open-metadata.org",
    ometa.WithToken("your-jwt-token"),
)
```

```bash cURL theme={null}
# Set your token as an environment variable
export OPENMETADATA_TOKEN="your-jwt-token"
export OPENMETADATA_HOST="https://your-company.open-metadata.org/api/v1"
```

**4. Make Your First API Call**

List the tables in your catalog to verify everything is working:

```python Python theme={null}
from metadata.sdk import Tables

for table in Tables.list_all():
    print(f"{table.fullyQualifiedName.root}: {getattr(table.description, 'root', table.description)}")
```

```java Java theme={null}
import org.openmetadata.sdk.models.ListParams;

// client is an initialized OpenMetadataClient.

var tables = client.tables().list(new ListParams().setLimit(10));

for (var table : tables.getData()) {
    System.out.println(table.getFullyQualifiedName());
}
```

```go Go theme={null}
ctx := context.Background()

for table, err := range client.Tables.List(ctx, nil) {
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(*table.FullyQualifiedName)
}
```

```bash cURL theme={null}
curl -X GET "$OPENMETADATA_HOST/tables?limit=10" \
  -H "Authorization: Bearer $OPENMETADATA_TOKEN" \
  -H "Content-Type: application/json"
```

You should see a JSON response like this:

```json Expected Response theme={null}
{
  "data": [
    {
      "id": "a]f1c8e2-4b3a-4e5f-9c6d-7e8f9a0b1c2d",
      "name": "customers",
      "fullyQualifiedName": "mysql-prod.analytics.customers",
      "description": "Core customer records",
      "tableType": "Regular",
      "columns": [ ... ],
      "service": { "id": "...", "type": "databaseService" }
    }
  ],
  "paging": {
    "total": 142,
    "after": "eyJsaW1pdCI6MTAsIm9mZnNldCI6MTB9"
  }
}
```

> [!TIP]
>
> The `paging.after` cursor can be passed to the next request to paginate through results. See the [Pagination guide](https://docs.open-metadata.org/v2.1.x/api-reference/pagination.md) for details.

**5. Create Resources with the Fluent API**

The SDKs provide a fluent API for creating and managing resources. Here's how to create a table programmatically:

```python Python theme={null}
from metadata.sdk import Tables, configure
from metadata.generated.schema.api.data.createTable import CreateTableRequest
from metadata.generated.schema.entity.data.table import Column, DataType

# Initialize the SDK
configure(host="https://your-company.open-metadata.org/api", jwt_token="your-jwt-token")

# Create and persist the table
table = Tables.create(CreateTableRequest(
    name="customers",
    databaseSchema="mysql-prod.analytics.public",
    description="Customer master table",
    columns=[
        Column(name="id", dataType=DataType.BIGINT, description="Primary key"),
        Column(name="name", dataType=DataType.VARCHAR, dataLength=255, description="Customer name"),
        Column(name="email", dataType=DataType.VARCHAR, dataLength=255, description="Email address"),
    ],
))

print(f"Created: {table.fullyQualifiedName.root}")
```

```java Java theme={null}
import org.openmetadata.schema.entity.data.Table;
import org.openmetadata.sdk.fluent.builders.TableBuilder;
import org.openmetadata.sdk.fluent.builders.ColumnBuilder;

// client is the OpenMetadataClient from the "Initialize Your Client" step.
// Create and persist the table in one fluent chain
Table table = new TableBuilder(client)
    .name("customers")
    .description("Customer master table")
    .schemaFQN("mysql-prod.analytics.public")
    .addColumn("id", "BIGINT", "Primary key")
    .column(ColumnBuilder.varchar("name", 255))
    .column(ColumnBuilder.varchar("email", 255))
    .tags("PII.Sensitive", "Tier.Tier1")
    .create();

System.out.println("Created: " + table.getFullyQualifiedName());
```

```bash cURL theme={null}
curl -X POST "$OPENMETADATA_HOST/tables" \
  -H "Authorization: Bearer $OPENMETADATA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "new_table",
    "databaseSchema": "mysql-prod.analytics",
    "columns": [
      {
        "name": "id",
        "dataType": "BIGINT",
        "description": "Primary key"
      },
      {
        "name": "name",
        "dataType": "VARCHAR",
        "dataLength": 255,
        "description": "Customer name"
      }
    ]
  }'
```

The Java SDK uses a fluent `.withXXX()` pattern for building request objects, while the Python SDK uses typed dataclasses with nested constructors. Both provide full type safety and IDE autocompletion.

## Common Use Cases

> [card] [Discover Tables](https://docs.open-metadata.org/v2.1.x/api-reference/discovery.md)
>
> Search and explore metadata across your entire catalog.

> [card] [Manage Metadata](https://docs.open-metadata.org/v2.1.x/api-reference/data-assets.md)
>
> Create, update, and manage tables, dashboards, pipelines, and more.

> [card] [Run Quality Tests](https://docs.open-metadata.org/v2.1.x/api-reference/data-quality.md)
>
> Define test suites and monitor data quality metrics programmatically.

> [card] [Govern Data](https://docs.open-metadata.org/v2.1.x/api-reference/governance.md)
>
> Manage domains, glossaries, classifications, and tags.

> [card] [Manage Teams](https://docs.open-metadata.org/v2.1.x/api-reference/teams-and-users.md)
>
> Provision users, teams, and manage organizational structure.

> [card] [Define Data Contracts](https://docs.open-metadata.org/v2.1.x/api-reference/data-contracts.md)
>
> Create and validate data contracts for your assets.

## What's Next?

> [card] [Authentication](https://docs.open-metadata.org/v2.1.x/api-reference/authentication.md)
>
> Deep dive into auth methods and token management.

> [card] [Error Handling](https://docs.open-metadata.org/v2.1.x/api-reference/errors.md)
>
> Understand error codes and how to handle them.

> [card] [Pagination](https://docs.open-metadata.org/v2.1.x/api-reference/pagination.md)
>
> Learn how to paginate through large result sets.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.