REST API Overview
The DiscoTrace REST API exposes workspace-scoped JSON endpoints under https://app.discotrace.com/api/v1 backed by an auto-synced OpenAPI 3.1 specification.
- Base URL:
https://app.discotrace.com/api/v1 - Live OpenAPI 3.1 JSON:
https://app.discotrace.com/api/v1/openapi.json(mirrored at/docs/openapi.json) - Endpoint-by-endpoint reference: Browse the auto-generated REST API Reference section in the left sidebar.
Authentication & scopes
Section titled “Authentication & scopes”Pass your workspace API key (dt_live_... or dt_test_...) in the Authorization header (or X-API-Key):
curl -sS -H "Authorization: Bearer $DISCOTRACE_API_KEY" \ https://app.discotrace.com/api/v1/studiesEach key carries explicit scopes checked on every route:
| Scope | Allowed Operations |
|---|---|
read |
GET /me, GET /credits, POST /credits/estimate, GET /studies, GET /studies/{slug}, GET /studies/{slug}/runs, GET /studies/{slug}/traces, GET /studies/{slug}/reservations, GET /studies/{slug}/opportunities, GET /studies/{slug}/drafts, GET /jobs, GET /jobs/{id} |
write |
POST /studies, POST /studies/{slug}/drafts, PATCH /studies/{slug}/drafts/{id} |
run |
POST /jobs, and POST /studies when queue_run: true |
API keys are strictly blocked from team membership, share links, billing, and key-creation endpoints (HTTP 403 forbidden_for_api_key).
Idempotency (Idempotency-Key)
Section titled “Idempotency (Idempotency-Key)”State-mutating endpoints that create studies or queue runs (POST /studies and POST /jobs) accept an optional Idempotency-Key header valid for 24 hours:
curl -sS -X POST https://app.discotrace.com/api/v1/jobs \ -H "Authorization: Bearer $DISCOTRACE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: recheck-core-discovery-2026-11-29" \ -d '{"study_slug":"core-discovery","job_kind":"recheck_pass"}'- If a request with the same key already completed, the API replays the exact original status code and JSON body with header
x-idempotent-replay: true. - If a concurrent request with the same key is still executing, the API returns
HTTP 409withcode: "idempotency_in_progress"andretryable: true.
Structured error contract
Section titled “Structured error contract”All 4xx and 5xx responses share one uniform JSON envelope including a human-actionable resolveUrl:
{ "error": { "code": "insufficient_scope", "message": "API key is missing required scope 'run'.", "retryable": false, "resolveUrl": "https://app.discotrace.com/w/acme/api" }}| HTTP Status | Typical error.code |
Meaning |
|---|---|---|
400 |
invalid_study_input, invalid_job_kind, invalid_draft_status |
Request payload failed validation. |
401 |
missing_api_key, invalid_api_key |
Missing, revoked, or expired Bearer key. |
403 |
insufficient_scope, forbidden_for_api_key |
Key lacks the required scope or called a session-only route. |
404 |
study_not_found, draft_not_found, job_not_found |
Resource does not exist in the authenticated workspace. |
409 |
study_slug_exists, idempotency_in_progress |
Duplicate slug or concurrent idempotency claim. |
Job approval status (201 vs. 202)
Section titled “Job approval status (201 vs. 202)”When calling POST /api/v1/jobs:
201 Createdmeans the job enteredqueuedimmediately (eitherdry_run: true,dt_test_key, or quoted credits are within bothauto_approve_creditsand available balance).202 Acceptedmeans the job was saved inawaiting_approvalstate. PresentresolveUrlfrom the response body to a workspace owner for 1-click portal approval.