cURL
curl --request POST \ --url https://api.example.com/api/database/migrations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "version": "20260416170500", "name": "create_posts_table", "sql": "CREATE TABLE posts (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), title TEXT NOT NULL);" } '
201
Example
{ "version": "20260416170500", "name": "create_posts_table", "statements": [ "CREATE TABLE posts (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), title TEXT NOT NULL);" ], "createdAt": "2026-04-16T17:05:00.000Z", "message": "Migration executed successfully" }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Migration version in YYYYMMDDHHmmss format.
^\d{14}$
Migration name
1
SQL text to parse and execute immediately
Migration executed and recorded successfully