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.open-metadata.org/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}")
import static org.openmetadata.sdk.fluent.Tables.*;
Table table = Tables.builder()
.name("customers")
.databaseSchema("snowflake_prod.analytics.public")
.columns(List.of(
column("id", "INT").constraint("PRIMARY_KEY"),
column("name", "VARCHAR").dataLength(256),
column("email", "VARCHAR").dataLength(256),
column("created_at", "TIMESTAMP")
))
.create();
curl -X POST "{base_url}/api/v1/tables" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "agent_performance_summary",
"databaseSchema": "sample_data.ecommerce_db.shopify",
"description": "Summary of agent performance metrics derived from multiple tables including ssot_utilization_detail for comprehensive reporting.",
"tableType": "Regular",
"columns": [
{"name": "agent_id", "dataType": "VARCHAR", "dataLength": 100, "description": "Agent identifier"},
{"name": "performance_score", "dataType": "DECIMAL", "description": "Overall performance score"}
]
}'
{
"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
POST
/
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.open-metadata.org/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}")
import static org.openmetadata.sdk.fluent.Tables.*;
Table table = Tables.builder()
.name("customers")
.databaseSchema("snowflake_prod.analytics.public")
.columns(List.of(
column("id", "INT").constraint("PRIMARY_KEY"),
column("name", "VARCHAR").dataLength(256),
column("email", "VARCHAR").dataLength(256),
column("created_at", "TIMESTAMP")
))
.create();
curl -X POST "{base_url}/api/v1/tables" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "agent_performance_summary",
"databaseSchema": "sample_data.ecommerce_db.shopify",
"description": "Summary of agent performance metrics derived from multiple tables including ssot_utilization_detail for comprehensive reporting.",
"tableType": "Regular",
"columns": [
{"name": "agent_id", "dataType": "VARCHAR", "dataLength": 100, "description": "Agent identifier"},
{"name": "performance_score", "dataType": "DECIMAL", "description": "Overall performance score"}
]
}'
{
"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
string
required
Name of the table. Must be unique within the parent schema.
string
required
Fully qualified name of the parent DatabaseSchema (e.g.,
snowflake_prod.analytics.public).array
required
Array of column definitions for the table.
Show properties
Show properties
string
required
Name of the column.
string
required
Data type of the column (e.g.,
INT, VARCHAR, TIMESTAMP, BOOLEAN, ARRAY, MAP).string
Description of the column in Markdown format.
integer
Length of the data type (e.g.,
256 for VARCHAR(256)).string
Column constraint:
PRIMARY_KEY, UNIQUE, NOT_NULL, NULL.array
Classification tags to apply to this column.
string
Human-readable display name for the table.
string
Description of the table in Markdown format.
string
Type of table:
Regular, External, View, MaterializedView, SecureView, Iceberg, Local, Partitioned, Foreign, Transient.string
Data retention period in ISO 8601 duration format (e.g.,
P365D).array
string
Fully qualified name of the domain to assign for governance purposes.
array
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.open-metadata.org/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}")
import static org.openmetadata.sdk.fluent.Tables.*;
Table table = Tables.builder()
.name("customers")
.databaseSchema("snowflake_prod.analytics.public")
.columns(List.of(
column("id", "INT").constraint("PRIMARY_KEY"),
column("name", "VARCHAR").dataLength(256),
column("email", "VARCHAR").dataLength(256),
column("created_at", "TIMESTAMP")
))
.create();
curl -X POST "{base_url}/api/v1/tables" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "agent_performance_summary",
"databaseSchema": "sample_data.ecommerce_db.shopify",
"description": "Summary of agent performance metrics derived from multiple tables including ssot_utilization_detail for comprehensive reporting.",
"tableType": "Regular",
"columns": [
{"name": "agent_id", "dataType": "VARCHAR", "dataLength": 100, "description": "Agent identifier"},
{"name": "performance_score", "dataType": "DECIMAL", "description": "Overall performance score"}
]
}'
{
"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
string
Unique identifier for the table (UUID format).
string
Table name.
string
Fully qualified name in format
service.database.schema.table.string
Human-readable display name.
string
Description of the table in Markdown format.
string
Type of table (e.g.,
Regular, View, MaterializedView).array
object
Reference to the parent database schema.
object
Reference to the parent database service.
string
Type of database service (e.g., Snowflake, BigQuery, PostgreSQL).
number
Version number for the entity (starts at 0.1).
Create or Update (PUT)
UsePUT /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)
UsePUT /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
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid request body, missing required fields, or invalid column definitions |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to create tables |
409 | ENTITY_ALREADY_EXISTS | Table with same name already exists in schema (POST only) |
Was this page helpful?
⌘I