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

# Validate a team

> Checks a team's files without installing it — everything `teams/install` would reject,
and more. Send the files as `cliq team install` would (`team.yml`, `roles/`,
`dependencies.yml`, `README.md`, `hugs/<name>/dist/`). Returns every problem at once,
warnings, and a summary of the team (name, version, phase count, agents referenced).

Errors — any one of these and the team won't install:
1. `team.yml`: YAML, schema, phase graph; a name of the form `@scope/slug`.
2. Files that aren't part of a team.
3. Lines a phase's agent doesn't accept, and required agent inputs missing.
4. A `role:` naming a file the team doesn't have (the run would fail at that phase).
5. A team hug whose `dist/` isn't a valid hug build.
6. Agents that aren't on this daemon's agents path (`CLIQ_AGENTS_PATH`, `agents.path`,
   `~/.cliqrc/agents`), or are missing a required setting.
7. Phases asking with a hug this daemon can't find (not built in, not on the hugs
   path, not in the team).

Also errors, though install doesn't check them: inputs declared but not used by any
phase or role; a `dependencies.yml` that isn't a YAML array. Warnings: orphan phases.

The response always has `valid: true/false`, an `errors` array, a `warnings` array
and a `summary` object.

From the CLI: `cliq team validate ./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/validate
openapi: 3.1.0
info:
  title: cliqd API
  version: 1.15.21
  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/validate:
    post:
      tags:
        - Daemon Teams
      summary: Validate a team
      description: >-
        Checks a team's files without installing it — everything `teams/install`
        would reject,

        and more. Send the files as `cliq team install` would (`team.yml`,
        `roles/`,

        `dependencies.yml`, `README.md`, `hugs/<name>/dist/`). Returns every
        problem at once,

        warnings, and a summary of the team (name, version, phase count, agents
        referenced).


        Errors — any one of these and the team won't install:

        1. `team.yml`: YAML, schema, phase graph; a name of the form
        `@scope/slug`.

        2. Files that aren't part of a team.

        3. Lines a phase's agent doesn't accept, and required agent inputs
        missing.

        4. A `role:` naming a file the team doesn't have (the run would fail at
        that phase).

        5. A team hug whose `dist/` isn't a valid hug build.

        6. Agents that aren't on this daemon's agents path (`CLIQ_AGENTS_PATH`,
        `agents.path`,
           `~/.cliqrc/agents`), or are missing a required setting.
        7. Phases asking with a hug this daemon can't find (not built in, not on
        the hugs
           path, not in the team).

        Also errors, though install doesn't check them: inputs declared but not
        used by any

        phase or role; a `dependencies.yml` that isn't a YAML array. Warnings:
        orphan phases.


        The response always has `valid: true/false`, an `errors` array, a
        `warnings` array

        and a `summary` object.


        From the CLI: `cliq team validate ./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_validate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                files:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: string
                  description: >-
                    The team's files by path (team.yml, roles/<name>.md,
                    dependencies.yml, README.md, hugs/<name>/dist/**), as `cliq
                    team install` would send them
              required:
                - files
            examples:
              manifest_only:
                summary: A team that is only a team.yml
                value:
                  files:
                    team.yml: |
                      name: code-review
                      version: 1.4.0
                      description: Reviews a pull request and posts findings.
                      phases:
                        - name: review
                          agent: claude-code
              with_files:
                summary: With a role and dependencies
                value:
                  files:
                    team.yml: |
                      name: code-review
                      version: 1.4.0
                      description: Reviews a pull request and posts findings.
                      phases:
                        - name: review
                          agent: claude-code
                    roles/reviewer.md: |
                      You review pull requests and post findings.
                    dependencies.yml: |
                      - name: node
                        version: '>=18'
      responses:
        '200':
          description: Validation result — always returned, even when invalid.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    const: true
                  data:
                    type: object
                    required:
                      - valid
                      - errors
                      - warnings
                      - summary
                    properties:
                      valid:
                        type: boolean
                        description: '`true` when the manifest passes all checks.'
                      errors:
                        type: array
                        items:
                          type: object
                          required:
                            - level
                            - message
                          properties:
                            level:
                              type: string
                              enum:
                                - error
                            message:
                              type: string
                      warnings:
                        type: array
                        items:
                          type: object
                          required:
                            - level
                            - message
                          properties:
                            level:
                              type: string
                              enum:
                                - warning
                            message:
                              type: string
                      summary:
                        type: object
                        properties:
                          name:
                            type:
                              - string
                              - 'null'
                          description:
                            type:
                              - string
                              - 'null'
                          version:
                            type:
                              - string
                              - 'null'
                          phase_count:
                            type: integer
                          agents_referenced:
                            type: array
                            items:
                              type: string
              example:
                ok: true
                data:
                  valid: true
                  errors: []
                  warnings: []
                  summary:
                    name: code-review
                    description: Reviews a pull request and posts findings.
                    version: 1.4.0
                    phase_count: 1
                    agents_referenced:
                      - claude-code
        '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: >-
                        files: Invalid input: expected record, received
                        undefined
                      details:
                        - path: files
                          message: 'Invalid input: expected record, 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
        '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:
    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.