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

# Manage A2A for a realm

> Manages a realm's A2A access, by `action`: `get` the settings, `update` them (turn A2A on
or off, choose the agent mesh provider and its settings), or `mesh_connect`,
`mesh_disconnect`, `mesh_refresh` the realm's mesh connection. The A2A token itself is
minted with Generate a token (`type: a2a`).

Requires a realm admin with the `realms.update` permission on the realm that owns the realm given by `realm_id`.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-realms.yaml post /v1/realms/a2a
openapi: 3.0.3
info:
  title: 'CliqHub API: Realms'
  version: 1.0.0
  description: >-
    A realm groups daemons, the people who may use them, and the teams they
    should run. Its

    members have a role: member (can see), operator (can run and operate) or
    admin (can

    manage). Daemons join with a realm token, people with an invitation.


    A realm's **team list** is the set of teams its daemons should have: Add a
    team to a realm

    installs it on the realm's online daemons, and daemons that join later get
    it too. A realm

    can also have its own notification rules, and A2A access so outside agents
    can send it tasks.


    Several of these endpoints answer `{ ok: true, realm }`-style bodies rather
    than

    `{ ok: true, data }`; each page shows its exact shape.
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Realms
    description: >-
      A realm groups daemons, the people who may use them, and the teams they
      should run. Its

      members have a role: member (can see), operator (can run and operate) or
      admin (can

      manage). Daemons join with a realm token, people with an invitation.


      A realm's **team list** is the set of teams its daemons should have: Add a
      team to a realm

      installs it on the realm's online daemons, and daemons that join later get
      it too. A realm

      can also have its own notification rules, and A2A access so outside agents
      can send it tasks.


      Several of these endpoints answer `{ ok: true, realm }`-style bodies
      rather than

      `{ ok: true, data }`; each page shows its exact shape.
paths:
  /v1/realms/a2a:
    post:
      tags:
        - Realms
      summary: Manage A2A for a realm
      description: >-
        Manages a realm's A2A access, by `action`: `get` the settings, `update`
        them (turn A2A on

        or off, choose the agent mesh provider and its settings), or
        `mesh_connect`,

        `mesh_disconnect`, `mesh_refresh` the realm's mesh connection. The A2A
        token itself is

        minted with Generate a token (`type: a2a`).


        Requires a realm admin with the `realms.update` permission on the realm
        that owns the realm given by `realm_id`.
      operationId: POST_v1_realms_a2a
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                realm_id:
                  type: string
                  minLength: 1
                  description: The realm.
                action:
                  type: string
                  enum:
                    - get
                    - update
                    - mesh_connect
                    - mesh_disconnect
                    - mesh_refresh
                  description: >-
                    `get`, `update`, `mesh_connect`, `mesh_disconnect` or
                    `mesh_refresh`.
                a2a_enabled:
                  type: boolean
                  description: 'update: let outside agents send tasks to the realm.'
                mesh_provider_mode:
                  type: string
                  enum:
                    - inherit
                    - override
                    - none
                  description: >-
                    update: `inherit` the organization's provider, `override`
                    with the realm's own, or `none`.
                active_provider_id:
                  type: string
                  nullable: true
                  description: 'update: the provider to use with `override`.'
                provider_id:
                  type: string
                  description: >-
                    update: a provider whose settings to change (with
                    `provider_settings`).
                provider_settings:
                  type: object
                  additionalProperties: true
                  description: 'update: settings for `provider_id`.'
              required:
                - realm_id
                - action
            examples:
              get:
                value:
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                  action: get
              enable:
                value:
                  realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                  action: update
                  a2a_enabled: true
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealmA2aSettings'
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    description: Always `true` on success.
                required:
                  - ok
              example:
                ok: true
                realm_id: 5b0c3a7e-2f4d-4b8e-9a51-7c1d2e3f4a5b
                org_id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
                a2a_enabled: true
                has_bearer: true
                bearer_prefix: cliq_a2a_4f9
                mesh_provider_mode: inherit
                active_provider_id: null
                effective_provider_id: null
                providers: {}
                mesh_status: null
                card_url: >-
                  https://api.cliqhub.io/a2a/o/acme/r/production/.well-known/agent-card.json
                send_url: https://api.cliqhub.io/a2a/o/acme/r/production/send
                created_at: 1759000000000
                updated_at: 1759100000000
        '400':
          description: >-
            `bad_request`: `update` with no setting to change, or an invalid
            `mesh_provider_mode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                bad_request:
                  summary: bad_request
                  value:
                    ok: false
                    error: No settings fields to update
                    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 record but your role in its realm 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 or is in a realm you cannot
            see (404 rather than 403, so its existence is not revealed).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                not_found:
                  summary: not_found
                  value:
                    ok: false
                    error:
                      code: not_found
                      message: Not found
        '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: realm_id
                          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:
    RealmA2aSettings:
      type: object
      properties:
        realm_id:
          type: string
        org_id:
          type: string
          nullable: true
        a2a_enabled:
          type: boolean
          description: Outside agents may send tasks to this realm.
        has_bearer:
          type: boolean
          description: An A2A token has been minted.
        bearer_prefix:
          type: string
          nullable: true
          description: First characters of the A2A token, to recognise it.
        mesh_provider_mode:
          type: string
          enum:
            - inherit
            - override
            - none
          description: >-
            Agent mesh provider: the organization's (`inherit`), the realm's own
            (`override`), or none.
        active_provider_id:
          type: string
          nullable: true
        effective_provider_id:
          type: string
          nullable: true
          description: The provider in use after inheritance.
        providers:
          type: object
          additionalProperties: true
          description: Provider settings, with secrets masked.
        mesh_status:
          type: object
          nullable: true
          additionalProperties: true
        card_url:
          type: string
          nullable: true
          description: Public URL of the realm's agent card.
        send_url:
          type: string
          nullable: true
          description: URL outside agents send tasks to.
        created_at:
          type: number
        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.