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

# Legacy A2A gateway - JSON-RPC 2.0 dispatch (POST)

> Backward-compatible legacy JSON-RPC 2.0 gateway. The body MUST
include `params.id` (the target agent ID); the gateway forwards
the call to `POST /v1/agents/{agentId}/a2a`. Returns the
forwarded JSON-RPC response or a JSON-RPC error envelope.

Recognised methods on the underlying per-agent endpoint:
`message/send`, `message/stream`, `tasks/get`, `tasks/cancel`,
`tasks/sendSubscribe`, `agent/getCard`, `agent/getExtendedCard`.




## OpenAPI

````yaml /api-reference/agent-factory/swagger.yml post /v1/a2a
openapi: 3.0.3
info:
  version: 1.0.0
  title: Agent Factory API
  description: |
    Public REST API for the Agent Factory workspace - agents, conversations,
    messages, tools, artifacts, sharing, ratings, and discovery.
    Powered by Prisme.ai's runtime; all endpoints are exposed under each
    workspace's webhook namespace.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:agent-factory/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Agents
    description: Agent CRUD, discovery, AGENTS.md import/export.
  - name: Access
    description: Agent access bindings, sharing, and access requests.
  - name: ApiKeys
    description: Agent-scoped API key management (mint, revoke, rotate).
  - name: Publishing
    description: Publish or discard draft changes on an agent.
  - name: Ratings
    description: User ratings on published agents.
  - name: Profiles
    description: >-
      Agent profiles/presets catalog (simple, workflow, agent_light, agent_full,
      orchestrator).
  - name: Activity
    description: Activity feed for agents (events, errors, lifecycle changes).
  - name: Analytics
    description: Agent usage analytics (series + summary).
  - name: Conversations
    description: Conversations on an agent (CRUD, archive, star).
  - name: Messages
    description: Send messages to an agent (synchronous send + SSE stream).
  - name: Tasks
    description: Async task lifecycle (list, fetch, cancel, resolve, subscribe).
  - name: Artifacts
    description: Generated artifacts (files, code, content) attached to a task.
  - name: Shares
    description: Conversation, message, and artifact share-link snapshots.
  - name: A2A
    description: Agent-to-agent JSON-RPC 2.0 gateway (well-known agent.json + RPC).
  - name: Tools
    description: Per-agent tool catalogue (system tools, MCP servers, function tools).
  - name: Retention
    description: Per-agent and org-wide conversation retention policies.
  - name: Evaluations
    description: Agent evaluation runs and results.
paths:
  /v1/a2a:
    post:
      tags:
        - A2A
      summary: Legacy A2A gateway - JSON-RPC 2.0 dispatch (POST)
      description: |
        Backward-compatible legacy JSON-RPC 2.0 gateway. The body MUST
        include `params.id` (the target agent ID); the gateway forwards
        the call to `POST /v1/agents/{agentId}/a2a`. Returns the
        forwarded JSON-RPC response or a JSON-RPC error envelope.

        Recognised methods on the underlying per-agent endpoint:
        `message/send`, `message/stream`, `tasks/get`, `tasks/cancel`,
        `tasks/sendSubscribe`, `agent/getCard`, `agent/getExtendedCard`.
      operationId: legacyAgentToAgentCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegacyJsonRpcRequest'
      responses:
        '200':
          description: |
            JSON-RPC 2.0 response. `result` is the forwarded result
            envelope; alternatively `error` carries a JSON-RPC error
            object when the dispatch failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse'
        '400':
          description: Invalid JSON-RPC envelope (returned as a JSON-RPC error response).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcErrorEnvelope'
components:
  schemas:
    LegacyJsonRpcRequest:
      type: object
      description: |
        Legacy `/v1/a2a` JSON-RPC request. `params.id` MUST be present -
        it identifies the target agent for gateway dispatch.
      required:
        - jsonrpc
        - method
        - params
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        method:
          type: string
          maxLength: 64
          description: A2A method name (e.g. `message/send`, `tasks/get`).
        params:
          type: object
          required:
            - id
          properties:
            id:
              type: string
              maxLength: 128
              description: Target agent ID - required by the legacy gateway.
          additionalProperties: true
        id:
          type: string
          maxLength: 128
          description: JSON-RPC request id - echoed back in the response.
    JsonRpcResponse:
      type: object
      description: A2A JSON-RPC 2.0 response.
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        id:
          type: string
          nullable: true
          description: Echoes the request id (string or null per JSON-RPC 2.0).
        result:
          type: object
          additionalProperties: true
        error:
          $ref: '#/components/schemas/JsonRpcError'
    JsonRpcErrorEnvelope:
      type: object
      description: |
        Bare JSON-RPC error envelope returned without a successful `result`
        (e.g. when the legacy gateway cannot resolve the target agent).
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              example: -32000
            message:
              type: string
        id:
          type: string
          nullable: true
          description: Echoes the request id (string or null per JSON-RPC 2.0).
    JsonRpcError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        data:
          type: object
          additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`.
        Org API keys (`iak_*`) are **not** accepted here - they carry
        no user identity. Use the `x-prismeai-api-key` header instead
        (see `OrgApiKeyAuth`).
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`). Unlike
        `Authorization: Bearer`, this credential is **not** tied to a user
        identity - it is bound to the org and its effective access is
        defined by the scopes / permission rules attached to it (it can
        be restricted to a single project, or kept broader).
        For Agent Factory, these keys can be generated directly from
        the Agent Factory UI (in addition to the AI Governance settings).
        Send as `x-prismeai-api-key: iak_...`.

````