Galon Cloud
Galon API v1

/backend/databases/{database_id}/migrations

Base URL https://api.galon.ai/v1 · export GALON_API_BASE="https://api.galon.ai/v1"

POST /backend/databases/{database_id}/migrations

Apply SQL migrations

Queue versioned SQL migrations on a database. Use when the schema must change. Before: get_database (needs database read access); the user's yes for a live database. Returns the operation (id, status); then get_database_operation (needs database read access). Scope: database:create. A live database requires confirm: true.

API key (Bearer), on the public API endpoint.

Parameters

NameInTypeDescription
database_idpathstring · requiredResource id (UUID) returned by the list or create tool.
Idempotency-Keyheaderstring · required

Request body

application/json

FieldTypeDescription
migrationsarray<object> · requiredMigrations, oldest first; an applied version is skipped.
confirmbooleanRequired true for a live database: the user said yes.

Responses

StatusDescriptionBody
2XXSuccess: the JSON body the route returns (see the description for its fields).object
401Key missing or invalidError
4XXRefused: act on detail.code, then follow detail.next_action (404 not_found while the service is not open to the account).Error

Examples

curl

curl -X POST "$GALON_API_BASE/backend/databases/<database_id>/migrations" \
  -H "Authorization: Bearer $GALON_API_KEY" \
  -H "Idempotency-Key: <unique-key>" \
  -H "Content-Type: application/json" \
  -d '{"migrations": [{"version": "string", "name": "string", "sql": "string"}]}'