> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcollate.io/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 Collate API and the Python, Java, and Go SDKs. This guide walks you through authentication, SDK installation, and making your first API call.

## Prerequisites

* A Collate account (cloud or self-hosted instance)
* Your instance base URL (e.g., `https://your-company.getcollate.io/api`)
* Python 3.10 - 3.11, Java 21, or Go 1.24+

<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 Collate 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/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=adb6bf3ebb7c3f38227961ed7cb4b317" 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/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?w=280&fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=8ee8ce12dd22af13498924501a608b6e 280w, https://mintcdn.com/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?w=560&fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=6b38c31b6f2de2a55d847fb0469ce4ec 560w, https://mintcdn.com/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?w=840&fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=44d719dea70d749109839ff8c3216941 840w, https://mintcdn.com/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?w=1100&fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=deed5c810fd1bd5e31c129e5d4d7c348 1100w, https://mintcdn.com/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?w=1650&fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=2a76a80a2272a2cd407e048aafd23bef 1650w, https://mintcdn.com/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots.png?w=2500&fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=6adff23f1c6cb6c2e0fde1efd69aae48 2500w" />

    <img src="https://mintcdn.com/collatedocs/rwgp94CnO_DBWElR/public/images/apis/bots/bots-token.png?fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=30ace6669ee9f8c7c64bb670253c7778" 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/collatedocs/rwgp94CnO_DBWElR/public/images/apis/users/user-profile-page.png?fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=1b5c67c11f8e9165316685c7e80f4bc8" 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/collatedocs/rwgp94CnO_DBWElR/public/images/apis/users/user-profile-access-token.png?fit=max&auto=format&n=rwgp94CnO_DBWElR&q=85&s=47e848a8e8f1403e3397b93833613bb9" 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~=YOUR_SERVER_VERSION"
      ```

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

      ```bash Go theme={null}
      go get github.com/open-metadata/openmetadata-sdk/openmetadata-go-client@latest
      ```
    </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 Collate instance:

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

      configure(
          host="https://your-company.getcollate.io/api",
          jwt_token="your-jwt-token",
      )
      ```

      ```java Java theme={null}
      import org.openmetadata.sdk.client.OpenMetadata;

      OpenMetadata.initialize(
          "https://your-company.getcollate.io/api",
          "your-jwt-token"
      );

      var client = OpenMetadata.client();
      ```

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

      client := ometa.NewClient(
          "https://your-company.getcollate.io",
          ometa.WithToken("your-jwt-token"),
      )
      ```

      ```bash cURL theme={null}
      # Set your token as an environment variable
      export COLLATE_TOKEN="your-jwt-token"
      export COLLATE_HOST="https://your-company.getcollate.io/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

      tables = Tables.list_all()
      for table in tables:
          print(f"{table.fullyQualifiedName}: {table.description}")
      ```

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

      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, &ometa.ListTablesParams{
          Limit: ometa.Int32(10),
      }) {
          if err != nil {
              log.Fatal(err)
          }
          fmt.Println(table.Name)
      }
      ```

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

    You should see a JSON response like this:

    ```json Expected Response theme={null}
    {
      "data": [
        {
          "id": "af1c8e2-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](/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.getcollate.io/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}")
      ```

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

      // 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 "$COLLATE_HOST/tables" \
        -H "Authorization: Bearer $COLLATE_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 exposes both builder-based and fluent helper APIs, the Python SDK uses typed request models and entity helpers, and the Go SDK provides typed services with automatic pagination. All SDKs provide strong typing and IDE-friendly workflows.
  </Step>
</Steps>

## Common Use Cases

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

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

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

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

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

  <Card title="Define Data Contracts" icon="file-contract" href="/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="/api-reference/authentication">
    Deep dive into auth methods and token management.
  </Card>

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

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