Request
POST /api/platform/startRun
Body Parameters
Environment ID from initEnv
Optional test ID for evaluation against assertions
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
Snapshot ID for the ‘before’ state
Example Response
{
"runId": "run-xyz789",
"status": "running",
"beforeSnapshot": "snapshot_abc123_1732645800"
}
What Happens
- Snapshot captured: Current database state is recorded
- Replication started: WAL changes begin being captured
- Run created: Test run record created in database
After startRun, all changes to the environment are tracked until diffRun or evaluateRun is called.
Errors
| Error | Status | Description |
|---|
environment_not_found | 404 | Environment doesn’t exist or expired |
run_already_exists | 400 | A 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}")