`POST /api/apps/{id}/migrations` -- record a new migration and apply every pending migration. Idempotent: re-uploading the same `(name, sql)` is a no-op (the stored checksum matches). Re-uploading the same name with new content surfaces a 400; rename the file to register a follow-up.
POST
/api/apps/{id}/migrations
const url = 'https://example.com/api/apps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/migrations';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","sql":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/apps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/migrations \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "sql": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
sql
required
string
Examplegenerated
{ "name": "example", "sql": "example"}Responses
Section titled “Responses”Media typeapplication/json
What apply_pending_migrations returns – a per-migration verdict
plus the App’s schema name for surface to the UI.
object
applied
required
Array<string>
schema
required
string
skipped_already_applied
required
Array<string>
Examplegenerated
{ "applied": [ "example" ], "schema": "example", "skipped_already_applied": [ "example" ]}