Skip to content

Execute Migration

POST
/api/v1/migrations/execute

Accept an approval token and start migration execution on production.

Returns a request_id immediately. The migration runs in the background. Poll GET /migrations/requests/{request_id} for status and results.

ExecuteRequest
object
approval_token
required
Approval Token

HMAC-signed approval token from the /analyze endpoint. Encodes the SQL, connection ID, and a single-use nonce. Expires after 1 hour.

string
>= 1 characters
sql
required
Sql

Exact SQL migration text that was analyzed. Must match the SQL encoded in the approval token byte-for-byte.

string
>= 1 characters
connection_id
required
Connection Id

ID of the database connection to execute the migration against. Must match the connection encoded in the approval token.

string format: uuid

Successful Response

ExecuteAcceptedResponse

Response for POST /execute.

object
success
required
Success

Whether the request succeeded.

boolean
data
Any of:
object
key
additional properties
any
error
Any of:
ErrorDetail
object
code
required
Code

Machine-readable error code (e.g., ‘NOT_FOUND’, ‘VALIDATION_ERROR’).

string
message
required
Message

Human-readable error message describing what went wrong.

string
details
Any of:

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object