Skip to main content

Create a table

POST /projects/:projectid/databases/:dbid/tables

Add an empty table.

Creates a table with the platform's built-in intellectible_id primary key. Add columns with Create a column, or let Insert rows create them for you.

Authentication

  • Project API key: The credential for everything external. Created in Project Settings, bound to one project, and limited to the scopes it was granted. Format: proj.<keyId>.<secret>.
  • Required permission: databases.schema on :dbid.

Path parameters

NameTypeRequiredDefaultDescription
projectidstringYes-The project id.
dbidstringYes-The database id.

Request body

Content type: application/json

NameTypeRequiredDefaultDescription
tblidstringYes-The table name. Must be lower snake case.

Example

{
"tblid": "orders"
}

Example request

curl -X POST \
-H "Authorization: proj.KEY_ID.SECRET" \
-H "Content-Type: application/json" \
-d '{"tblid":"orders"}' \
{{BASE_URL}}/projects/{{PROJECT_ID}}/databases/DATABASE_ID/tables

Responses

201

Created.

{
"tblid": "orders"
}

400

The name is not a valid identifier.