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

# Install a team on daemons

> Installs a published team on daemons: on `daemon_ids`, or on every online daemon of
`realm_id`. CliqHub sends the install to each daemon and returns how each answered, with
the queue item that records it. `agent_settings` are stored on the daemons with the team.
To make a realm keep a team installed (also on daemons that join later), use Add a team to
a realm instead.

Requires a realm operator (or higher) with the `teams.install` permission on the realm given by `realm_id`. When you target daemons with `daemon_ids` instead, you need that role on each daemon's realm.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-teams.yaml post /v1/teams/install
openapi: 3.0.3
info:
  title: 'CliqHub API: Teams'
  version: 1.0.0
  description: >-
    The CliqHub team registry. A team is published under a scope
    (`@acme/code-review`) as

    numbered versions. Create a draft, change it (each change can mint the next
    version),

    publish it to make it installable, then install it on daemons. List teams
    with a

    `realm_id` to see a realm's roster and where each team is installed, or with
    a

    `daemon_id` to see what one daemon has. Build a team with AI drafts a team
    from a

    description.


    Changing a team (update, rename, publish, unpublish, delete) needs its
    author, or the

    publish permission in the organization that owns its scope.
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Teams
    description: >-
      The CliqHub team registry. A team is published under a scope
      (`@acme/code-review`) as

      numbered versions. Create a draft, change it (each change can mint the
      next version),

      publish it to make it installable, then install it on daemons. List teams
      with a

      `realm_id` to see a realm's roster and where each team is installed, or
      with a

      `daemon_id` to see what one daemon has. Build a team with AI drafts a team
      from a

      description.


      Changing a team (update, rename, publish, unpublish, delete) needs its
      author, or the

      publish permission in the organization that owns its scope.
paths:
  /v1/teams/install:
    post:
      tags:
        - Teams
      summary: Install a team on daemons
      description: >-
        Installs a published team on daemons: on `daemon_ids`, or on every
        online daemon of

        `realm_id`. CliqHub sends the install to each daemon and returns how
        each answered, with

        the queue item that records it. `agent_settings` are stored on the
        daemons with the team.

        To make a realm keep a team installed (also on daemons that join later),
        use Add a team to

        a realm instead.


        Requires a realm operator (or higher) with the `teams.install`
        permission on the realm given by `realm_id`. When you target daemons
        with `daemon_ids` instead, you need that role on each daemon's realm.
      operationId: POST_v1_teams_install
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                team_id:
                  type: string
                  format: uuid
                  description: Published team UUID to install
                daemon_ids:
                  type: array
                  items:
                    type: string
                    minLength: 1
                  minItems: 1
                  description: Explicit daemon targets — mutually exclusive with realm_id
                realm_id:
                  type: string
                  minLength: 1
                  description: >-
                    Install to every daemon in this realm — mutually exclusive
                    with daemon_ids
                agent_settings:
                  type: object
                  additionalProperties:
                    type: object
                    additionalProperties:
                      type: string
                  description: >-
                    Per-agent key/value setting overrides applied at install
                    time
                force:
                  type: boolean
                  description: >-
                    When true, re-install even if the current version is already
                    present
                version:
                  type: string
                  description: Pin to a specific published version; omit for latest
              required:
                - team_id
            examples:
              realm:
                value:
                  team_id: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
              daemons:
                value:
                  team_id: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
                  daemon_ids:
                    - 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
                  version: 1.5.0
                  agent_settings:
                    claude-code:
                      model: claude-sonnet-4-5
      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/TeamInstallResult'
              example:
                ok: true
                data:
                  item:
                    id: e1d2c3b4-a5f6-4789-8a0b-1c2d3e4f5a6b
                    realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                    kind: install
                    payload:
                      team_id: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
                    priority: 0
                    status: completed
                    claimed_by: null
                    claimed_at: null
                    run_id: null
                    results: null
                    submitted_by: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                    submitted_at: 1759834200000
                    error: null
                    created_at: 1759834200000
                    updated_at: 1759834201000
                  team_id: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
                  results:
                    - daemon_id: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
                      ok: true
        '400':
          description: >-
            `bad_request`: The daemons do not share a realm you belong to, or
            the install failed on every daemon (the message lists why).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                bad_request:
                  summary: bad_request
                  value:
                    ok: false
                    error: >-
                      Install failed on all targets:
                      7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d: daemon offline
                    code: bad_request
        '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 but your role there is too low or
            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 does not exist, was deleted, or you are not a
            member of it (404 rather than 403, so its existence is not
            revealed).


            `not_found`: The team, the requested version, or any target daemon
            was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                not_found:
                  summary: not_found
                  value:
                    ok: false
                    error:
                      code: not_found
                      message: Not found
                not_found (endpoint):
                  summary: not_found (endpoint)
                  value:
                    ok: false
                    error: No daemon for install
                    code: not_found
        '422':
          description: >-
            `invalid_params`: Both or neither of `daemon_ids` and `realm_id`
            were sent, or `team_id` is not a UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: Provide exactly one of daemon_ids or realm_id
                    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:
    TeamInstallResult:
      type: object
      required:
        - item
        - team_id
        - results
      properties:
        item:
          $ref: '#/components/schemas/QueueItemData'
        team_id:
          type: string
        results:
          type: array
          description: One entry per targeted daemon.
          items:
            $ref: '#/components/schemas/TeamDaemonResult'
    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.
    QueueItemData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Queue item UUID
        realm_id:
          type: string
          description: Realm that owns the queue
        kind:
          type: string
          description: Queue kind (run, install, …)
        payload:
          type: object
          additionalProperties:
            type: object
            additionalProperties: true
          description: Kind-specific payload
        priority:
          type: number
          description: Higher wins claim order
        status:
          type: string
          description: queued | offered | claimed | …
        claimed_by:
          type: string
          nullable: true
          description: Daemon id that claimed, or null
        claimed_at:
          type: number
          nullable: true
          description: Claim time (unix ms)
        run_id:
          type: string
          nullable: true
          description: Linked run id when set
        results:
          type: object
          additionalProperties: true
          nullable: true
          description: Terminal results payload
        submitted_by:
          type: string
          description: User id that enqueued
        submitted_at:
          type: number
          description: Enqueue time (unix ms)
        error:
          type: string
          nullable: true
          description: Error message when failed
        created_at:
          type: number
          description: Row create time (unix ms)
        updated_at:
          type: number
          description: Row update time (unix ms)
      required:
        - id
        - realm_id
        - kind
        - payload
        - priority
        - status
        - claimed_by
        - claimed_at
        - run_id
        - results
        - submitted_by
        - submitted_at
        - error
        - created_at
        - updated_at
      description: Realm dispatch queue item
    TeamDaemonResult:
      type: object
      required:
        - daemon_id
        - ok
      properties:
        daemon_id:
          type: string
        ok:
          type: boolean
          description: The daemon accepted the command.
        already_installed:
          type: boolean
          description: Install only. The version was already there.
        error:
          type: string
          description: Why it failed, when `ok` is false.
  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.