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.root}")
import org.openmetadata.schema.entity.data.Table;
import org.openmetadata.sdk.fluent.builders.ColumnBuilder;
import org.openmetadata.sdk.fluent.builders.TableBuilder;
Table table = new TableBuilder(client)
.name("customers")
.schemaFQN("snowflake_prod.analytics.public")
.columns(
ColumnBuilder.integer("id").primaryKey(),
ColumnBuilder.varchar("name", 256),
ColumnBuilder.varchar("email", 256),
ColumnBuilder.timestamp("created_at")
)
.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.root}")
import org.openmetadata.schema.entity.data.Table;
import org.openmetadata.sdk.fluent.builders.ColumnBuilder;
import org.openmetadata.sdk.fluent.builders.TableBuilder;
Table table = new TableBuilder(client)
.name("customers")
.schemaFQN("snowflake_prod.analytics.public")
.columns(
ColumnBuilder.integer("id").primaryKey(),
ColumnBuilder.varchar("name", 256),
ColumnBuilder.varchar("email", 256),
ColumnBuilder.timestamp("created_at")
)
.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
Fully qualified name of the parent DatabaseSchema, for example
snowflake_prod.analytics.public.Array of column definitions for the table.
Show properties
Show properties
Type of table:
Regular, External, View, MaterializedView, SecureView, Iceberg, Local, Partitioned, Foreign, Transient.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.root}")
import org.openmetadata.schema.entity.data.Table;
import org.openmetadata.sdk.fluent.builders.ColumnBuilder;
import org.openmetadata.sdk.fluent.builders.TableBuilder;
Table table = new TableBuilder(client)
.name("customers")
.schemaFQN("snowflake_prod.analytics.public")
.columns(
ColumnBuilder.integer("id").primaryKey(),
ColumnBuilder.varchar("name", 256),
ColumnBuilder.varchar("email", 256),
ColumnBuilder.timestamp("created_at")
)
.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
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?