> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcliq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List runs

> Lists runs, newest activity first, 20 per page by default. Narrow it with one of
`realm_id`, `daemon_id`, `workspace_id`, `parent_run_id` (sub-runs of a run), `team_id`
or `team`; without any of them, `org_id` is required and the list covers that
organization's realms. Results never include runs in realms you cannot see.

Requires a signed-in user token; with `realm_id`, a realm member (or higher) with the `runs.view` permission on that realm; with `org_id`, a role with the `runs.view` permission in that organization. With neither, the results are limited to what you can see.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-runs.yaml post /v1/runs/get
openapi: 3.0.3
info:
  title: 'CliqHub API: Runs'
  version: 1.0.0
  description: >-
    Runs of a team on a daemon. People start runs (Start a run), follow them
    (Get a run, Stream

    run activity, Search run logs, Get run telemetry), and control them (Cancel
    a run, Resume a

    run, Supply run inputs). CliqHub hands each control to the run's daemon,
    which must be

    online: when it is not, the call fails with a `run/daemon_offline` or
    `run/daemon_stranded`

    conflict (cancel instead marks the run cancelled on CliqHub).


    Daemons report what happens during a run through the other endpoints here,
    with their realm

    token: Record a new run, Update run status, Complete a run, and three
    separate channels for

    run activity (the live timeline), run telemetry (token usage and traces) and
    run logs (text).
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Runs
    description: >-
      Runs of a team on a daemon. People start runs (Start a run), follow them
      (Get a run, Stream

      run activity, Search run logs, Get run telemetry), and control them
      (Cancel a run, Resume a

      run, Supply run inputs). CliqHub hands each control to the run's daemon,
      which must be

      online: when it is not, the call fails with a `run/daemon_offline` or
      `run/daemon_stranded`

      conflict (cancel instead marks the run cancelled on CliqHub).


      Daemons report what happens during a run through the other endpoints here,
      with their realm

      token: Record a new run, Update run status, Complete a run, and three
      separate channels for

      run activity (the live timeline), run telemetry (token usage and traces)
      and run logs (text).
paths:
  /v1/runs/get:
    post:
      tags:
        - Runs
      summary: List runs
      description: >-
        Lists runs, newest activity first, 20 per page by default. Narrow it
        with one of

        `realm_id`, `daemon_id`, `workspace_id`, `parent_run_id` (sub-runs of a
        run), `team_id`

        or `team`; without any of them, `org_id` is required and the list covers
        that

        organization's realms. Results never include runs in realms you cannot
        see.


        Requires a signed-in user token; with `realm_id`, a realm member (or
        higher) with the `runs.view` permission on that realm; with `org_id`, a
        role with the `runs.view` permission in that organization. With neither,
        the results are limited to what you can see.
      operationId: POST_v1_runs_get
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                  description: Only runs in this workspace.
                parent_run_id:
                  type: string
                  description: >-
                    Only the sub-runs a run started (its `type team` and `map`
                    phases).
                active_only:
                  type: boolean
                  description: Only runs that are `running` or `awaiting_input`.
                limit:
                  type: number
                  description: Page size. Default 20.
                offset:
                  type: integer
                  description: Rows to skip, for paging. Default 0.
                daemon_id:
                  type: string
                  description: Only runs on this daemon.
                realm_id:
                  type: string
                  description: Only runs whose daemon is in this realm.
                team_id:
                  type: string
                  format: uuid
                  description: >-
                    Restrict to runs of this team (any version). Narrowing
                    filter only —

                    the realm-membership gate still applies. May be sent without
                    org_id:

                    the gate then spans the caller's realms in every org.
                team:
                  type: object
                  properties:
                    scope:
                      type: string
                      minLength: 1
                      description: Scope slug
                    slug:
                      type: string
                      minLength: 1
                      description: Team slug (name)
                  required:
                    - scope
                    - slug
                  description: >-
                    Restrict to runs of this team by name — any install of it on
                    any daemon

                    (uninstalled ones included). Use this for a published team:
                    its id is

                    not the id runs carry. Narrowing only; the realm gate still
                    applies.
                org_id:
                  type: string
                  format: uuid
                  description: >-
                    Organization whose realms to list. Required when none of
                    `realm_id`, `daemon_id`, `workspace_id`, `parent_run_id`,
                    `team_id` or `team` is sent.
                query:
                  type: string
                  description: Matches part of the run id or run name.
                state:
                  oneOf:
                    - type: string
                      enum:
                        - running
                        - awaiting_input
                        - completed
                        - failed
                        - cancelled
                        - crashed
                    - type: array
                      items:
                        type: string
                        enum:
                          - running
                          - awaiting_input
                          - completed
                          - failed
                          - cancelled
                          - crashed
                      minItems: 1
                  description: One state, or a list (for example `["failed", "crashed"]`).
                since_ms:
                  type: number
                  description: >-
                    Only runs started at or after this time (epoch
                    milliseconds).
                all:
                  type: boolean
                  description: >-
                    Site admins only: every record on the hub, not just the
                    caller\
                until_ms:
                  type: number
                  description: Only runs started before this time (epoch milliseconds).
                sort_by:
                  type: string
                  enum:
                    - run_name
                    - state
                    - team
                    - started_at
                    - last_updated_at
                  description: Column to sort by. Default `last_updated_at`.
                sort_dir:
                  type: string
                  enum:
                    - asc
                    - desc
                  description: '`asc` or `desc` (default).'
            examples:
              realm:
                summary: Failed runs in a realm
                value:
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                  state:
                    - failed
                    - crashed
                  limit: 10
              org:
                summary: Recent runs across an organization
                value:
                  org_id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    description: Always `true` on success.
                  data:
                    $ref: '#/components/schemas/RunPagedData'
              example:
                ok: true
                data:
                  items:
                    - run_id: 0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f
                      workspace_id: 9b2e6f10-4c3a-4e7d-8f21-6a5b4c3d2e1f
                      team_id: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
                      daemon_id: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
                      realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                      realm_slug: production
                      org_slug: acme
                      parent_run_id: null
                      parent_phase: null
                      root_run_id: null
                      call_path: null
                      call_depth: 0
                      iteration_key: null
                      run_name: brave-otter
                      state: failed
                      inputs:
                        pr_url: https://github.com/acme/api/pull/42
                      error: 'phase fix: tests failed'
                      execution_type: local
                      current_pid: null
                      current_phase: null
                      external_id: null
                      context_labels: null
                      lease_expires_at: null
                      started_at: 1759834200000
                      completed_at: 1759834700000
                      team_label: '@acme/code-review'
                      workspace_name: acme-api
                      last_updated_at: 1759834700000
                  total: 1
                  offset: 0
                  limit: 10
                  type: array
        '401':
          description: >-
            `unauthorized`: No `Authorization` header, or the token is
            malformed, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                unauthorized:
                  summary: unauthorized
                  value:
                    ok: false
                    error:
                      code: unauthorized
                      message: Authentication required
        '403':
          description: >-
            `forbidden`: You can see the realm or organization but your role
            lacks the required permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                forbidden:
                  summary: forbidden
                  value:
                    ok: false
                    error:
                      code: forbidden
                      message: You do not have access to do this
        '404':
          description: >-
            `not_found`: The realm or organization you named does not exist or
            you cannot see it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                not_found:
                  summary: not_found
                  value:
                    ok: false
                    error:
                      code: not_found
                      message: Not found
        '422':
          description: >-
            `invalid_params`: The body fails the schema, or it names no scope:
            none of `org_id`, `realm_id`, `daemon_id`, `workspace_id`,
            `parent_run_id`, `team_id` or `team` was sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: >-
                      org_id: org_id is required when listing recent runs
                      without realm_id, daemon_id, workspace_id, parent_run_id,
                      team_id or team
                    code: invalid_params
        '500':
          description: >-
            `internal_error`: An unexpected server fault. Retry later; if it
            persists, report it with the time of the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                internal_error:
                  summary: internal_error
                  value:
                    ok: false
                    error: Internal server error
                    code: internal_error
      security:
        - BearerAuth: []
components:
  schemas:
    RunPagedData:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              run_id:
                type: string
                description: Hub run id (primary key)
              workspace_id:
                type: string
                description: Workspace UUID
              team_id:
                type: string
                description: Team UUID
              daemon_id:
                type: string
                nullable: true
                description: Daemon id executing the run, or null
              realm_id:
                type: string
                nullable: true
                description: Realm id snapshotted at create
              realm_slug:
                type: string
                nullable: true
                description: Slug of that realm (runs/get list rows)
              org_slug:
                type: string
                nullable: true
                description: Slug of the realm\
              parent_run_id:
                type: string
                nullable: true
                description: Parent run id for nested runs
              parent_phase:
                type: string
                nullable: true
                description: Parent phase that spawned this run
              root_run_id:
                type: string
                nullable: true
                description: Top-level ancestor run id
              call_path:
                type: string
                nullable: true
                description: JSON array of parent phase names
              call_depth:
                type: number
                description: Length of call_path
              iteration_key:
                type: string
                nullable: true
                description: Map iteration key, or null
              run_name:
                type: string
                nullable: true
                description: Optional display name
              state:
                type: string
                description: Lifecycle state (running, completed, failed, …)
              inputs:
                type: object
                additionalProperties: true
                nullable: true
                description: Run inputs (parsed JSON or raw)
              error:
                type: string
                nullable: true
                description: Terminal error message when failed/crashed
              execution_type:
                type: string
                description: Execution type (e.g. local)
              current_pid:
                type: number
                nullable: true
                description: OS pid of current agent process
              current_phase:
                type: string
                nullable: true
                description: Phase currently executing
              external_id:
                type: string
                nullable: true
                description: External correlation id
              context_labels:
                type: object
                additionalProperties: true
                nullable: true
                description: Context labels map or JSON string
              reviewers:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                nullable: true
                description: Reviewers per human phase chosen at run start, or null
              notify_channels:
                type: array
                items:
                  type: string
                nullable: true
                description: >-
                  Notification channels chosen at run start for its lifecycle
                  events, or null
              lease_expires_at:
                type: number
                nullable: true
                description: Action lease expiry (unix ms)
              started_at:
                type: number
                description: Start time (unix ms)
              completed_at:
                type: number
                nullable: true
                description: Completion time (unix ms)
              team_label:
                type: string
                nullable: true
                description: Canonical @scope/team label
              workspace_name:
                type: string
                nullable: true
                description: Workspace display name
              workspace_dir:
                type: string
                nullable: true
                description: Workspace absolute path
              last_updated_at:
                type: number
                nullable: true
                description: Best-effort last activity (unix ms)
              pending_control:
                type: object
                properties:
                  tx_id:
                    type: string
                    description: Command outbox transaction id
                  endpoint:
                    type: string
                    description: Outbox path of the pending control command
                  enqueued_at:
                    type: number
                    description: When the command was queued (unix ms)
                  attempts:
                    type: number
                    description: Delivery attempts so far
                  max_attempts:
                    type: number
                    description: Max delivery attempts before permanent failure
                  delivered_at:
                    type: number
                    nullable: true
                    description: When last delivered to daemon (unix ms)
                  last_error:
                    type: string
                    nullable: true
                    description: Last delivery error message
                  ack_status:
                    type: string
                    nullable: true
                    description: Ack status when partially acked
                required:
                  - tx_id
                  - endpoint
                  - enqueued_at
                  - attempts
                  - max_attempts
                  - delivered_at
                  - last_error
                  - ack_status
                description: In-flight control command for the detail banner
                nullable: true
              force_terminate:
                type: object
                properties:
                  already_terminated:
                    type: boolean
                    description: True when force_terminated_at is set
                  terminated_at:
                    type: number
                    nullable: true
                    description: Force-terminate time (unix ms)
                  terminated_by_user_id:
                    type: string
                    nullable: true
                    description: User id who force-terminated
                  terminated_reason:
                    type: string
                    nullable: true
                    description: Reason string stamped on force-terminate
                  eligible:
                    type: boolean
                    description: Whether force-terminate may be offered now
                  trigger:
                    type: string
                    enum:
                      - stale_cancel
                      - daemon_offline
                      - lease_expired
                    nullable: true
                    description: Which condition tripped eligibility
                  blocker:
                    type: string
                    nullable: true
                    description: Human message when not eligible
                required:
                  - already_terminated
                  - terminated_at
                  - terminated_by_user_id
                  - terminated_reason
                  - eligible
                  - trigger
                  - blocker
                description: Force-terminate eligibility / outcome
                nullable: true
              state_lost_at:
                type: number
                nullable: true
                description: When daemon reported run_not_found (unix ms)
              team_version_id:
                type: string
                nullable: true
                description: Published team version id when known
              history:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: >-
                        run.started, run.resume_requested, run.resumed,
                        run.completed, run.failed, run.crashed or run.cancelled
                    at:
                      type: number
                      description: Unix ms
                    from_phase:
                      type: string
                      nullable: true
                      description: Phase a resume started from
                    phase:
                      type: string
                      nullable: true
                      description: Phase current at the time
                    error:
                      type: string
                      nullable: true
                    actor:
                      type: object
                      properties:
                        id:
                          type: string
                        username:
                          type: string
                          nullable: true
                        display_name:
                          type: string
                          nullable: true
                      required:
                        - id
                        - username
                        - display_name
                      nullable: true
                      description: Who did it, when a person did (resume requests)
                  required:
                    - type
                    - at
                    - from_phase
                    - phase
                    - error
                    - actor
                description: 'Only with `with_history: true`'
            required:
              - run_id
              - workspace_id
              - team_id
              - daemon_id
              - realm_id
              - parent_run_id
              - parent_phase
              - root_run_id
              - call_path
              - call_depth
              - iteration_key
              - run_name
              - state
              - inputs
              - error
              - execution_type
              - current_pid
              - current_phase
              - external_id
              - context_labels
              - lease_expires_at
              - started_at
              - completed_at
            description: Run resource on the wire
          description: Run rows for this page
        total:
          type: number
          description: Total matching rows
        offset:
          type: number
          description: Page offset
        limit:
          type: number
          description: Page size
      required:
        - items
        - total
        - offset
        - limit
      description: Paged RunData list
    HubErr:
      type: object
      required:
        - ok
        - error
      description: >-
        Every failure. Route-policy denials (401/403/404, and 400 when neither
        realm_id nor org_id was sent) answer `error` as `{ code, message }`;
        errors raised by the endpoint answer `error` as the message with the
        code beside it in `code`. Every error has a code. See
        [Errors](/hub-api/errors).
      properties:
        ok:
          type: boolean
          description: Always false on error
        error:
          description: The message, or `{ code, message }` for an access denial.
          oneOf:
            - type: string
            - type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                message:
                  type: string
        code:
          type: string
          description: Stable error code of an endpoint error.
        details:
          type: object
          additionalProperties: true
          description: Structured detail, when there is some.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cliq_tok_* | cliq_dt_*
      description: >-
        User PAT (`cliq_tok_…`, including session-scoped) or realm token
        (`cliq_dt_…`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.