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

# Uninstall a team from daemons

> Removes a team from daemons: from `daemon_id` / `daemon_ids`, or from every daemon of
`realm_id`. CliqHub marks the team uninstalled for those daemons first, then sends the
uninstall, so it also works when a daemon no longer has it. To stop a realm from keeping
the team, use Remove a team from a realm.

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



## OpenAPI

````yaml /openapi/hub-by-tag/hub-teams.yaml post /v1/teams/uninstall
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/uninstall:
    post:
      tags:
        - Teams
      summary: Uninstall a team from daemons
      description: >-
        Removes a team from daemons: from `daemon_id` / `daemon_ids`, or from
        every daemon of

        `realm_id`. CliqHub marks the team uninstalled for those daemons first,
        then sends the

        uninstall, so it also works when a daemon no longer has it. To stop a
        realm from keeping

        the team, use Remove a team from a realm.


        Requires a realm operator (or higher) with the `teams.install`
        permission on the realm given by `realm_id`. When you target daemons
        with `daemon_id` or `daemon_ids` instead, you need that role on each
        daemon's realm.
      operationId: POST_v1_teams_uninstall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                scope:
                  type: string
                  minLength: 1
                  description: Scope (publisher) slug of the team
                slug:
                  type: string
                  minLength: 1
                  description: Team slug within the scope
                daemon_id:
                  type: string
                  minLength: 1
                  description: Single daemon target — mutually exclusive with realm_id
                daemon_ids:
                  type: array
                  items:
                    type: string
                    minLength: 1
                  minItems: 1
                  description: Multiple daemon targets — mutually exclusive with realm_id
                realm_id:
                  type: string
                  minLength: 1
                  description: >-
                    Uninstall from every daemon in this realm — mutually
                    exclusive with daemon_id/daemon_ids
              required:
                - scope
                - slug
            examples:
              default:
                value:
                  scope: acme
                  slug: code-review
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
      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/TeamUninstallResult'
              example:
                ok: true
                data:
                  item:
                    id: f2e3d4c5-b6a7-4890-9b1c-2d3e4f5a6b7c
                    realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                    kind: uninstall
                    payload:
                      scope: acme
                      slug: code-review
                    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
                  scope: acme
                  slug: code-review
                  results:
                    - daemon_id: 7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d
                      ok: true
                  dispatched: true
        '400':
          description: '`bad_request`: The daemons do not share a realm you belong to.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                bad_request:
                  summary: bad_request
                  value:
                    ok: false
                    error: >-
                      Pinned daemons do not share a realm you belong to; pass
                      realm_id
                    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`: No target daemon was 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 uninstall
                    code: not_found
        '422':
          description: >-
            `invalid_params`: Both or neither of the daemon targets and
            `realm_id` were sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: Provide exactly one of daemon_id/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:
    TeamUninstallResult:
      type: object
      required:
        - item
        - scope
        - slug
        - results
        - dispatched
      properties:
        item:
          $ref: '#/components/schemas/QueueItemData'
        scope:
          type: string
        slug:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/TeamDaemonResult'
        dispatched:
          type: boolean
          description: At least one daemon accepted the uninstall.
    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.