Skip to main content
POST
/
api
/
platform
/
startRun
Start Run
curl --request POST \
  --url https://api.example.com/api/platform/startRun \
  --header 'Content-Type: application/json' \
  --data '
{
  "envId": "<string>",
  "testId": "<string>",
  "testSuiteId": "<string>"
}
'
{
  "runId": "<string>",
  "status": "<string>",
  "beforeSnapshot": "<string>"
}

Request

POST /api/platform/startRun

Body Parameters

envId
string
required
Environment ID from initEnv
testId
string
Optional test ID for evaluation against assertions
testSuiteId
string
Optional test suite ID for grouping results

Example Request

curl -X POST https://api.agentdiff.dev/api/platform/startRun \
  -H "X-API-Key: ad_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "envId": "abc123def456",
    "testId": "test-789"
  }'

Response

runId
string
Unique run identifier
status
string
Run status: "running"
beforeSnapshot
string
Snapshot ID for the ‘before’ state

Example Response

{
  "runId": "run-xyz789",
  "status": "running",
  "beforeSnapshot": "snapshot_abc123_1732645800"
}

What Happens

  1. Snapshot captured: Current database state is recorded
  2. Replication started: WAL changes begin being captured
  3. Run created: Test run record created in database
After startRun, all changes to the environment are tracked until diffRun or evaluateRun is called.

Errors

ErrorStatusDescription
environment_not_found404Environment doesn’t exist or expired
run_already_exists400A run is already active for this environment

SDK Usage

run = client.start_run(
    envId=env.environmentId,
    testId="test-123"  # Optional
)
print(f"Run ID: {run.runId}")