Queue a study run or experiment (enforces auto_approve_credits guardrail)
const url = 'https://app.discotrace.com/api/v1/jobs';const options = { method: 'POST', headers: { 'Idempotency-Key': 'run-2026-11-29-pass2', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"study_slug":"core-discovery","job_kind":"baseline_pass","plan_spec":{"roster":"consumer","surfaces":["openai","claude","gemini","perplexity","google_ai_overviews"],"personas":["VP of Operations","Head of IT"],"situations":["Replacing legacy tool","Evaluating compliance fit"],"active_cells":9,"precision":"standard","scope":"pass1_baseline","cadence":"one_off","include_preference":true,"shown_cells":4,"edit_tests":1},"dry_run":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.discotrace.com/api/v1/jobs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: run-2026-11-29-pass2' \ --data '{ "study_slug": "core-discovery", "job_kind": "baseline_pass", "plan_spec": { "roster": "consumer", "surfaces": [ "openai", "claude", "gemini", "perplexity", "google_ai_overviews" ], "personas": [ "VP of Operations", "Head of IT" ], "situations": [ "Replacing legacy tool", "Evaluating compliance fit" ], "active_cells": 9, "precision": "standard", "scope": "pass1_baseline", "cadence": "one_off", "include_preference": true, "shown_cells": 4, "edit_tests": 1 }, "dry_run": false }'Requires run scope. Returns 201 when queued immediately (dry_run: true, dt_test_ key, or within auto_approve_credits and available balance) or 202 (status: awaiting_approval) with a 1-click portal resolveUrl.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Example
run-2026-11-29-pass2Optional 24-hour idempotency key to prevent duplicate creation or duplicate job queues on retry.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
core-discoveryStudy matrix, AI surface roster, precision preset, and scope configuration.
object
Example
[ "openai", "claude", "gemini", "perplexity", "google_ai_overviews"]Example
[ "VP of Operations", "Head of IT"]Example
[ "Replacing legacy tool", "Evaluating compliance fit"]Example
9Run supplied-page Preference diagnostics (default true on Pass 1, false on Pass 2+).
Example
4Example
1Responses
Section titled “Responses”Job queued for execution.
Job created in awaiting_approval state; open resolveUrl for 1-click portal approval.
Structured error payload with remediation link (resolveUrl).
object
object
object
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}Structured error payload with remediation link (resolveUrl).
object
object
object
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}Structured error payload with remediation link (resolveUrl).
object
object
object
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}Structured error payload with remediation link (resolveUrl).
object
object
object
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}Structured error payload with remediation link (resolveUrl).
object
object
object
Example
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}