Skip to main content
POST
https://sandbox.getcollate.io/api
/
v1
/
tables
POST /v1/tables
from metadata.sdk import configure
from metadata.sdk.entities import Tables
from metadata.generated.schema.api.data.createTable import CreateTableRequest

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

request = CreateTableRequest(
    name="customers",
    displayName="Customers",
    databaseSchema="snowflake_prod.analytics.public",
    description="Customer master data table",
    tableType="Regular",
    columns=[
        {"name": "id", "dataType": "INT", "constraint": "PRIMARY_KEY", "description": "Unique customer identifier"},
        {"name": "name", "dataType": "VARCHAR", "dataLength": 256, "description": "Full name of the customer"},
        {"name": "email", "dataType": "VARCHAR", "dataLength": 256, "description": "Customer email address"},
        {"name": "created_at", "dataType": "TIMESTAMP", "description": "Account creation timestamp"}
    ]
)

table = Tables.create(request)
print(f"Created: {table.fullyQualifiedName}")
{
  "id": "455e3d9d-dbbf-455e-b3be-7191daa825f3",
  "name": "agent_performance_summary",
  "fullyQualifiedName": "sample_data.ecommerce_db.shopify.agent_performance_summary",
  "description": "Summary of agent performance metrics derived from multiple tables including ssot_utilization_detail for comprehensive reporting.",
  "version": 0.1,
  "updatedAt": 1769982651320,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/tables/455e3d9d-dbbf-455e-b3be-7191daa825f3",
  "tableType": "Regular",
  "columns": [
    {
      "name": "agent_id",
      "dataType": "VARCHAR",
      "dataLength": 100,
      "dataTypeDisplay": "varchar",
      "description": "Agent identifier",
      "fullyQualifiedName": "sample_data.ecommerce_db.shopify.agent_performance_summary.agent_id",
      "tags": [],
      "ordinalPosition": 1
    },
    {
      "name": "performance_score",
      "dataType": "DECIMAL",
      "dataTypeDisplay": "decimal",
      "description": "Overall performance score",
      "fullyQualifiedName": "sample_data.ecommerce_db.shopify.agent_performance_summary.performance_score",
      "tags": [],
      "ordinalPosition": 2
    }
  ],
  "owners": [],
  "databaseSchema": {
    "id": "4dd30184-009c-4792-b296-9562eaed651f",
    "type": "databaseSchema",
    "name": "shopify",
    "fullyQualifiedName": "sample_data.ecommerce_db.shopify",
    "description": "This **mock** database contains schema related to shopify sales and orders with related dimension tables.",
    "displayName": "shopify",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/databaseSchemas/4dd30184-009c-4792-b296-9562eaed651f"
  },
  "database": {
    "id": "0be090de-0941-48c4-af49-a6157c91cda0",
    "type": "database",
    "name": "ecommerce_db",
    "fullyQualifiedName": "sample_data.ecommerce_db",
    "description": "This **mock** database contains schemas related to shopify sales and orders with related dimension tables.",
    "displayName": "ecommerce_db",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/databases/0be090de-0941-48c4-af49-a6157c91cda0"
  },
  "service": {
    "id": "fd2193af-fe09-4366-92b7-1e0d01cd8c09",
    "type": "databaseService",
    "name": "sample_data",
    "fullyQualifiedName": "sample_data",
    "displayName": "sample_data",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/services/databaseServices/fd2193af-fe09-4366-92b7-1e0d01cd8c09"
  },
  "serviceType": "BigQuery",
  "tags": [],
  "deleted": false
}

Create a Table

Create a new table within a database schema.

Body Parameters

name
string
required
Name of the table. Must be unique within the parent schema.
databaseSchema
string
required
Fully qualified name of the parent DatabaseSchema (e.g., snowflake_prod.analytics.public).
columns
array
required
Array of column definitions for the table.
displayName
string
Human-readable display name for the table.
description
string
Description of the table in Markdown format.
tableType
string
Type of table: Regular, External, View, MaterializedView, SecureView, Iceberg, Local, Partitioned, Foreign, Transient.
retentionPeriod
string
Data retention period in ISO 8601 duration format (e.g., P365D).
owners
array
Array of owner references (users or teams) to assign to the table.
domain
string
Fully qualified name of the domain to assign for governance purposes.
tags
array
Array of classification tags to apply to the table.
POST /v1/tables
from metadata.sdk import configure
from metadata.sdk.entities import Tables
from metadata.generated.schema.api.data.createTable import CreateTableRequest

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

request = CreateTableRequest(
    name="customers",
    displayName="Customers",
    databaseSchema="snowflake_prod.analytics.public",
    description="Customer master data table",
    tableType="Regular",
    columns=[
        {"name": "id", "dataType": "INT", "constraint": "PRIMARY_KEY", "description": "Unique customer identifier"},
        {"name": "name", "dataType": "VARCHAR", "dataLength": 256, "description": "Full name of the customer"},
        {"name": "email", "dataType": "VARCHAR", "dataLength": 256, "description": "Customer email address"},
        {"name": "created_at", "dataType": "TIMESTAMP", "description": "Account creation timestamp"}
    ]
)

table = Tables.create(request)
print(f"Created: {table.fullyQualifiedName}")
{
  "id": "455e3d9d-dbbf-455e-b3be-7191daa825f3",
  "name": "agent_performance_summary",
  "fullyQualifiedName": "sample_data.ecommerce_db.shopify.agent_performance_summary",
  "description": "Summary of agent performance metrics derived from multiple tables including ssot_utilization_detail for comprehensive reporting.",
  "version": 0.1,
  "updatedAt": 1769982651320,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/tables/455e3d9d-dbbf-455e-b3be-7191daa825f3",
  "tableType": "Regular",
  "columns": [
    {
      "name": "agent_id",
      "dataType": "VARCHAR",
      "dataLength": 100,
      "dataTypeDisplay": "varchar",
      "description": "Agent identifier",
      "fullyQualifiedName": "sample_data.ecommerce_db.shopify.agent_performance_summary.agent_id",
      "tags": [],
      "ordinalPosition": 1
    },
    {
      "name": "performance_score",
      "dataType": "DECIMAL",
      "dataTypeDisplay": "decimal",
      "description": "Overall performance score",
      "fullyQualifiedName": "sample_data.ecommerce_db.shopify.agent_performance_summary.performance_score",
      "tags": [],
      "ordinalPosition": 2
    }
  ],
  "owners": [],
  "databaseSchema": {
    "id": "4dd30184-009c-4792-b296-9562eaed651f",
    "type": "databaseSchema",
    "name": "shopify",
    "fullyQualifiedName": "sample_data.ecommerce_db.shopify",
    "description": "This **mock** database contains schema related to shopify sales and orders with related dimension tables.",
    "displayName": "shopify",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/databaseSchemas/4dd30184-009c-4792-b296-9562eaed651f"
  },
  "database": {
    "id": "0be090de-0941-48c4-af49-a6157c91cda0",
    "type": "database",
    "name": "ecommerce_db",
    "fullyQualifiedName": "sample_data.ecommerce_db",
    "description": "This **mock** database contains schemas related to shopify sales and orders with related dimension tables.",
    "displayName": "ecommerce_db",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/databases/0be090de-0941-48c4-af49-a6157c91cda0"
  },
  "service": {
    "id": "fd2193af-fe09-4366-92b7-1e0d01cd8c09",
    "type": "databaseService",
    "name": "sample_data",
    "fullyQualifiedName": "sample_data",
    "displayName": "sample_data",
    "deleted": false,
    "href": "http://localhost:8585/api/v1/services/databaseServices/fd2193af-fe09-4366-92b7-1e0d01cd8c09"
  },
  "serviceType": "BigQuery",
  "tags": [],
  "deleted": false
}

Returns

Returns the created table object with all specified properties, system-generated fields, and fully qualified names for each column.

Response

id
string
Unique identifier for the table (UUID format).
name
string
Table name.
fullyQualifiedName
string
Fully qualified name in format service.database.schema.table.
displayName
string
Human-readable display name.
description
string
Description of the table in Markdown format.
tableType
string
Type of table (e.g., Regular, View, MaterializedView).
columns
array
Array of column definitions.
databaseSchema
object
Reference to the parent database schema.
service
object
Reference to the parent database service.
serviceType
string
Type of database service (e.g., Snowflake, BigQuery, PostgreSQL).
version
number
Version number for the entity (starts at 0.1).

Create or Update (PUT)

Use PUT /v1/tables instead of POST to perform an upsert. If a table with the same fullyQualifiedName already exists, it will be updated; otherwise, a new table is created. The request body is the same as POST.
curl -X PUT "{base_url}/api/v1/tables" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
PUT will not return a 409 conflict error if the entity already exists — it will update the existing entity instead.

Bulk Create or Update (PUT)

Use PUT /v1/tables/bulk to create or update multiple tables in a single request. The request body is an array of create request objects.
curl -X PUT "{base_url}/api/v1/tables/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "table_one", "databaseSchema": "service.db.schema", "columns": [{"name": "id", "dataType": "INT"}] },
    { "name": "table_two", "databaseSchema": "service.db.schema", "columns": [{"name": "id", "dataType": "INT"}] }
  ]'

Error Handling

CodeError TypeDescription
400BAD_REQUESTInvalid request body, missing required fields, or invalid column definitions
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to create tables
409ENTITY_ALREADY_EXISTSTable with same name already exists in schema (POST only)