List runs across the organization's spaces

Read-only list of the runs of every space of the organization where the caller reads runs, in one page ordered by start time. Each space contributes what its own role grants there: every run where the caller holds runs:read-all, the caller's own runs where they hold runs:read only, nothing elsewhere. Each row carries its spaceId; map it to a name with GET /api/spaces. input follows the row's space: it is null on a registered agent's run where the caller lacks agents:read. Takes the filters of GET /api/runs; any other query parameter is rejected with 400. A caller who reads runs in no space gets an empty page. 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

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.

Query Parameters

user?string

Filter runs by user. me is the only accepted value and returns strictly the runs the caller launched — even where they hold runs:read-all — composed with every other filter on this operation. Omit (or send an empty value) for every run the caller may see. Any other value — an arbitrary user id, for instance — is rejected with 400; it is never ignored, so a filtered response is never silently widened.

Value in"me"
limit?integer
Default20
Range1 <= value <= 100
startingAfter?string

Cursor: the id of the last run of the previous page. Follow the Link; rel="next" header instead of building it.

kind?string

Filter runs by kind. Omit (or send an empty value) for every kind. Any value outside the enum is rejected with 400; it is never ignored, so a filtered response is never silently widened.

Value in"all" | "package" | "inline"
status?array<>

Filter runs by lifecycle status: one or several of pending, running, success, failed, timeout, cancelled, comma-separated on the wire (status=failed,timeout returns both). Omit (or send an empty value) for every status. Any value outside the set is rejected with 400 — for the whole list, never by dropping the offending member, so a filtered response is never silently widened.

start_date?string

RFC 3339 date and time with an explicit timezone offset or Z.

Formatdate-time
end_date?string

RFC 3339 date and time with an explicit timezone offset or Z.

Formatdate-time
chat_session_id?string

Return only runs launched from this chat session.

space_kind?string

Narrow the list to the runs of team spaces (team) or of personal spaces (personal) among the spaces the caller reaches. It only narrows, never widens: when no reached space matches, the page is empty (total: 0). Omit (or send an empty value) for every reached space. Any value outside the enum is rejected with 400.

Value in"team" | "personal"
spaceId?array<>

Narrow the list to the runs of these spaces, comma-separated on the wire (spaceId=spc_a,spc_b). It only narrows, never widens: a space the caller does not reach matches nothing, so when none is reached the page is empty (total: 0). Composes with space_kind. A value that is not a space id, or more than 100 ids, is rejected with 400. Omit (or send an empty value) for every reached space.

Itemsitems <= 100
packageId?string

Return only the runs of this agent (@scope/name). A package the caller cannot read yields an empty page, not a refusal. A value that is not a package id is rejected with 400; an empty value reads as absent.

Match^@[a-z0-9]([a-z0-9-]*[a-z0-9])?\/[a-z0-9]([a-z0-9-]*[a-z0-9])?$
q?string

Free-text filter, combined with every other filter. Matches the agent the run executed (scope and name, as stamped on the run) and the error it ended on, case-insensitively and anywhere in the value. A query of digits (optionally prefixed with #) also matches the run number. Longer than 200 characters is rejected with 400.

Lengthlength <= 200
unread?boolean

When true, only the runs the caller has not read yet are returned (unread on each row). Read state is per recipient: a run finished for a dashboard user is unread for that user only. A value that is neither true nor false is rejected with 400.

curl -X GET "https://your-instance/api/orgs/string/runs"
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "packageId": "string",
      "userId": "string",
      "orgId": "string",
      "status": "pending",
      "input": {},
      "result": {
        "output": null
      },
      "artifacts": {
        "status": "complete",
        "published": 0,
        "failed": [
          {
            "name": "string",
            "code": "string"
          }
        ]
      },
      "checkpoint": {},
      "error": "string",
      "model_error": {
        "category": "credential_unavailable",
        "reason": "runtime_version_too_old",
        "retryable": true,
        "status": 100,
        "message": "string"
      },
      "token_usage": {
        "input_tokens": 0,
        "output_tokens": 0,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "tiers": [
          {
            "input_tokens_above": 1,
            "input_tokens": 0,
            "output_tokens": 0,
            "cache_creation_input_tokens": 0,
            "cache_read_input_tokens": 0
          }
        ]
      },
      "started_at": "2019-08-24T14:15:22Z",
      "completed_at": "2019-08-24T14:15:22Z",
      "duration": 0,
      "scheduleId": "string",
      "version_label": "string",
      "version_ref": "string",
      "proxy_label": "string",
      "model_label": "string",
      "model_source": "system",
      "cost": 0,
      "cost_pricing_status": "priced",
      "endUserId": "string",
      "apiKeyId": "string",
      "spaceId": "string",
      "metadata": {},
      "generation": {
        "temperature": 0,
        "reasoning_level": "off"
      },
      "generation_override": {
        "temperature": 0,
        "reasoning_level": "off"
      },
      "user_name": "string",
      "end_user_name": "string",
      "api_key_name": "string",
      "schedule_name": "string",
      "model_connection_label": "string",
      "runner_name": "string",
      "runner_kind": "string",
      "agent_scope": "string",
      "agent_name": "string",
      "package_ephemeral": true,
      "file_counts": {
        "input": 0,
        "output": 0
      },
      "inline_manifest": {},
      "inline_prompt": "string",
      "unread": true,
      "runNumber": 0,
      "runOrigin": "platform",
      "contextSnapshot": {},
      "modelCredentialId": "string",
      "connection_overrides": {
        "property1": [],
        "property2": []
      },
      "dependency_overrides": {
        "property1": "string",
        "property2": "string"
      },
      "connections_used": [
        {
          "integration_package_id": "string",
          "label": "string",
          "account_id": "string",
          "source": "admin_pin"
        }
      ],
      "integrations_unbound": [
        {
          "integration_package_id": "string",
          "code": "not_connected",
          "source": "admin_pin"
        }
      ]
    }
  ],
  "total": 0,
  "hasMore": true
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "param": "string",
  "retry_after": 0,
  "login_refusal": "grant",
  "integration_diagnostic": "string",
  "errors": [
    {
      "field": "string",
      "code": "string",
      "message": "string",
      "title": "string",
      "line": 1,
      "column": 1,
      "candidate_connections": [
        {
          "id": "string",
          "label": "string",
          "account_id": "string",
          "owned_by_actor": true,
          "needs_reconnection": true,
          "scopes_granted": [
            "string"
          ],
          "missing_scopes": [
            "string"
          ]
        }
      ],
      "connection_id": "string",
      "missing_scopes": [
        "string"
      ],
      "remedy": "new_connection",
      "owned_by_actor": true,
      "required_scopes": [
        "string"
      ],
      "auth_key": "string",
      "required_auth_key": "string",
      "available_auth_keys": [
        "string"
      ],
      "source": "admin_pin",
      "connect_url": "http://example.com",
      "expiresAt": "2019-08-24T14:15:22Z",
      "packageId": "string"
    }
  ]
}
{
  "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"
}