API Reference · Database

Apply a migration

Apply a named SQL migration transactionally. It is recorded in `_platform_migrations` and committed to the database's git repo, so the schema history stays replayable. Body capped at 512KB.

POST/v1/tenants/{name}/workloads/{id}/db/migrations

Authorization

x-api-keystringrequired
Your per-workspace API key, e.g. llc_AbC123…. Also accepted as Authorization: Bearer <key>. Mint keys on your workspace's API keys page — each key belongs to one workspace.

Path parameters

namestringrequired
Workspace (tenant) name.
idstringrequired
Workload id within the workspace.

Body

namestringrequired
e.g. add_orders_index
sqlstringrequired
e.g. CREATE INDEX idx_orders_user ON orders(user_id);

Response

200Migration applied and recorded.

curl -X POST https://api.live-llm.com/v1/tenants/acme/workloads/web/db/migrations \
  -H "x-api-key: $LIVELLM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "add_orders_index",
    "sql": "CREATE INDEX idx_orders_user ON orders(user_id);"
  }'
Try itPOSThttps://api.live-llm.com/v1/tenants/{name}/workloads/{id}/db/migrations
Fill required path params: name, id.
Example response200
Migration applied and recorded.