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

# Get daemon status

> Returns who this daemon is (process, version, host), whether and as whom it is signed in
to CliqHub, which realm it is in, and the signed-in user's organizations, realms and
tokens. The CLI also calls it to check the daemon is reachable. Takes no fields; send `{}`.

When signed in, the daemon asks CliqHub for the profile on each call; if CliqHub is
slow or down, `hub_profile` is `null` but the call still succeeds.

From the CLI: `cliq whoami`.

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-daemon.yaml post /v1/daemon/status
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 Daemon
    description: >-
      This daemon process: who it is and who it is signed in as, a summary of
      what it holds,

      and restart.
paths:
  /v1/daemon/status:
    post:
      tags:
        - Daemon Daemon
      summary: Get daemon status
      description: >-
        Returns who this daemon is (process, version, host), whether and as whom
        it is signed in

        to CliqHub, which realm it is in, and the signed-in user's
        organizations, realms and

        tokens. The CLI also calls it to check the daemon is reachable. Takes no
        fields; send `{}`.


        When signed in, the daemon asks CliqHub for the profile on each call; if
        CliqHub is

        slow or down, `hub_profile` is `null` but the call still succeeds.


        From the CLI: `cliq whoami`.


        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_daemon_status
      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/DaemonStatus'
              example:
                ok: true
                data:
                  pid: 48213
                  version: 1.9.45
                  uptime_ms: 3600000
                  host: dev-laptop
                  platform: darwin-arm64
                  node_version: v22.11.0
                  scope_names:
                    - acme
                  scope_count: 1
                  setup_complete: true
                  daemon_id: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
                  hub_daemon_id: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
                  user_id: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                  username: sshah
                  user_email: dev@acme.example
                  hub_logged_in: true
                  hub_url: https://api.cliqhub.io
                  realm: acme.production
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                  hub_profile:
                    orgs:
                      - id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
                        slug: acme
                        name: Acme Inc.
                        default_realm_slug: production
                    realms:
                      - id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                        slug: production
                        qualified_slug: acme.production
                    tokens:
                      - id: '42'
                        type: user
                        name: laptop
                        created_at: 1759830000000
                        last_used_at: 1759834200000
                        revoked_at: null
                  sync_paused_on: []
        '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:
    DaemonStatus:
      type: object
      required:
        - pid
        - version
        - uptime_ms
        - host
        - platform
        - node_version
        - scope_names
        - scope_count
        - setup_complete
        - daemon_id
        - hub_daemon_id
        - user_id
        - username
        - user_email
        - hub_logged_in
        - hub_url
        - realm
        - realm_id
        - hub_profile
        - sync_paused_on
      properties:
        pid:
          type: integer
          description: OS process id.
          example: 48213
        version:
          type: string
          description: cliqd version.
          example: 1.9.45
        uptime_ms:
          type: integer
          description: Milliseconds since the process started.
          example: 3600000
        host:
          type: string
          description: Machine hostname.
          example: dev-laptop
        platform:
          type: string
          description: '`<os>-<arch>`.'
          example: darwin-arm64
        node_version:
          type: string
          example: v22.11.0
        scope_names:
          type: array
          items:
            type: string
          description: Scopes of the installed teams, sorted.
          example:
            - acme
            - local
        scope_count:
          type: integer
          example: 2
        setup_complete:
          type: boolean
          description: At least one scope exists (a team has been installed).
          example: true
        daemon_id:
          type:
            - string
            - 'null'
          description: This daemon's id, once it has one.
          example: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
        hub_daemon_id:
          type:
            - string
            - 'null'
          description: The id CliqHub knows this daemon by, once registered.
          example: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
        user_id:
          type:
            - string
            - 'null'
          description: CliqHub user the daemon is signed in as.
          example: null
        username:
          type:
            - string
            - 'null'
          example: sshah
        user_email:
          type:
            - string
            - 'null'
          example: dev@acme.example
        hub_logged_in:
          type: boolean
          description: The daemon holds a CliqHub sign-in.
          example: true
        hub_url:
          type:
            - string
            - 'null'
          description: The CliqHub API it talks to; `null` when not signed in.
          example: https://api.cliqhub.io
        realm:
          type:
            - string
            - 'null'
          description: The realm this daemon is in, as `org.realm`.
          example: acme.production
        realm_id:
          type:
            - string
            - 'null'
          example: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
        hub_profile:
          type:
            - object
            - 'null'
          description: >-
            The signed-in user's organizations, realms and tokens, read from
            CliqHub. `null` when not signed in or CliqHub could not be reached;
            a part CliqHub did not answer is an empty list.
          required:
            - orgs
            - realms
            - tokens
          properties:
            orgs:
              type: array
              items:
                type: object
                required:
                  - id
                  - slug
                  - name
                  - default_realm_slug
                properties:
                  id:
                    type: string
                    format: uuid
                  slug:
                    type: string
                    example: acme
                  name:
                    type:
                      - string
                      - 'null'
                    example: Acme Inc.
                  default_realm_slug:
                    type:
                      - string
                      - 'null'
                    example: production
            realms:
              type: array
              items:
                type: object
                required:
                  - slug
                  - qualified_slug
                properties:
                  id:
                    type: string
                    format: uuid
                  slug:
                    type: string
                    example: production
                  qualified_slug:
                    type:
                      - string
                      - 'null'
                    example: acme.production
            tokens:
              type: array
              description: Token metadata only, never the secret.
              items:
                type: object
                required:
                  - id
                  - type
                  - name
                  - created_at
                properties:
                  id:
                    type: string
                  type:
                    type: string
                    example: user
                  name:
                    type: string
                    example: laptop
                  realm_id:
                    type: string
                  created_at:
                    type:
                      - integer
                      - string
                  last_used_at:
                    type:
                      - integer
                      - string
                      - 'null'
                  revoked_at:
                    type:
                      - integer
                      - string
                      - 'null'
        sync_paused_on:
          type: array
          items:
            type: string
          description: >-
            Teams (`scope/slug`) syncing with CliqHub is paused on because they
            are not on the realm's team list. Empty when syncing normally.
          example: []
    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`, …
  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.