> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Register a remote A2A agent

> Registers a remote agent that speaks the A2A protocol. Its Agent Card is fetched from inside the serverless sandbox on a best-effort basis: when the fetch fails the record is still stored, with an empty cardSummary (fetchedAt 0) that marks it as not connected; the reason is available from GET /a2a-agents/{id}/card. Registration creates exactly one read-only tool row (source "a2a") that can be attached to agents and skills. Credentials are not accepted here — an oAuth2, basic or customHeader agent references a Cognigy Connection by referenceId.



## OpenAPI

````yaml https://api-trial.cognigy.ai/swagger/openapi.json post /a2a-agents
openapi: 3.0.3
info:
  contact:
    email: support@example.com
    name: API Support
  description: API for managing agents and related resources
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Agents API
  version: '1.0'
servers:
  - url: https://api-trial.cognigy.ai/v1
security:
  - ApiKey: []
tags:
  - name: Agents
  - name: Brand personas
  - name: Tools
  - name: Built-in tools
  - name: Skills
  - name: Built-in skills
  - name: MCP servers
  - description: >-
      Remote agents that speak the A2A (Agent2Agent) protocol. Available only
      while FEATURE_ENABLE_A2A_TOOLS is on; every route answers 404 otherwise.
    name: A2A agents
  - name: Tool references
paths:
  /a2a-agents:
    post:
      tags:
        - A2A agents
      summary: Register a remote A2A agent
      description: >-
        Registers a remote agent that speaks the A2A protocol. Its Agent Card is
        fetched from inside the serverless sandbox on a best-effort basis: when
        the fetch fails the record is still stored, with an empty cardSummary
        (fetchedAt 0) that marks it as not connected; the reason is available
        from GET /a2a-agents/{id}/card. Registration creates exactly one
        read-only tool row (source "a2a") that can be attached to agents and
        skills. Credentials are not accepted here — an oAuth2, basic or
        customHeader agent references a Cognigy Connection by referenceId.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_a2aagents.CreateA2AAgentRequest'
        description: A2A agent data
        required: true
        x-originalParamName: agent
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_a2aagents.A2AAgentResponse'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailBadRequest
          description: >-
            Invalid request body, validation error, or unresolvable auth
            connection
        '403':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailForbidden
          description: Access denied
        '409':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailConflict
          description: An A2A agent with this name already exists in the project
        '500':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailInternalError
          description: Internal server error
components:
  schemas:
    internal_a2aagents.CreateA2AAgentRequest:
      properties:
        agentBaseUrl:
          example: https://agent.example.com
          type: string
        agentCardPath:
          example: .well-known/agent-card.json
          type: string
        authConnectionReferenceId:
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        authForDiscovery:
          example: false
          type: boolean
        authType:
          enum:
            - none
            - oAuth2
            - basic
            - customHeader
          example: none
          type: string
        executionMode:
          enum:
            - blocking
            - nonBlocking
          example: blocking
          type: string
        maxAutonomousTurns:
          example: 4
          type: integer
        name:
          example: Travel Agent
          type: string
        projectId:
          example: 507f1f77bcf86cd799439011
          type: string
        skillFilter:
          $ref: '#/components/schemas/internal_a2aagents.SkillFilterRequest'
        taskTimeoutSeconds:
          example: 60
          type: integer
        timeoutSeconds:
          example: 12
          type: integer
      required:
        - agentBaseUrl
        - name
        - projectId
      type: object
    internal_a2aagents.A2AAgentResponse:
      properties:
        agentBaseUrl:
          type: string
        agentCardPath:
          type: string
        authConnectionReferenceId:
          type: string
        authForDiscovery:
          type: boolean
        authType:
          example: none
          type: string
        cardSummary:
          $ref: '#/components/schemas/internal_a2aagents.CardSummaryResponse'
        createdAt:
          type: integer
        createdBy:
          example: 507f1f77bcf86cd799439011
          type: string
        executionMode:
          example: blocking
          type: string
        id:
          example: 507f1f77bcf86cd799439011
          type: string
        lastChangedAt:
          type: integer
        lastChangedBy:
          example: 507f1f77bcf86cd799439011
          type: string
        maxAutonomousTurns:
          example: 4
          type: integer
        name:
          type: string
        organisationId:
          example: 507f1f77bcf86cd799439011
          type: string
        projectId:
          example: 507f1f77bcf86cd799439011
          type: string
        referenceId:
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        skillFilter:
          $ref: '#/components/schemas/internal_a2aagents.SkillFilterResponse'
        taskTimeoutSeconds:
          example: 60
          type: integer
        timeoutSeconds:
          example: 12
          type: integer
        tool:
          $ref: '#/components/schemas/internal_a2aagents.ToolBindingResponse'
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailBadRequest:
      properties:
        code:
          description: |-
            Code is a stable machine-readable reason, present on some 400s only
            (for example "reserved_tool_name").
          example: reserved_tool_name
          type: string
        detail:
          example: request body validation failed
          type: string
        errors:
          items:
            $ref: >-
              #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.FieldError
          type: array
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 400
          type: integer
        title:
          example: Bad Request
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailForbidden:
      properties:
        detail:
          example: 'access denied: insufficient permissions'
          type: string
        instance:
          example: /v1/{resource}/{id}
          type: string
        status:
          example: 403
          type: integer
        title:
          example: Forbidden
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailConflict:
      properties:
        detail:
          example: a resource with this identifier already exists
          type: string
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 409
          type: integer
        title:
          example: Conflict
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailInternalError:
      properties:
        detail:
          example: internal server error
          type: string
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 500
          type: integer
        title:
          example: Internal Server Error
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    internal_a2aagents.SkillFilterRequest:
      properties:
        mode:
          enum:
            - none
            - whitelist
            - blacklist
          example: none
          type: string
        skillIds:
          example:
            - book-flight
          items:
            type: string
          type: array
      type: object
    internal_a2aagents.CardSummaryResponse:
      properties:
        description:
          type: string
        extended:
          type: boolean
        fetchedAt:
          type: integer
        interfaceUrl:
          type: string
        name:
          type: string
        protocolVersion:
          example: '0.3'
          type: string
        sha256:
          type: string
        skills:
          items:
            $ref: >-
              #/components/schemas/github_com_cognigy_ai-agents-v2_internal_a2acall.AgentCardSkill
          type: array
        streaming:
          type: boolean
      type: object
    internal_a2aagents.SkillFilterResponse:
      properties:
        mode:
          example: none
          type: string
        skillIds:
          items:
            type: string
          type: array
      type: object
    internal_a2aagents.ToolBindingResponse:
      properties:
        id:
          example: 507f1f77bcf86cd799439011
          type: string
        referenceId:
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.FieldError:
      properties:
        field:
          type: string
        message:
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_a2acall.AgentCardSkill:
      properties:
        description:
          type: string
        examples:
          items:
            type: string
          type: array
        id:
          type: string
        name:
          type: string
        tags:
          items:
            type: string
          type: array
      type: object
  securitySchemes:
    ApiKey:
      description: '[Production] API key for production authentication'
      in: header
      name: X-API-Key
      type: apiKey

````