Skip to main content
POST
Create a table in the project's database

Authorizations

Authorization
string
header
required

WorkOS access JWT or a user-owned WorkOS API key. User keys are bound to one organization and restricted to their enabled product permissions. Session-only onboarding and session revocation require an interactive access JWT. No cookie session is assumed.

Headers

X-Request-Id
string

Optional caller-provided correlation identifier.

Required string length: 1 - 128
Idempotency-Key
string
required

Identifies one mutation and its canonical request payload.

Required string length: 1 - 128

Path Parameters

project_id
string
required

Project identifier.

Pattern: ^[0-9A-HJKMNP-TV-Z]{26}$

Body

application/json
environment
enum<string>
required
Available options:
dev,
prod
table
string
required

Name of the new table in the public schema. Lower-case, not a PostgreSQL reserved word and not starting with pg_.

Pattern: ^[a-z_][a-z0-9_]{0,62}$
columns
object[]
required

Columns in the order written. Names are unique, and at most one column is an identity column.

Required array length: 1 - 64 elements
primary_key
string[]

Columns of the primary key, each one of the table's columns. Identity and primary key columns are NOT NULL; omitted when the table has no primary key.

Required array length: 1 - 8 elements
Pattern: ^[a-z_][a-z0-9_]{0,62}$

Response

The table already exists with the same columns, types, nullability, identity, defaults and primary key.

table
object
required