> ## 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 instances

> Lists the 50 most recent runs as instances, newest first, in every state, with where each executes. Takes no fields; send `{}`.

From the CLI: `cliq instance list`.

No credential is needed from this machine. From another host, send `Authorization: Bearer` with a dispatch token CliqHub signed for this daemon or a `cliq_tok_…` personal token of a user in the daemon's realm; this only works once the daemon is connected to CliqHub. See [Authentication](/daemon-api/overview#authentication).



## OpenAPI

````yaml /openapi/daemon-by-tag/daemon-instances.yaml post /v1/instances/get
openapi: 3.1.0
info:
  title: cliqd API
  version: 1.9.48
  description: >-
    HTTP API of `cliqd`, the local Cliq daemon. Generated from the daemon source
    by `scripts/generate_daemon_openapi.mjs` — do not edit by hand. See the
    [overview](/daemon-api/overview).
servers:
  - url: http://127.0.0.1:4900
    description: Local daemon (default port; `CLIQ_DAEMON_PORT` changes it)
security: []
tags:
  - name: Daemon Instances
    description: >-
      An **instance** is a run seen from the process side: where it executes (on
      this machine

      or in a Docker container) and how to stop it. The instance id is the run
      id; the run's

      name works too. Used by `cliq instance list | info | stop`.
paths:
  /v1/instances/get:
    post:
      tags:
        - Daemon Instances
      summary: List instances
      description: >-
        Lists the 50 most recent runs as instances, newest first, in every
        state, with where each executes. Takes no fields; send `{}`.


        From the CLI: `cliq instance list`.


        No credential is needed from this machine. From another host, send
        `Authorization: Bearer` with a dispatch token CliqHub signed for this
        daemon or a `cliq_tok_…` personal token of a user in the daemon's realm;
        this only works once the daemon is connected to CliqHub. See
        [Authentication](/daemon-api/overview#authentication).
      operationId: daemon_post_instances_get
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: {}
            examples:
              default:
                value: {}
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    const: true
                  data:
                    $ref: '#/components/schemas/InstanceList'
              example:
                ok: true
                data:
                  instances:
                    - run_id: 0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f
                      run_name: fix-login-timeout
                      workspace_dir: /home/dev/acme-api
                      team_ref: '@acme/code-review'
                      state: running
                      execution: local
                      container_id: null
                      started_at: 1759834200000
                      completed_at: null
        '400':
          description: >-
            `PAYLOAD_INVALID` — The body (query string for `GET`) fails the
            request schema. `details` lists each issue.


            `BAD_REQUEST` — The body is not valid JSON or is larger than the
            route allows (10 MB; artifact uploads more).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
              examples:
                PAYLOAD_INVALID:
                  summary: PAYLOAD_INVALID
                  value:
                    ok: false
                    error:
                      code: PAYLOAD_INVALID
                      message: Payload failed schema validation
                BAD_REQUEST:
                  summary: BAD_REQUEST
                  value:
                    ok: false
                    error:
                      code: BAD_REQUEST
                      message: >-
                        Request body could not be read: Unexpected token } in
                        JSON at position 12
        '401':
          description: >-
            `UNAUTHORIZED` — A caller on another host sent no `Authorization:
            Bearer` token, or one that does not verify (expired, wrong
            audience).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
              examples:
                UNAUTHORIZED:
                  summary: UNAUTHORIZED
                  value:
                    ok: false
                    error:
                      code: UNAUTHORIZED
                      message: Missing or invalid Authorization Bearer token
        '403':
          description: >-
            `WEB_REQUEST_REFUSED` — The request carries an `Origin` header (it
            came from a web page).


            `HOST_NOT_LOCAL` — A loopback caller addressed a `Host` other than
            localhost (DNS rebinding guard).


            `LOCAL_ONLY` — The daemon isn't connected to CliqHub (no dispatch
            key) and the caller is on another host.


            `FORBIDDEN` — A `cliq_tok_…` token's user is not in this daemon's
            realm ACL, or the ACL is not loaded yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
              examples:
                WEB_REQUEST_REFUSED:
                  summary: WEB_REQUEST_REFUSED
                  value:
                    ok: false
                    error:
                      code: WEB_REQUEST_REFUSED
                      message: cliqd doesn't accept requests from web pages
                HOST_NOT_LOCAL:
                  summary: HOST_NOT_LOCAL
                  value:
                    ok: false
                    error:
                      code: HOST_NOT_LOCAL
                      message: cliqd only answers requests addressed to localhost
                LOCAL_ONLY:
                  summary: LOCAL_ONLY
                  value:
                    ok: false
                    error:
                      code: LOCAL_ONLY
                      message: >-
                        This cliqd isn't connected to CliqHub yet, so from
                        another machine it only accepts a local token (minted by
                        tokens/create on the machine running cliqd)
                FORBIDDEN:
                  summary: FORBIDDEN
                  value:
                    ok: false
                    error:
                      code: FORBIDDEN
                      message: Access denied — identity not in realm ACL
        '500':
          description: >-
            `INTERNAL_ERROR` — An unexpected daemon fault. The message names the
            request id; the cause is in the cliqd log.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
              examples:
                INTERNAL_ERROR:
                  summary: INTERNAL_ERROR
                  value:
                    ok: false
                    error:
                      code: INTERNAL_ERROR
                      message: >-
                        cliqd hit an unexpected error (request 7f3a…). Details
                        are in the cliqd log.
      security:
        - {}
        - DaemonBearer: []
components:
  schemas:
    InstanceList:
      type: object
      required:
        - instances
      properties:
        instances:
          type: array
          description: The 50 most recent runs, newest first, in every state.
          items:
            $ref: '#/components/schemas/InstanceSummary'
    ErrorReply:
      type: object
      description: >-
        Every failure. Switch on `error.code` — it is stable; `message` is for
        people and may change.
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable error code. See [Errors](/daemon-api/errors).
              example: TEAM_NOT_FOUND
            message:
              type: string
              description: What went wrong and, where possible, what to do.
              example: Team 'acme/code-review' not found
            details:
              description: >-
                Structured detail when there is some: the list of schema issues
                for `PAYLOAD_INVALID`, the agent problems for
                `TEAM_AGENT_CONFIG_REQUIRED`, …
    InstanceSummary:
      type: object
      required:
        - run_id
        - run_name
        - workspace_dir
        - team_ref
        - state
        - execution
        - container_id
        - started_at
        - completed_at
      properties:
        run_id:
          type: string
          format: uuid
          description: The instance id (same as the run id).
          example: 0c8d7e6f-5a4b-4c3d-9e2f-1a0b9c8d7e6f
        run_name:
          type:
            - string
            - 'null'
          example: fix-login-timeout
        workspace_dir:
          type: string
          description: Workspace folder, or `unknown` when the workspace was unregistered.
          example: /home/dev/acme-api
        team_ref:
          type:
            - string
            - 'null'
          description: '`@scope/slug`, or `null` when the team is no longer installed.'
          example: '@acme/code-review'
        state:
          $ref: '#/components/schemas/RunState'
        execution:
          type: string
          enum:
            - local
            - docker
          description: '`docker` when the run has a container.'
          example: local
        container_id:
          type:
            - string
            - 'null'
          description: Docker container id for `docker` runs.
          example: null
        started_at:
          type: integer
          format: int64
          example: 1759834200000
        completed_at:
          type:
            - integer
            - 'null'
          format: int64
          example: null
    RunState:
      type: string
      enum:
        - running
        - awaiting_input
        - completed
        - failed
        - cancelled
        - crashed
      description: >
        - `running` — a phase is executing

        - `awaiting_input` — paused until someone supplies inputs (Supply run
        inputs)

        - `completed` / `failed` / `cancelled` — finished

        - `crashed` — the daemon stopped while the run was going; it was marked
        crashed on restart
      example: completed
  securitySchemes:
    DaemonBearer:
      type: http
      scheme: bearer
      description: >-
        Not needed from the same machine. From another host: a dispatch JWT
        CliqHub signed for this daemon, or a `cliq_tok_…` personal token whose
        user is in the daemon's realm.

````

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