> ## 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 from a manifest

> Adds a team to this daemon's catalog from a manifest you supply (the CLI reads
`team.yml` from disk and sends its text). Use `teams/hub_install` to install
from CliqHub instead.

What happens, in order:
1. `agent_settings`, if sent, are saved as `agents.<agent>.<key>` settings — so
   you can supply a missing API key in the same call.
2. The manifest is parsed and validated (YAML, schema, phase graph).
3. Every agent the manifest uses is checked against this daemon
   (`TEAM_AGENT_CONFIG_REQUIRED` lists what is missing).
4. Any scope other than `local` needs a CliqHub sign-in.
5. The team is stored, then settled with CliqHub, which may assign its
   CliqHub id. If CliqHub says the team isn't on this daemon's realm team list,
   it is removed again and the call fails with `TEAM_NOT_IN_REALM`.

An installed team is replaced only with `force: true`; otherwise the call fails
with `TEAM_ALREADY_EXISTS`. To move an installed team to a newer version, prefer
`teams/update`, which refuses downgrades.

From the CLI: `cliq team install ./path/to/team`.

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-teams.yaml post /v1/teams/install
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 Teams
    description: >-
      The daemon's **local team catalog**: the teams this cliqd can run. Install
      a team

      from a manifest you hold (`teams/install`) or from CliqHub
      (`teams/hub_install`),

      read it back, update it, remove it, and publish manifests to CliqHub.


      A team is addressed by **scope + slug** (`@acme/code-review` → `scope:
      "acme"`,

      `slug: "code-review"`). The scope `local` is offline-only: it needs no
      CliqHub

      sign-in and can never be published. Every other scope needs `cliq login`
      first.
paths:
  /v1/teams/install:
    post:
      tags:
        - Daemon Teams
      summary: Install a team from a manifest
      description: >-
        Adds a team to this daemon's catalog from a manifest you supply (the CLI
        reads

        `team.yml` from disk and sends its text). Use `teams/hub_install` to
        install

        from CliqHub instead.


        What happens, in order:

        1. `agent_settings`, if sent, are saved as `agents.<agent>.<key>`
        settings — so
           you can supply a missing API key in the same call.
        2. The manifest is parsed and validated (YAML, schema, phase graph).

        3. Every agent the manifest uses is checked against this daemon
           (`TEAM_AGENT_CONFIG_REQUIRED` lists what is missing).
        4. Any scope other than `local` needs a CliqHub sign-in.

        5. The team is stored, then settled with CliqHub, which may assign its
           CliqHub id. If CliqHub says the team isn't on this daemon's realm team list,
           it is removed again and the call fails with `TEAM_NOT_IN_REALM`.

        An installed team is replaced only with `force: true`; otherwise the
        call fails

        with `TEAM_ALREADY_EXISTS`. To move an installed team to a newer
        version, prefer

        `teams/update`, which refuses downgrades.


        From the CLI: `cliq team install ./path/to/team`.


        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_teams_install
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                scope:
                  type: string
                  minLength: 1
                  description: Team scope (org namespace)
                slug:
                  type: string
                  minLength: 1
                  description: Team slug
                manifest:
                  type: string
                  minLength: 1
                  description: Team manifest (YAML)
                version:
                  description: 'Team version (default: the manifest''s)'
                  type: string
                  minLength: 1
                origin:
                  description: 'Who placed this install: cli or hub (default: cli)'
                  type: string
                  minLength: 1
                description:
                  description: 'Team description (default: the manifest''s)'
                  type: string
                  minLength: 1
                dependencies:
                  description: Dependency manifest
                  type: string
                  minLength: 1
                agent_settings:
                  description: Agent settings to store as `agents.<agent>.<key>`
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                force:
                  description: Replace an installed version
                  type: boolean
              required:
                - scope
                - slug
                - manifest
            examples:
              local:
                summary: Offline team in the `local` scope
                value:
                  scope: local
                  slug: code-review
                  manifest: |
                    name: code-review
                    version: 1.4.0
                    description: Reviews a pull request and posts findings.
                    phases:
                      - name: review
                        agent: claude-code
              with_settings:
                summary: Org team, supplying an agent API key in the same call
                value:
                  scope: acme
                  slug: code-review
                  manifest: |
                    name: code-review
                    version: 1.4.0
                    description: Reviews a pull request and posts findings.
                    phases:
                      - name: review
                        agent: claude-code
                  agent_settings:
                    claude-code:
                      api_key: <your-anthropic-api-key>
      responses:
        '200':
          description: The team as installed (its `team_id` may already be CliqHub's).
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    const: true
                  data:
                    $ref: '#/components/schemas/Team'
              example:
                ok: true
                data:
                  scope: acme
                  slug: code-review
                  team_id: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
                  version: 1.4.0
                  description: Reviews a pull request and posts findings.
                  manifest: |
                    name: code-review
                    version: 1.4.0
                    description: Reviews a pull request and posts findings.
                    phases:
                      - name: review
                        agent: claude-code
                  dockerfile: null
                  dependencies: null
                  created_at: 1759830000000
                  updated_at: 1759830000000
        '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: >-
                        scope: Invalid input: expected string, received
                        undefined; slug: Invalid input: expected string,
                        received undefined; manifest: Invalid input: expected
                        string, received undefined
                      details:
                        - path: scope
                          message: 'Invalid input: expected string, received undefined'
                        - path: slug
                          message: 'Invalid input: expected string, received undefined'
                        - path: manifest
                          message: 'Invalid input: expected string, received undefined'
                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
        '409':
          description: >-
            `TEAM_ALREADY_EXISTS` — A team with this scope and slug is already
            installed and `force` is not `true`.


            `TEAM_NOT_IN_REALM` — CliqHub reports the team is not on this
            daemon's realm team list. The team is not left installed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
              examples:
                TEAM_ALREADY_EXISTS:
                  summary: TEAM_ALREADY_EXISTS
                  value:
                    ok: false
                    error:
                      code: TEAM_ALREADY_EXISTS
                      message: Team 'acme/code-review' already exists
                TEAM_NOT_IN_REALM:
                  summary: TEAM_NOT_IN_REALM
                  value:
                    ok: false
                    error:
                      code: TEAM_NOT_IN_REALM
                      message: >-
                        @acme/code-review isn't on this cliqd's realm team list
                        — it was not installed
        '422':
          description: >-
            `TEAM_MANIFEST_INVALID` — The manifest is not valid YAML, fails the
            team schema, or its phases reference missing or cyclic upstreams.
            `details` holds the schema issues when there are any.


            `TEAM_AGENT_CONFIG_REQUIRED` — An agent the team uses is not
            available here, lacks a required setting, or has the wrong version.
            `details` is an array of `AgentRequirementError`. Fix with `cliq
            settings set …` or send `agent_settings`.


            `HUB_NOT_CONFIGURED` — The scope is not `local` and this daemon is
            not signed in to CliqHub.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorReply'
              examples:
                TEAM_MANIFEST_INVALID:
                  summary: TEAM_MANIFEST_INVALID
                  value:
                    ok: false
                    error:
                      code: TEAM_MANIFEST_INVALID
                      message: |-
                        Manifest validation failed:
                          • phases.0.agent: Required
                TEAM_AGENT_CONFIG_REQUIRED:
                  summary: TEAM_AGENT_CONFIG_REQUIRED
                  value:
                    ok: false
                    error:
                      code: TEAM_AGENT_CONFIG_REQUIRED
                      message: >-
                        Cannot install team '@acme/code-review': agent
                        configuration incomplete.
                          - claude-code: missing required setting 'api_key'
                      details:
                        - agent: claude-code
                          type: missing_setting
                          detail: 'claude-code: missing required setting ''api_key'''
                HUB_NOT_CONFIGURED:
                  summary: HUB_NOT_CONFIGURED
                  value:
                    ok: false
                    error:
                      code: HUB_NOT_CONFIGURED
                      message: >-
                        Installing teams under '@acme' requires Hub login. Run:
                        cliq login
        '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:
    Team:
      type: object
      description: A team in this daemon's catalog.
      required:
        - scope
        - slug
        - team_id
        - version
        - description
        - manifest
        - dockerfile
        - dependencies
        - created_at
        - updated_at
      properties:
        scope:
          type: string
          description: Scope (org namespace) the team is published under, without the `@`.
          example: acme
        slug:
          type: string
          description: Team slug, unique within its scope.
          example: code-review
        team_id:
          type: string
          format: uuid
          description: >
            Team id. Matches CliqHub's id once the team is registered with
            CliqHub;

            a team installed offline keeps a local id until the next reconcile,
            which

            may replace it.
          example: 3f6c2a8e-6b1d-4c1e-9a57-0d2f4b8e91c4
        version:
          type:
            - string
            - 'null'
          description: >-
            Semver of the installed manifest, or `null` when the manifest has
            none.
          example: 1.4.0
        description:
          type:
            - string
            - 'null'
          description: One-line description (from the request, else the manifest).
          example: Reviews a pull request and posts findings.
        manifest:
          type: string
          description: The full team manifest (`team.yml`) as YAML text.
          example: |
            name: code-review
            version: 1.4.0
            phases:
              - name: review
                agent: claude-code
        dockerfile:
          type:
            - string
            - 'null'
          description: Dockerfile shipped with the team, if any.
          example: null
        dependencies:
          type:
            - string
            - 'null'
          description: >-
            Dependency manifest (`dependencies.yml`) shipped with the team, if
            any.
          example: null
        created_at:
          type: integer
          format: int64
          description: >-
            When the team was first installed on this daemon (epoch
            milliseconds).
          example: 1759830000000
        updated_at:
          type: integer
          format: int64
          description: >-
            When the team was last installed, updated or re-bound (epoch
            milliseconds).
          example: 1759833600000
    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.