Get a run in any space of the organization

One run, in whichever space of the organization holds it — GET /api/runs/{id} without naming the space, with the same body, the same ?wait long-poll and the same rule, judged in the run's own space: where the caller holds runs:read-all there every run, where they hold runs:read only their own runs, and input is null on a registered agent's run where they lack agents:read there. The run carries its spaceId; every act on it (cancel, logs, read state) goes to its single-space route in that space. 404, the same as for an unknown id, for a run in a space the caller does not reach or may not read there. A space the caller holds no role in (a closed space not joined, a private space they are not a member of) contributes nothing, and a credential pinned to a space (a space API key, a space-bound MCP token) reaches that space only. No X-Space-Id: the organization is the path's. An end-user is refused with 403.

GET/api/orgs/{orgId}/runs/{id}

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

orgId*string

Organization ID.

id*string

Query Parameters

wait?|

Hold the request until the run reaches a terminal status or this many seconds elapse (capped at 55, see operation description), then return the run object. 0/false/absent = return immediately (default). Negative, fractional, or non-numeric values return 400. At most 10 concurrent waits per identity — beyond the cap the request returns immediately as if wait were 0 (degrade-to-immediate, see operation description).

curl -X GET "https://your-instance/api/orgs/string/runs/string"
{
  "id": "run_cm1abc123def456",
  "packageId": "@acme/email-sorter",
  "userId": "usr_k7x9m2p4q1",
  "endUserId": null,
  "apiKeyId": null,
  "orgId": "org_r3t5w8y1z6",
  "spaceId": "spc_1d4e7a90-3c21-4b6f-8e05-6a9c2f7b1d38",
  "scheduleId": "sched_cm1abc456def789",
  "status": "success",
  "input": {
    "folder": "inbox",
    "maxEmails": 50
  },
  "result": {
    "output": {
      "processed": 42,
      "labeled": 38
    }
  },
  "artifacts": {
    "status": "complete",
    "published": 2,
    "failed": []
  },
  "checkpoint": {
    "lastProcessedId": "msg_99f2a"
  },
  "error": null,
  "model_error": null,
  "metadata": null,
  "generation": {
    "reasoning_level": "medium"
  },
  "generation_override": null,
  "started_at": "2026-01-15T10:30:00Z",
  "completed_at": "2026-01-15T10:31:12Z",
  "duration": 72000,
  "cost": 0.0034,
  "cost_pricing_status": "priced",
  "unread": true,
  "runNumber": 17,
  "token_usage": {
    "input_tokens": 8200,
    "output_tokens": 4250,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 1024
  },
  "version_label": "1.2.0",
  "version_ref": "1.2.0",
  "proxy_label": null,
  "model_label": "Claude Sonnet 4",
  "model_source": "system",
  "runner_name": null,
  "runner_kind": null,
  "agent_scope": "@acme",
  "agent_name": "email-sorter",
  "runOrigin": "platform",
  "contextSnapshot": null,
  "modelCredentialId": null,
  "connection_overrides": null,
  "dependency_overrides": null,
  "user_name": "Pierre",
  "end_user_name": null,
  "api_key_name": null,
  "schedule_name": "Weekday morning sort",
  "model_connection_label": null,
  "connections_used": null,
  "integrations_unbound": null,
  "package_ephemeral": false,
  "file_counts": {
    "input": 0,
    "output": 0
  }
}
{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "Invalid 'wait' value: expected true, false, or a non-negative integer number of seconds (max 55)",
  "code": "invalid_request",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}