Migration Scripts endpoints
Write, check, approve and analyze scripts before they run. Paths are relative to the address of your Simcha DB Studio server.
Through the MCP server these endpoints are the Migration Scripts tool group, on by default.
While this group is on, the MCP server also offers the lookups its tools need: environments_list (List environments, from Environments and Groupings), connections_devops_list (List DB DevOps connections, from Connections), connections_devops_by_environment (List the DB DevOps connections in an environment, from Connections), connections_devops_databases (List the databases on a connection's server, from Connections).
| Method | Path | What it does |
|---|---|---|
| GET | /api/db-devops/scripts | List migration scripts |
| GET | /api/db-devops/scripts/:id | Get a migration script |
| POST | /api/db-devops/scripts | Create a migration script |
| PUT | /api/db-devops/scripts/:id | Change a migration script |
| DELETE | /api/db-devops/scripts/:id | Delete a migration script |
| POST | /api/db-devops/scripts/:id/approve | Approve a migration script |
| POST | /api/db-devops/scripts/:id/reject | Reject a migration script |
| POST | /api/db-devops/scripts/:id/resubmit | Resubmit a rejected migration script |
| GET | /api/db-devops/scripts/:id/compliance | Check a script against the compliance rules |
| GET | /api/db-devops/scripts/pipeline-stages | Show the pipeline stages scripts reached |
| GET | /api/db-devops/scripts/:id/blast-radius | Get the blast radius of a script |
| POST | /api/db-devops/scripts/:id/blast-radius | Compute the blast radius of a script |
| GET | /api/db-devops/scripts/:id/blast-radius/narrative | Explain the blast radius of a script |
| GET | /api/db-devops/scripts/:id/rollback | Get the generated rollback of a script |
| POST | /api/db-devops/scripts/:id/rollback/regenerate | Generate the rollback of a script again |
| POST | /api/db-devops/scripts/:id/shadow-run | Start a shadow run of a script |
| GET | /api/db-devops/scripts/:id/shadow-runs | List the shadow runs of a script |
| GET | /api/db-devops/shadow-runs/:id | Get a shadow run |
| POST | /api/db-devops/shadow-runs/:id/abort | Stop a shadow run |
| GET | /api/db-devops/snapshots/:id | Get a decision snapshot |
| GET | /api/db-devops/snapshots/:id/diff/:otherId | Compare two decision snapshots |
| GET | /api/db-devops/consumers | List the consumers of a connection |
| POST | /api/db-devops/consumers | Register a consumer of an object |
| DELETE | /api/db-devops/consumers/:id | Remove a consumer |
| GET | /api/db-devops/consumers/sampling/:connectionId | Show the usage sampler of a connection |
| POST | /api/db-devops/consumers/sampling/:connectionId | Turn the usage sampler on or off |
| POST | /api/db-devops/consumers/sampling/:connectionId/run | Sample the consumers of a connection now |
GET /api/db-devops/scripts
Lists the scripts the caller can see, newest first, with their SQL, approval status, environment and target. Send page and limit together to get one page.
Reads only · Role: Any signed-in user · MCP tool: scripts_list
| Input | Type | Description |
|---|---|---|
page (query) | integer, 1 or more, optional | The page number, starting at 1. Used only with limit |
limit (query) | integer, 1 or more, optional | Scripts per page. Used only with page |
GET /api/db-devops/scripts/:id
Returns one script with its SQL, rollback SQL, approval status, revision, environment, target and dependencies.
Reads only · Role: Any signed-in user · MCP tool: scripts_get
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
POST /api/db-devops/scripts
Creates a script pending approval, owned by the caller. It has no blast radius report until one is computed with scripts_blast_radius_compute.
Changes data · Role: Any signed-in user · MCP tool: scripts_create
| Input | Type | Description |
|---|---|---|
name (body) | string, required | The script name, up to 500 characters |
description (body) | string, optional | What the script does |
version (body) | string, optional | A version label, up to 50 characters |
sql_content (body) | string, required | The script text, up to 5 MB. It cannot contain NUL characters; a byte order mark at the start is removed |
rollback_sql (body) | string, optional | The statements that undo the script |
environment (body) | string, required | The name of the environment the script is for. It must match an existing environment |
execution_mode (body) | one of release, asap, optional | release (runs only once approved) or asap (can run before approval where the environment does not require approval). Defaults to release when creating |
target_connection_id (body) | string (uuid) or null, optional | The connection the script runs on. It must be in the script environment. Send null to clear it |
target_database (body) | string, optional | The database on the target connection, up to 255 characters |
dependencies (body) | list of string (uuid), optional | Scripts that need a completed run before this one can run. Each can be listed once; a script cannot depend on itself or form a loop |
tags (body) | list of string, optional | Tags for the script |
PUT /api/db-devops/scripts/:id
Changes the fields sent. Changing the SQL or the rollback SQL sets an approved script back to pending approval and every signed-off release holding it back to pending sign-off. Approval fields cannot be changed here.
Changes data · Role: Any signed-in user · MCP tool: scripts_update
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
name (body) | string, optional | The script name, up to 500 characters |
description (body) | string, optional | What the script does |
version (body) | string, optional | A version label, up to 50 characters |
sql_content (body) | string, optional | The script text, up to 5 MB. It cannot contain NUL characters; a byte order mark at the start is removed |
rollback_sql (body) | string, optional | The statements that undo the script |
environment (body) | string, optional | The name of the environment the script is for. It must match an existing environment |
execution_mode (body) | one of release, asap, optional | release (runs only once approved) or asap (can run before approval where the environment does not require approval). Defaults to release when creating |
target_connection_id (body) | string (uuid) or null, optional | The connection the script runs on. It must be in the script environment. Send null to clear it |
target_database (body) | string, optional | The database on the target connection, up to 255 characters |
dependencies (body) | list of string (uuid), optional | Scripts that need a completed run before this one can run. Each can be listed once; a script cannot depend on itself or form a loop |
tags (body) | list of string, optional | Tags for the script |
DELETE /api/db-devops/scripts/:id
Deletes a script. A script used by a release, a run or an approval request cannot be deleted.
Changes data and can remove or overwrite it · Role: Release manager or admin · MCP tool: scripts_delete
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
POST /api/db-devops/scripts/:id/approve
Approves a script that is waiting for approval and notifies its author. An approved or rejected script is 409 NOT_PENDING. When self-approval is turned off, the author cannot approve it, and a script that fails a compliance rule of error severity cannot be approved.
Changes data · Role: Approver, release manager or admin · MCP tool: scripts_approve
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
POST /api/db-devops/scripts/:id/reject
Rejects a script that is waiting for approval, with an optional reason, and notifies its author. An approved or rejected script is 409 NOT_PENDING. A rejected script can be resubmitted.
Changes data · Role: Approver, release manager or admin · MCP tool: scripts_reject
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
reason (body) | string, optional | Why the script is rejected |
rejection_reason (body) | string, optional | Another name for reason, read when reason is left out |
POST /api/db-devops/scripts/:id/resubmit
Sets a rejected script back to pending approval and clears the rejection. Only a rejected script can be resubmitted.
Changes data · Role: Any signed-in user · MCP tool: scripts_resubmit
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
GET /api/db-devops/scripts/:id/compliance
Checks a script against the active compliance rules for its environment and returns each rule result and whether the script passes, which it does when no rule of error severity fails.
Reads only · Role: Any signed-in user · MCP tool: scripts_compliance
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
GET /api/db-devops/scripts/pipeline-stages
For each script in a signed-off release that follows a pipeline, returns the furthest stage it reached: the release, pipeline, environment, stage number and number of stages. Keyed by script ID.
Reads only · Role: Any signed-in user · MCP tool: scripts_pipeline_stages
No inputs.
GET /api/db-devops/scripts/:id/blast-radius
Returns the latest blast radius report of a script: the objects that depend on what it touches, the consumers that read them, totals and whether the report is complete, partial or failed. Returns null when none has been computed.
Reads only · Role: Any signed-in user · MCP tool: scripts_blast_radius
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
POST /api/db-devops/scripts/:id/blast-radius
Reads the dependency graph of the script target database and stores a new blast radius report, which it returns and which replaces the earlier one. This is the only way a report is made. Refused when the script has no target connection; its earlier reports are then removed.
Changes data · Role: Any signed-in user · MCP tool: scripts_blast_radius_compute
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
approvalRequestId (body) | string (uuid), optional | The approval request to link the report to |
GET /api/db-devops/scripts/:id/blast-radius/narrative
Describes the latest blast radius report of a script in plain language using the configured AI provider and records the request in the AI run history. Refused when no report exists, AI is not configured, AI agents are turned off or the rate limit is reached.
Changes data · Role: Any signed-in user · MCP tool: scripts_blast_radius_explain
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
GET /api/db-devops/scripts/:id/rollback
Returns the rollback generated for a script from its target database: status (ready, generating, failed, unavailable or no_target), the rollback SQL, what cannot be undone, the row changes a run captures just before it starts, and whether the script has a rollback written on it, which a run keeps instead. It is generated automatically and never runs by itself. Reading it starts a new generation when the script or its target has changed.
Reads only · Role: Any signed-in user · MCP tool: scripts_rollback
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
POST /api/db-devops/scripts/:id/rollback/regenerate
Reads the catalog of the script target database again and replaces the generated rollback, which it returns. It reads no row values and changes nothing on the target, the script or its approval. Refused when the script has no target connection.
Changes data · Role: Any signed-in user · MCP tool: scripts_rollback_regenerate
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
POST /api/db-devops/scripts/:id/shadow-run
Starts a shadow run in the background: a temporary copy of the target database schema is made on the same server, the script runs there, the schema before and after is compared and the copy is dropped, leaving the target unchanged. Returns the run at once; follow it with scripts_shadow_run_get. A script without a target connection gives a failed run.
Changes data · Role: Any signed-in user · MCP tool: scripts_shadow_run
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
approvalRequestId (body) | string (uuid), optional | The approval request to link the run to |
sample (body) | boolean, optional | true to also copy a sample of rows from the tables the script touches, when the server allows sampling |
GET /api/db-devops/scripts/:id/shadow-runs
Lists the shadow runs of a script with their status, statement results, schema differences and errors.
Reads only · Role: Any signed-in user · MCP tool: scripts_shadow_runs
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The script ID |
GET /api/db-devops/shadow-runs/:id
Returns one shadow run: its status (provisioning, running, succeeded, failed or aborted), pre-flight checks, statement results, schema differences, timing and error.
Reads only · Role: Any signed-in user · MCP tool: scripts_shadow_run_get
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The shadow run ID |
POST /api/db-devops/shadow-runs/:id/abort
Asks a shadow run to stop at its next step before the script runs; the temporary copy is still dropped. A finished run is returned unchanged.
Changes data · Role: Any signed-in user · MCP tool: scripts_shadow_run_abort
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The shadow run ID |
GET /api/db-devops/snapshots/:id
Returns a decision snapshot captured for an approval request: the target schema, statistics, dependency impact and touched objects at that moment, what triggered it and whether the capture is complete. Snapshots hold no row data or credentials.
Reads only · Role: Any signed-in user · MCP tool: scripts_snapshot_get
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The snapshot ID |
GET /api/db-devops/snapshots/:id/diff/:otherId
Compares two decision snapshots of the same connection and returns the objects added, removed or changed from the first to the second. Snapshots of different connections cannot be compared.
Reads only · Role: Any signed-in user · MCP tool: scripts_snapshot_compare
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The earlier snapshot ID |
otherId (path) | string (uuid), required | The later snapshot ID |
GET /api/db-devops/consumers
Lists the consumers recorded for the objects of a connection: services, dashboards, jobs and other readers, either tagged by people or observed by the usage sampler, with when they were last seen. A connectionId that is not a connection id is 400 INVALID_CONNECTION_ID; a connection that does not exist or is not yours to use is 404 CONNECTION_NOT_FOUND.
Reads only · Role: Any signed-in user · MCP tool: scripts_consumers_list
| Input | Type | Description |
|---|---|---|
connectionId (query) | string (uuid), required | The connection ID |
POST /api/db-devops/consumers
Registers a tagged consumer of an object on a connection, shown in the blast radius of scripts that touch it. Registering the same consumer again updates when it was last seen. A connectionId that is not a connection id is 400 INVALID_CONNECTION_ID; a connection that does not exist or is not yours to use is 404 CONNECTION_NOT_FOUND.
Changes data · Role: Any signed-in user · MCP tool: scripts_consumers_add
| Input | Type | Description |
|---|---|---|
connectionId (body) | string (uuid), required | The connection that holds the object |
objectSchema (body) | string, optional | The schema of the object. Defaults to public |
objectName (body) | string, required | The object name |
consumerKind (body) | one of service, dashboard, job, other, required | What kind of consumer it is |
consumerName (body) | string, required | The consumer name |
DELETE /api/db-devops/consumers/:id
Removes a tagged or observed consumer.
Changes data and can remove or overwrite it · Role: Any signed-in user · MCP tool: scripts_consumers_delete
| Input | Type | Description |
|---|---|---|
id (path) | string (uuid), required | The consumer ID |
GET /api/db-devops/consumers/sampling/:connectionId
Shows whether the usage sampler is on for a connection, whether its engine can be sampled and why not, the sampling interval in milliseconds and the days after which an unseen consumer counts as stale.
Reads only · Role: Any signed-in user · MCP tool: scripts_sampler_status
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
POST /api/db-devops/consumers/sampling/:connectionId
Turns the usage sampler on or off for a connection. It cannot be turned on for an engine whose sessions cannot be observed.
Changes data · Role: Any signed-in user · MCP tool: scripts_sampler_set
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |
enabled (body) | boolean, optional | true to turn sampling on; false or left out turns it off |
POST /api/db-devops/consumers/sampling/:connectionId/run
Reads the sessions active on the connection now and records the applications seen reading each object as observed consumers. Returns how many consumer records were added or updated. Refused when the engine cannot be observed.
Changes data · Role: Any signed-in user · MCP tool: scripts_sampler_run
| Input | Type | Description |
|---|---|---|
connectionId (path) | string (uuid), required | The connection ID |