Reference

API & CLI

Automate schema design from your own pipelines. Authenticate with a workspace token and everything the Studio does is available over HTTP.

Authentication

curl https://api.tablecraftai.com/v1/schemas \
  -H "Authorization: Bearer $TABLECRAFT_TOKEN"

REST endpoints

GET
/v1/schemasList every schema in the workspace.
POST
/v1/schemasCreate a schema from tables or a prompt.
GET
/v1/schemas/:idFetch a schema with tables, columns and relations.
PATCH
/v1/schemas/:idUpdate tables, columns or the target dialect.
POST
/v1/schemas/:id/exportRender SQL, Prisma, TypeScript, Python or DBML.
POST
/v1/schemas/:id/diffDiff two versions and return migration files.
DELETE
/v1/schemas/:idPermanently delete a schema.

CLI commands

tablecraft login

Authenticate the CLI against your workspace.

tablecraft init --template saas

Scaffold a new schema from a template.

tablecraft pull --schema billing

Download the latest schema definition.

tablecraft push

Publish local changes back to the workspace.

tablecraft export --format sql

Generate code for your target dialect.

tablecraft check

Fail CI when the schema has health issues.

Rate limits

Free workspaces get 60 requests per minute, Pro 600, and Enterprise limits are agreed per contract. Every response includes X-RateLimit-Remaining.