> ## 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 your tokens

> Lists your tokens (not revoked), newest first, optionally of one `type` or matching `query`. With `realm_id`, the realm's tokens instead (realm admins).

Requires a signed-in user token (`Authorization: Bearer cliq_tok_…`). Results are limited to what that user can see.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-auth.yaml post /v1/auth/get_tokens
openapi: 3.0.3
info:
  title: 'CliqHub API: Auth'
  version: 1.0.0
  description: >-
    API tokens. Every call to CliqHub carries one as `Authorization: Bearer
    <token>`:


    - **User token** (`cliq_tok_…`): acts as you, optionally limited by
    `permissions` (which
      organizations and realms, and read / write / admin per kind of resource). `cliq login`
      stores one; mint more for scripts and CI.
    - **Realm token** (`cliq_dt_…`): what a daemon uses to join and work in a
    realm. Any
      member of the realm can mint one.
    - **A2A token** (`cliq_a2a_…`): what outside agents send to a realm's A2A
    endpoint. One per
      realm; minting a new one replaces the old.
    - **Dispatch token**: a short-lived signed token CliqHub uses when it sends
    work to a
      daemon; each realm has a dispatch key pair for it.

    A token is shown only when it is minted or rotated. A restricted token
    cannot mint a token

    wider than itself.
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Auth
    description: >-
      API tokens. Every call to CliqHub carries one as `Authorization: Bearer
      <token>`:


      - **User token** (`cliq_tok_…`): acts as you, optionally limited by
      `permissions` (which
        organizations and realms, and read / write / admin per kind of resource). `cliq login`
        stores one; mint more for scripts and CI.
      - **Realm token** (`cliq_dt_…`): what a daemon uses to join and work in a
      realm. Any
        member of the realm can mint one.
      - **A2A token** (`cliq_a2a_…`): what outside agents send to a realm's A2A
      endpoint. One per
        realm; minting a new one replaces the old.
      - **Dispatch token**: a short-lived signed token CliqHub uses when it
      sends work to a
        daemon; each realm has a dispatch key pair for it.

      A token is shown only when it is minted or rotated. A restricted token
      cannot mint a token

      wider than itself.
paths:
  /v1/auth/get_tokens:
    post:
      tags:
        - Auth
      summary: List your tokens
      description: >-
        Lists your tokens (not revoked), newest first, optionally of one `type`
        or matching `query`. With `realm_id`, the realm's tokens instead (realm
        admins).


        Requires a signed-in user token (`Authorization: Bearer cliq_tok_…`).
        Results are limited to what that user can see.
      operationId: POST_v1_auth_get_tokens
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - user
                    - realm
                    - daemon
                  description: Filter by stored type
                realm_id:
                  type: string
                  minLength: 1
                  description: When set, list realm tokens for this realm
                query:
                  type: string
                  description: Matches part of the token name.
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: Page size (at most 100). Default 50.
                offset:
                  type: integer
                  minimum: 0
                  description: Rows to skip, for paging.
            examples:
              default:
                value:
                  type: user
      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:
                    type: object
                    required:
                      - tokens
                      - total
                    properties:
                      tokens:
                        type: array
                        items:
                          $ref: '#/components/schemas/TokenRow'
                      total:
                        type: integer
              example:
                ok: true
                data:
                  tokens:
                    - type: user
                      id: '42'
                      name: ci-runner
                      permissions:
                        domains:
                          realms:
                            - 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                        access:
                          runs:
                            - read
                            - write
                      created_at: '2026-10-01T09:00:00Z'
                      last_used_at: '2026-10-07T10:00:00Z'
                      revoked_at: null
                  total: 1
        '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`: A daemon token was used; this route needs a user token.'
          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
        '422':
          description: >-
            `invalid_params`: The body fails the request schema: a required
            field is missing or a value has the wrong type or format. The
            message lists every issue as `field: problem`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: 'type: Required'
                    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:
    TokenRow:
      type: object
      properties:
        type:
          type: string
          enum:
            - user
            - realm
            - daemon
        id:
          type: string
        name:
          type: string
        realm_id:
          type: string
          description: 'Realm tokens: their first realm.'
        realm_ids:
          type: array
          items:
            type: string
          description: 'Realm tokens: their realms.'
        permissions:
          $ref: '#/components/schemas/TokenPermissions'
        created_at:
          type: string
        last_used_at:
          type: string
          nullable: true
        revoked_at:
          type: string
          nullable: true
    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.
    TokenPermissions:
      type: object
      properties:
        domains:
          type: object
          properties:
            orgs:
              oneOf:
                - type: string
                  enum:
                    - '*'
                - description: >-
                    Unsupported Zod expression `// Org ids are UUIDs; integers
                    kept for legacy clients (B6).
                        z.array(z.union([z.string().min(1), z.number().int(), z`
                  type: object
                  additionalProperties: true
              description: >-
                Org ids where this credential may act, or `*` for all orgs the
                subject can reach
            realms:
              oneOf:
                - type: string
                  enum:
                    - '*'
                - type: array
                  items:
                    oneOf:
                      - type: string
                        minLength: 1
                      - type: string
                        enum:
                          - '*'
                  minItems: 1
              description: Realm ids where this credential may act, or `*`
        access:
          type: object
          properties:
            users:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            orgs:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            scopes:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
              description: >-
                Manage the Hub scopes catalog (create/update/delete package
                namespaces).
            teams:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            drafts:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            tokens:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            realms:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            daemons:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            runs:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            dispatch:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            workspaces:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            agents:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            settings:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            notifications:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            builder:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            hug:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
            reports:
              type: array
              items:
                type: string
                enum:
                  - read
                  - write
                  - admin
              minItems: 1
          description: >-
            Per-entity levels: read (get/list), write (create/update/dispatch),
            admin (destructive tenancy)
        auto_enrolled:
          type: boolean
          description: Set by daemon bootstrap mint — revoked on `cliq logout`.
      description: 'Token grant: domains (where) + access (read|write|admin per entity)'
  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.