> ## 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 a setting

> Returns one deployment-wide setting, or `setting: null` when it is not set.

Requires a site administrator's user token. A daemon's realm token (`cliq_dt_…`) from the same realm may also read it.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-settings.yaml post /v1/settings/get_by_key
openapi: 3.0.3
info:
  title: 'CliqHub API: Settings'
  version: 1.0.0
  description: >-
    Deployment-wide settings that every daemon picks up (`docker.base_image`,

    `hub.registry_url`, …) with `cliq settings pull`. Only site administrators
    change them; a

    daemon's realm token can read them, plus settings set for daemons of its
    realm.
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Settings
    description: >-
      Deployment-wide settings that every daemon picks up (`docker.base_image`,

      `hub.registry_url`, …) with `cliq settings pull`. Only site administrators
      change them; a

      daemon's realm token can read them, plus settings set for daemons of its
      realm.
paths:
  /v1/settings/get_by_key:
    post:
      tags:
        - Settings
      summary: Get a setting
      description: >-
        Returns one deployment-wide setting, or `setting: null` when it is not
        set.


        Requires a site administrator's user token. A daemon's realm token
        (`cliq_dt_…`) from the same realm may also read it.
      operationId: POST_v1_settings_get_by_key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  description: The setting's key.
              required:
                - key
            examples:
              default:
                value:
                  key: docker.base_image
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    description: Always `true` on success.
                  setting:
                    allOf:
                      - $ref: '#/components/schemas/HubSetting'
                    nullable: true
                required:
                  - ok
              example:
                ok: true
                setting:
                  daemon_id: __global__
                  key: docker.base_image
                  value: ghcr.io/acme/cliq-runner:2
                  updated_at: 1759000000000
        '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`: The token's user is not a site administrator, or a
            daemon token was used.


            `forbidden`: You are not a site administrator.
          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
                forbidden (endpoint):
                  summary: forbidden (endpoint)
                  value:
                    ok: false
                    error: Site admin required
                    code: forbidden
        '422':
          description: >-
            `invalid_params`: The body fails the request schema: a field is
            missing or has the wrong type. `details.issues` lists each problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: Required
                    code: invalid_params
                    details:
                      issues:
                        - field: key
                          message: Required
        '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:
    HubSetting:
      type: object
      properties:
        daemon_id:
          type: string
          description: >-
            `__global__` for a deployment-wide setting, else the daemon it
            applies to.
        key:
          type: string
        value:
          type: string
          description: The value as text.
        updated_at:
          type: number
    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.