Skip to main content
Create Table
Creates a new custom table.
Service or master key required. Table management is not reachable with an end-user token, which is why the JS SDK and the React hook are row-only.
Pass the logical name. The server prepends custom_ exactly once, so orders is stored as custom_orders. A logical name that itself begins with custom_ is not special-cased — custom_x stores as custom_custom_x.

Body Parameters

string
required
Logical table name, matching ^[a-zA-Z_][a-zA-Z0-9_]{0,62}$. The physical name is 7 characters longer and must still fit Postgres’s 63-character identifier limit, so an over-long name fails with database/name-too-long.
object[]
Column definitions. Defaults to an empty array — a table can be created with only its managed columns and have columns added later.
boolean
Adds managed createdAt and updatedAt columns. Defaults to true.
boolean
Adds a managed deletedAt column and makes deletes soft by default, so rows can be restored. Defaults to false. Requires timestamps to be enabled — paranoid: true with timestamps: false is rejected.
id, createdAt, updatedAt and deletedAt are managed columns — the platform owns them end to end. They are created for you according to the flags above and cannot be declared here.

Response

Returns 201 Created.
string
The logical name of the created table.

Error Responses

A malformed name, an unknown dataType, or paranoid: true without timestamps.
The physical custom_-prefixed name exceeds Postgres’s 63-character identifier limit.
A column definition used a managed column name.
A project may hold at most 100 custom tables.