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

# Handle JSON-RPC 2.0 request via agent relay (A2A 0.3.0)

> **Security Requirements**

| Auth Types | Entities | Permissions | Required Roles |
|------------|----------|-------------|----------------|
| AGENT | AGENT_CONVERSATIONS | READ, WRITE | AGENT_CONVERSATIONS:READ, AGENT_CONVERSATIONS:WRITE |



## OpenAPI

````yaml /openapi/swarmd.json post /relay/v1/agents/{agentId}/a2a/0.3.0
openapi: 3.0.1
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.swarmd.ai
    description: Production
  - url: https://api.sandbox.swarmd.ai
    description: Sandbox
security: []
tags:
  - name: Policy Groups
    x-displayName: Policy Groups
  - name: Policy Bindings
    x-displayName: Policy Bindings
  - name: Webhooks
    x-displayName: Webhooks
  - name: Human JSON-RPC
    x-displayName: Human JSON-RPC
  - name: Channel JSON-RPC
    x-displayName: Channel JSON-RPC
  - name: HITL Approvals
    x-displayName: HITL Approvals
  - name: Agent JSON-RPC
    x-displayName: Agent JSON-RPC
  - name: Tasks
    x-displayName: Tasks
  - name: Push Notifications
    x-displayName: Push Notifications
  - name: Messaging
    x-displayName: Messaging
  - name: Conversations
    x-displayName: Conversations
  - name: Agent Discovery
    x-displayName: Agent Discovery
  - name: User Subscriptions
    x-displayName: User Subscriptions
  - name: MCP Servers
    x-displayName: MCP Servers
  - name: Kill Switches
    x-displayName: Kill Switches
  - name: Channels
    x-displayName: Channels
  - name: Channel Subscriptions
    x-displayName: Channel Subscriptions
  - name: Agents
    x-displayName: Agents
  - name: Agent Subscriptions
    x-displayName: Agent Subscriptions
  - name: Marketplace
    x-displayName: Marketplace
  - name: Identity Providers
    x-displayName: Identity Providers
  - name: Groups
    x-displayName: Groups
  - name: Authentication
    x-displayName: Authentication
  - name: Users
    x-displayName: Users
  - name: Tenants
    x-displayName: Tenants
  - name: Audit Integrity
    x-displayName: Audit Integrity
  - name: Audit Events
    x-displayName: Audit Events
  - name: Audit Traces
    x-displayName: Audit Traces
  - name: A2A Payments
    x-displayName: A2A Payments
paths:
  /relay/v1/agents/{agentId}/a2a/0.3.0:
    post:
      tags:
        - Agent JSON-RPC
      summary: Handle JSON-RPC 2.0 request via agent relay (A2A 0.3.0)
      description: >-
        **Security Requirements**


        | Auth Types | Entities | Permissions | Required Roles |

        |------------|----------|-------------|----------------|

        | AGENT | AGENT_CONVERSATIONS | READ, WRITE | AGENT_CONVERSATIONS:READ,
        AGENT_CONVERSATIONS:WRITE |
      operationId: handleJsonRpcRequest_2
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/AgentGetExtendedCard'
                - $ref: '#/components/schemas/MessageSend'
                - $ref: '#/components/schemas/MessageStream'
                - $ref: '#/components/schemas/PushNotifConfigDelete'
                - $ref: '#/components/schemas/PushNotifConfigGet'
                - $ref: '#/components/schemas/PushNotifConfigList'
                - $ref: '#/components/schemas/PushNotifConfigSet'
                - $ref: '#/components/schemas/TasksCancel'
                - $ref: '#/components/schemas/TasksGet'
                - $ref: '#/components/schemas/TasksList'
                - $ref: '#/components/schemas/TasksResubscribe'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponseObject'
      security:
        - bearerAuth: []
components:
  schemas:
    AgentGetExtendedCard:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/AgentGetExtendedAgentCardParams'
            id:
              type: object
    MessageSend:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/MessageSendParams'
            id:
              type: object
    MessageStream:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/MessageSendStreamingParams'
            id:
              type: object
    PushNotifConfigDelete:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/PushNotificationConfigDeleteParams'
            id:
              type: object
    PushNotifConfigGet:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/PushNotificationConfigGetParams'
            id:
              type: object
    PushNotifConfigList:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/PushNotificationConfigListParams'
            id:
              type: object
    PushNotifConfigSet:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/PushNotificationConfigSetParams'
            id:
              type: object
    TasksCancel:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/TaskCancelParams'
            id:
              type: object
    TasksGet:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/TaskGetParams'
            id:
              type: object
    TasksList:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/TaskListParams'
            id:
              type: object
    TasksResubscribe:
      type: object
      allOf:
        - $ref: '#/components/schemas/A2AJsonRpcRequest'
        - type: object
          properties:
            jsonrpc:
              type: string
            method:
              type: string
            params:
              $ref: '#/components/schemas/TaskResubscribeParams'
            id:
              type: object
    JsonRpcResponseObject:
      required:
        - jsonrpc
      type: object
      properties:
        jsonrpc:
          type: string
        result:
          type: object
        error:
          $ref: '#/components/schemas/JsonRpcError'
        id:
          type: object
    A2AJsonRpcRequest:
      required:
        - method
      type: object
      properties:
        method:
          type: string
      discriminator:
        propertyName: method
    AgentGetExtendedAgentCardParams:
      type: object
    MessageSendParams:
      required:
        - message
      type: object
      properties:
        taskId:
          type: string
        message:
          $ref: '#/components/schemas/A2AMessage'
        configuration:
          $ref: '#/components/schemas/MessageSendConfiguration'
    MessageSendStreamingParams:
      required:
        - prompt
      type: object
      properties:
        prompt:
          type: string
        context:
          type: object
          additionalProperties:
            type: object
        metadata:
          type: object
          additionalProperties:
            type: object
    PushNotificationConfigDeleteParams:
      required:
        - configId
      type: object
      properties:
        configId:
          type: string
    PushNotificationConfigGetParams:
      required:
        - configId
      type: object
      properties:
        configId:
          type: string
    PushNotificationConfigListParams:
      type: object
      properties:
        taskId:
          type: string
    PushNotificationConfigSetParams:
      required:
        - taskId
        - url
      type: object
      properties:
        taskId:
          type: string
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        events:
          type: array
          items:
            type: string
    TaskCancelParams:
      required:
        - id
      type: object
      properties:
        id:
          type: string
    TaskGetParams:
      required:
        - id
      type: object
      properties:
        id:
          type: string
    TaskListParams:
      type: object
    TaskResubscribeParams:
      required:
        - id
      type: object
      properties:
        id:
          type: string
    JsonRpcError:
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        data:
          type: object
    A2AMessage:
      required:
        - messageId
        - parts
        - role
      type: object
      properties:
        messageId:
          type: string
        role:
          type: string
          enum:
            - user
            - agent
        parts:
          type: array
          items:
            $ref: '#/components/schemas/Part'
        kind:
          type: string
        contextId:
          type: string
        taskId:
          type: string
        referenceTaskIds:
          type: array
          items:
            type: string
        metadata:
          type: object
          additionalProperties:
            type: object
        extensions:
          type: array
          items:
            type: string
        timestamp:
          type: string
    MessageSendConfiguration:
      type: object
      properties:
        acceptedOutputModes:
          type: array
          items:
            type: string
        historyLength:
          type: integer
          format: int32
        blocking:
          type: boolean
        pushNotificationConfig:
          $ref: '#/components/schemas/PushNotificationConfigRequest'
    Part:
      required:
        - kind
      type: object
      properties:
        kind:
          type: string
      discriminator:
        propertyName: kind
    PushNotificationConfigRequest:
      required:
        - url
      type: object
      properties:
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        events:
          type: array
          items:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token (USER, AGENT, or SERVICE auth)

````