> ## 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.

## Prerequisites

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

<Steps>
  <Step title="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)

    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

    <img src="https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=ba7bf834c20766ab797feb8b5ec74cc6" alt="Navigate to Settings > Bots to find available bots" data-og-width="2943" width="2943" data-og-height="1413" height="1413" data-path="public/images/apis/bots/bots.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?w=280&fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=c5778b1419e1565ae06632429bee3de4 280w, https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?w=560&fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=e7801978b29ec7b50c0e62569836eba9 560w, https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?w=840&fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=e68c6844ba5fe392de827faf7acfb1b3 840w, https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?w=1100&fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=8442c8fcf4b57b2455566cf0f18a0dec 1100w, https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?w=1650&fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=95d330dfdef9d1e9db4ce01a35d1a888 1650w, https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots.png?w=2500&fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=6e1ae6b7b183688a82cff05cdf09a56a 2500w" />

    <img src="https://mintcdn.com/openmetadata/jnmJU3MTF_OBREw9/public/images/apis/bots/bots-token.png?fit=max&auto=format&n=jnmJU3MTF_OBREw9&q=85&s=f6e22220e1040aca4fba086ee9d014f5" alt="Copy the JWT token from the bot details page" width="2943" height="1413" data-path="public/images/apis/bots/bots-token.png" />

    **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**

    <img src="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" alt="Navigate to your user profile" width="2733" height="1271" data-path="public/images/apis/users/user-profile-page.png" />

    <img src="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" alt="Generate a personal access token" width="2733" height="1271" data-path="public/images/apis/users/user-profile-access-token.png" />

    <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.
    </Warning>
  </Step>

  <Step title="Install an SDK">
    Choose your preferred language and install the SDK:

    <CodeGroup>
      ```bash Python theme={null}
      pip install "openmetadata-ingestion~=1.12.1"
      ```

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

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

    Or skip SDK installation and use cURL to interact with the REST API directly.
  </Step>

  <Step title="Initialize Your Client">
    Set up the connection to your OpenMetadata instance:

    <CodeGroup dropdown>
      ```python Python theme={null}
      from metadata.sdk import configure

      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"

      restConfig := ometa.NewRestConfig(
          "https://your-company.open-metadata.org",
          "",  // APIVersion
          0,   // Retry -> defaults to 3
          0,   // RetryWait -> defaults to 30 seconds
          nil, // RetryCodes -> defaults to [429, 504]
          "your-jwt-token",
      )
      client, err := ometa.NewRest(restConfig)
      ```

      ```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"
      ```
    </CodeGroup>
  </Step>

  <Step title="Make Your First API Call">
    List the tables in your catalog to verify everything is working:

    <CodeGroup dropdown>
      ```python Python theme={null}
      from metadata.sdk import Tables

      for table in Tables.list().auto_paging_iterable():
          print(f"{table.fullyQualifiedName}: {table.description}")
      ```

      ```java Java theme={null}
      TablesApi tablesApi = client.buildClient(TablesApi.class);
      TableList tables = tablesApi.listTables(null, 10, null, null, null);

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

      ```go Go theme={null}
      resp, err := rest.Get("tables", map[string]string{"limit": "10"})
      if err != nil {
          log.Fatal(err)
      }
      defer resp.Body.Close()

      var result struct {
          Data []struct {
              FullyQualifiedName string `json:"fullyQualifiedName"`
          } `json:"data"`
      }
      if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
          log.Fatal(err)
      }

      for _, table := range result.Data {
          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"
      ```
    </CodeGroup>

    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](/v1.12.x/api-reference/pagination) for details.
    </Tip>
  </Step>

  <Step title="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:

    <CodeGroup dropdown>
      ```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", 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}")
      ```

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

      // 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"
            }
          ]
        }'
      ```
    </CodeGroup>

    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.
  </Step>
</Steps>

## Common Use Cases

<CardGroup cols={2}>
  <Card title="Discover Tables" icon="magnifying-glass" href="/v1.12.x/api-reference/discovery">
    Search and explore metadata across your entire catalog.
  </Card>

  <Card title="Manage Metadata" icon="database" href="/v1.12.x/api-reference/data-assets">
    Create, update, and manage tables, dashboards, pipelines, and more.
  </Card>

  <Card title="Run Quality Tests" icon="chart-line" href="/v1.12.x/api-reference/data-quality">
    Define test suites and monitor data quality metrics programmatically.
  </Card>

  <Card title="Govern Data" icon="shield-check" href="/v1.12.x/api-reference/governance">
    Manage domains, glossaries, classifications, and tags.
  </Card>

  <Card title="Manage Teams" icon="users" href="/v1.12.x/api-reference/teams-and-users">
    Provision users, teams, and manage organizational structure.
  </Card>

  <Card title="Define Data Contracts" icon="file-contract" href="/v1.12.x/api-reference/data-contracts">
    Create and validate data contracts for your assets.
  </Card>
</CardGroup>

## What's Next?

<CardGroup cols={3}>
  <Card title="Authentication" icon="key" href="/v1.12.x/api-reference/authentication">
    Deep dive into auth methods and token management.
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/v1.12.x/api-reference/errors">
    Understand error codes and how to handle them.
  </Card>

  <Card title="Pagination" icon="arrow-right-arrow-left" href="/v1.12.x/api-reference/pagination">
    Learn how to paginate through large result sets.
  </Card>
</CardGroup>
