Executions endpoints

Run scripts and releases on databases, follow their progress and roll back. Paths are relative to the address of your Simcha DB Studio server.

Through the MCP server these endpoints are the Executions tool group, on by default.

While this group is on, the MCP server also offers the lookups its tools need: scripts_list (List migration scripts, from Migration Scripts), releases_list (List releases, from Releases), connections_devops_list (List DB DevOps connections, from Connections), connections_devops_databases (List the databases on a connection's server, from Connections).

MethodPathWhat it does
GET/api/db-devops/executionsList script runs
GET/api/db-devops/executions/pageList script runs a page at a time
GET/api/db-devops/executions/recentList the latest script runs
GET/api/db-devops/executions/:idGet a script run
GET/api/db-devops/executions/batches/:batchIdGet a run on several databases
GET/api/db-devops/executions/release-progress/:releaseIdShow the progress of a release run
GET/api/db-devops/deployments/activeList the script runs in progress
GET/api/db-devops/executions/server-nowGet the server time
POST/api/db-devops/executions/runRun a migration script
POST/api/db-devops/executions/run-releaseRun a release
GET/api/db-devops/target-approvalsRead whether a database needs approval
GET/api/db-devops/target-approvals/allList the approval answers for databases in no environment
PUT/api/db-devops/target-approvalsSay whether a database needs approval
POST/api/db-devops/executions/:id/rollbackRoll back a script run

GET /api/db-devops/executions

Lists every script run the caller can see, newest first, with its status, output, rows affected, timing and environment.

Reads only · Role: Any signed-in user · MCP tool: executions_list

No inputs.

GET /api/db-devops/executions/page

Lists the script runs the caller can see, newest first, a page at a time: each run without the SQL it ran, its output or its captured rollback (Get a script run returns those), and with live progress only while it is running. more says whether older runs exist, and next is the before value for the following page.

Reads only · Role: Any signed-in user · MCP tool: executions_page

InputTypeDescription
limit (query)integer, 1 to 500, optionalHow many runs to return. Defaults to 200
before (query)string, optionalThe next value of the previous page, to continue after its last run

GET /api/db-devops/executions/recent

Lists the newest script runs the caller can see.

Reads only · Role: Any signed-in user · MCP tool: executions_recent

InputTypeDescription
limit (query)integer, 1 to 100, optionalHow many runs to return. Defaults to 10

GET /api/db-devops/executions/:id

Returns one script run with its status (RUNNING, COMPLETED, FAILED, ROLLING_BACK or ROLLED_BACK), output, rows affected, timing, live progress, the SQL it ran and its rollback SQL.

Reads only · Role: Any signed-in user · MCP tool: executions_get

InputTypeDescription
id (path)string (uuid), requiredThe run ID

GET /api/db-devops/executions/batches/:batchId

Returns a run on several databases: its status and error, each database (with its schema when one was chosen) with its status and error, and the script runs on each database.

Reads only · Role: Any signed-in user · MCP tool: executions_batch

InputTypeDescription
batchId (path)string (uuid), requiredThe run batch ID

GET /api/db-devops/executions/release-progress/:releaseId

Shows the latest run of a release and, for each of its scripts, the latest script run with its status, rows affected, time, error and live progress.

Reads only · Role: Any signed-in user · MCP tool: executions_release_progress

InputTypeDescription
releaseId (path)string (uuid), requiredThe release ID
since (query)integer, optionalOnly script runs created at or after this time, in milliseconds since 1970

GET /api/db-devops/deployments/active

Lists the script runs in progress the caller can see, with the script, release, environment, connection, database, schema, who started each, when, and its live progress.

Reads only · Role: Any signed-in user · MCP tool: executions_in_progress

No inputs.

GET /api/db-devops/executions/server-now

Returns the server clock in milliseconds since 1970, to measure how long runs in progress have taken.

Reads only · Role: Any signed-in user · MCP tool: executions_server_time

No inputs.

POST /api/db-devops/executions/run

Starts running a script in the background on one connection, or on several databases with targets. The script must be approved, unless it is an asap script and the environment does not require approval, and every script it depends on needs a completed run. A database in no environment runs only after someone has said whether running on it needs approval (executions_target_approval_set); when it does, the script must be approved. Returns the run at once; follow a single run with executions_get and a run on several databases with executions_batch.

Changes data and can remove or overwrite it · Role: Release manager or admin · MCP tool: executions_run · With wait: false it answers 202 and runs in the background

InputTypeDescription
script_id (body)string (uuid), requiredThe script to run
connection_id (body)string (uuid), optionalThe connection to run on. Required unless targets is sent
database (body)string, optionalThe database on the connection. Defaults to the script target database
schema (body)string, optionalThe schema in that database to run in, up to 255 characters: every statement runs with it as the default schema. Oracle, Snowflake and the PostgreSQL family only; the schema must exist in the database. Not used with targets
targets (body)list of object, optionalRun on several databases instead of one connection: 1 to 500, each database and schema listed once, all in one environment. When sent, connection_id and database are not used
targets[].connection_id (body)string (uuid), requiredThe connection ID
targets[].database (body)string, optionalThe database on the connection, up to 255 characters. Leave it out for the connection default
targets[].schema (body)string, optionalThe schema in the database to run in, up to 255 characters: every statement runs with it as the default schema. Oracle, Snowflake and the PostgreSQL family only; the schema must exist in the database. Leave it out for the session default
parallel (body)integer, 1 to 10, optionalWith targets: how many databases run at the same time. Defaults to 1
on_failure (body)one of stop, continue, optionalWith targets: when a database fails, stop (the rest are not run) or continue. Defaults to stop
mode (body)one of transactional, halt, continue, optionalHow the scripts run: transactional (all or nothing where the engine supports it), halt (stop at the first failing statement) or continue (run every statement)
wait (body)boolean, optionalfalse answers at once with 202 and keeps running in the background; left out or true waits for the result

POST /api/db-devops/executions/run-release

Starts running a signed-off release in the background, its scripts in release order, stopping on a database at the first failing script: without targets, scripts with their own target connection run there and the rest on connection_id; with targets, every script runs on each listed database. Refused for a release that follows a pipeline (promote it instead), a run that spans environments or one whose environment gates are not met (on databases in no environment, someone must first say whether running there needs approval, and when it does the release needs an approved request for No environment); a release whose scripts changed since sign-off is set back to pending sign-off. Follow it with executions_release_progress, or with executions_batch when targets are sent.

Changes data and can remove or overwrite it · Role: Release manager or admin · MCP tool: executions_run_release · With wait: false it answers 202 and runs in the background

InputTypeDescription
release_id (body)string (uuid), requiredThe release to run
connection_id (body)string (uuid), optionalThe connection for scripts without their own target connection. Required unless targets is sent
database (body)string, optionalThe database on that connection
targets (body)list of object, optionalRun on several databases instead of one connection: 1 to 500, each database and schema listed once, all in one environment. When sent, connection_id and database are not used
targets[].connection_id (body)string (uuid), requiredThe connection ID
targets[].database (body)string, optionalThe database on the connection, up to 255 characters. Leave it out for the connection default
targets[].schema (body)string, optionalThe schema in the database to run in, up to 255 characters: every statement runs with it as the default schema. Oracle, Snowflake and the PostgreSQL family only; the schema must exist in the database. Leave it out for the session default
parallel (body)integer, 1 to 10, optionalWith targets: how many databases run at the same time. Defaults to 1
on_failure (body)one of stop, continue, optionalWith targets: when a database fails, stop (the rest are not run) or continue. Defaults to stop
mode (body)one of transactional, halt, continue, optionalHow the scripts run: transactional (all or nothing where the engine supports it), halt (stop at the first failing statement) or continue (run every statement)
wait (body)boolean, optionalfalse answers at once with 202 and keeps running in the background; left out or true waits for the result

GET /api/db-devops/target-approvals

For a database in no environment, returns whether running on it needs approval, who said so and when (needsApproval is null until someone has). A database in an environment returns that environment, which decides instead.

Reads only · Role: Any signed-in user · MCP tool: executions_target_approval_get

InputTypeDescription
connectionId (query)string (uuid), requiredThe connection
database (query)string, optionalThe database on the connection. Leave it out for the connection default

GET /api/db-devops/target-approvals/all

Lists every database in no environment someone has said needs approval or not, with who chose it and when.

Reads only · Role: Any signed-in user · MCP tool: executions_target_approvals_list

No inputs.

PUT /api/db-devops/target-approvals

Records whether running on a database in no environment needs approval, with who chose it, in the Audit Log. Needs approval makes runs there wait for the script approval or, for a release, an approved request for No environment. Refused for a database in an environment, which follows that environment; when a database joins an environment its answer is dropped, so it is asked again if it leaves every environment.

Changes data · Role: Release manager or admin · MCP tool: executions_target_approval_set

InputTypeDescription
connectionId (body)string (uuid), requiredThe connection
database (body)string, optionalThe database on the connection. Leave it out for the connection default
needsApproval (body)boolean, requiredtrue when running there needs approval, false when it does not

POST /api/db-devops/executions/:id/rollback

Starts running the rollback SQL of a completed script run on the same database in the background, then marks the run rolled back. Only a completed run that is not itself a rollback and has rollback statements can be rolled back. Returns the run and the new rollback run at once; follow the rollback run with executions_get.

Changes data and can remove or overwrite it · Role: Release manager or admin · MCP tool: executions_rollback · With wait: false it answers 202 and runs in the background

InputTypeDescription
id (path)string (uuid), requiredThe run ID
reason (body)string, requiredWhy the run is rolled back, up to 2000 characters
wait (body)boolean, optionalfalse answers at once with 202 and keeps running in the background; left out or true waits for the result