Skip to content

Run Sandbox

POST
/api/v1/connections/{connection_id}/migrations/sandbox

Run migration in ephemeral sandbox and validate.

Creates a temporary Postgres container, clones the target schema from the latest SchemaSnapshot, generates synthetic data, applies the migration, runs validation queries, and returns structured results.

The sandbox operation runs in a separate thread via asyncio.to_thread() to avoid blocking the FastAPI event loop.

connection_id
required
Connection Id
string format: uuid
SandboxRequest
object
sql
required
Sql

Raw SQL DDL migration to test in an ephemeral Postgres sandbox. Can contain multiple statements.

string
>= 1 characters
validation_queries
Any of:
Array<string>
rows_per_table
Rows Per Table

Number of rows of synthetic data to generate per table in the sandbox. Higher values give more realistic validation but slower execution.

integer
default: 15 >= 1 <= 100

Successful Response

SandboxResultResponse

Response for POST /sandbox.

object
success
required
Success

Whether the request succeeded.

boolean
data
Any of:
SandboxResult
object
passed
required
Passed

Whether the migration applied successfully and all validation queries passed.

boolean
migration_applied
required
Migration Applied

Whether the migration SQL was successfully executed against the sandbox schema.

boolean
migration_error
Any of:
string
tables_created
required
Tables Created

Number of tables created in the sandbox from the schema snapshot.

integer
rows_inserted
required
Rows Inserted

Total number of synthetic data rows inserted across all tables.

integer
validation_results
required
Validation Results

Results of each validation query run against the post-migration sandbox.

Array<object>
ValidationQueryResult
object
query
required
Query

The SQL validation query that was executed.

string
passed
required
Passed

Whether the validation query completed without errors.

boolean
error
Any of:
string
duration_ms
required
Duration Ms

Execution time of the validation query in milliseconds.

integer
duration_ms
required
Duration Ms

Total sandbox execution time in milliseconds, including schema setup, data generation, migration, and validation.

integer
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