Skip to main content
PUT
https://sandbox.getcollate.io/api
/
v1
/
tables
/
{id}
/
joins
PUT /v1/tables/{id}/joins
from metadata.sdk import configure
from metadata.sdk.entities import Tables

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

table_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

# Add join information
Tables.add_joins(table_id, {
    "startDate": "2024-01-01",
    "dayCount": 30,
    "columnJoins": [
        {
            "columnName": "id",
            "joinedWith": [
                {
                    "fullyQualifiedName": "snowflake_prod.analytics.public.orders.customer_id",
                    "joinCount": 1542
                }
            ]
        }
    ]
})

# Set data model
Tables.set_data_model(table_id, {
    "modelType": "DBT",
    "description": "Customer dimension table built from raw events",
    "sql": "SELECT id, name, email, created_at FROM raw.customers WHERE active = true",
    "columns": [
        {"name": "id", "description": "Primary key from source"},
        {"name": "name", "description": "Customer full name"},
        {"name": "email", "description": "Verified email address"},
        {"name": "created_at", "description": "First seen timestamp"}
    ]
})
{
  "startDate": "2024-01-01",
  "dayCount": 30,
  "columnJoins": [
    {
      "columnName": "agent_id",
      "joinedWith": [
        {
          "fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_agent.agent_id",
          "joinCount": 1542
        }
      ]
    }
  ]
}

Table Relationships

Manage join information, data models, column listings, and entity relationships for tables.

Add Joins

PUT /v1/tables/{id}/joins Record join information between this table and other tables.
id
string
required
UUID of the table.
startDate
string
required
Start date for the join period (ISO 8601 format).
dayCount
integer
Number of days the join data covers.
columnJoins
array
required
Array of column join records.

Set Data Model

PUT /v1/tables/{id}/dataModel Set the data model (dbt or similar) associated with this table.
id
string
required
UUID of the table.
modelType
string
required
Type of data model: DBT, LookML.
description
string
Description from the data model.
sql
string
SQL query or transformation logic from the model.
columns
array
Column descriptions and metadata from the data model.

Get Columns

GET /v1/tables/{id}/columns Retrieve column information with optional pagination.
id
string
required
UUID of the table.
limit
integer
default:"10"
Maximum number of columns to return.
offset
integer
default:"0"
Offset for pagination.
PUT /v1/tables/{id}/joins
from metadata.sdk import configure
from metadata.sdk.entities import Tables

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

table_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

# Add join information
Tables.add_joins(table_id, {
    "startDate": "2024-01-01",
    "dayCount": 30,
    "columnJoins": [
        {
            "columnName": "id",
            "joinedWith": [
                {
                    "fullyQualifiedName": "snowflake_prod.analytics.public.orders.customer_id",
                    "joinCount": 1542
                }
            ]
        }
    ]
})

# Set data model
Tables.set_data_model(table_id, {
    "modelType": "DBT",
    "description": "Customer dimension table built from raw events",
    "sql": "SELECT id, name, email, created_at FROM raw.customers WHERE active = true",
    "columns": [
        {"name": "id", "description": "Primary key from source"},
        {"name": "name", "description": "Customer full name"},
        {"name": "email", "description": "Verified email address"},
        {"name": "created_at", "description": "First seen timestamp"}
    ]
})
{
  "startDate": "2024-01-01",
  "dayCount": 30,
  "columnJoins": [
    {
      "columnName": "agent_id",
      "joinedWith": [
        {
          "fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_agent.agent_id",
          "joinCount": 1542
        }
      ]
    }
  ]
}

Returns

Add joins returns the join data associated with the table. Set data model returns the updated table with data model attached. Get columns returns a paginated list of column definitions.

Error Handling

CodeError TypeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission
404NOT_FOUNDTable does not exist
400BAD_REQUESTInvalid join data or data model format