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

# Stream a message (A2A REST)

> The `HTTP+JSON` binding of A2A `SendStreamingMessage`. Responds with a
`text/event-stream` of `Task`, `statusUpdate`, and `artifactUpdate` events.




## OpenAPI

````yaml /agentic/auto-generated-openapi-v2.yml post /v2/agentic/agents/{agentId}/a2a/message:stream
openapi: 3.1.0
info:
  title: Corti Agent API v2
  version: 2.0.0
  summary: Manage agents and converse with them over the A2A v1.0 protocol.
  description: >
    Version 2 of the Corti Agents REST API.


    ## What's new in v2


    - **Unified `connectors`** — a single, flat, discriminated array replaces
    the
      v1 split between `experts`, `mcpServers`, and sub-agents. The envelope is
      extensible: new connector kinds (`a2a`, `openapi`, `custom`) slot in behind
      the `type` discriminator without breaking changes.
    - **Clean CRUD verbs** — `POST` creates, `GET` fetches/lists, `PATCH`
    performs
      a *true* partial update, `DELETE` removes. v1's PATCH was effectively a PUT.
    - **First-class metadata** — `visibility`, `model`, `lifecycle` (now a body
      field, not a query param), and free-form `labels`.

    ## A2A v1.0 only


    The conversational surface speaks **A2A protocol version `1.0` exclusively**

    (both the `JSONRPC` and `HTTP+JSON` bindings). The deprecated v0.3 binding
    from

    v1 is intentionally not carried forward.


    Per A2A §3.6, clients MUST send the `A2A-Version` header (`Major.Minor`,
    e.g.

    `1.0`) on every request to the `/a2a/*` surface, or supply it as the

    `A2A-Version` query parameter. This surface implements `1.0` only; an absent

    header is treated as `1.0`. Patch versions MUST NOT be sent. The server
    echoes

    the negotiated version in the `A2A-Version` response header.


    ## Partial updates (PATCH)


    `PATCH` uses **JSON Merge Patch** semantics (RFC 7386), served under the

    `application/merge-patch+json` media type:


    - **Omit a field** → left unchanged.

    - **`null`** → cleared / reset to its default.

    - **Arrays** (e.g. `connectors`) → *replaced wholesale*, never merged.


    To mutate a single connector without replacing the whole array, use the

    `/connectors` sub-resource endpoints.


    ## Streaming (Server-Sent Events)


    The streaming A2A surfaces — `message/stream`, `tasks/subscribe`, and the

    streaming JSON-RPC methods — respond with `text/event-stream`. The

    `text/event-stream` media type carries a sequence of Server-Sent Events;

    the attached schema describes a single event frame. Every event's `data`

    field is a string carrying a JSON document (`contentMediaType:

    application/json`); `contentSchema` declares the parsed payload

    (`StreamResponse` for the `HTTP+JSON` binding, `JSONRPCResponse` for the

    `JSONRPC` binding). The optional `id` field carries the SSE event id used

    for resumption via the `Last-Event-ID` request header.
  contact:
    name: Corti API Support
    url: https://corti.ai
    email: support@corti.ai
  license:
    name: Proprietary
    url: https://corti.ai/terms
  termsOfService: https://corti.ai/terms
servers:
  - url: https://api.{env}.corti.app
    description: Corti regional API gateway
    variables:
      env:
        default: eu
        enum:
          - eu
          - us
        description: Deployment region.
security:
  - bearerAuth: []
    tenantHeader: []
tags:
  - name: Agents
    description: Create, read, update, and delete agents.
  - name: Agent Card
    description: A2A-compliant agent discovery cards.
  - name: A2A
    description: Converse with an agent over the A2A v1.0 protocol.
  - name: Connectors
    description: Manage the connectors attached to an agent.
  - name: Usage
    description: Bucketed invocation history for an agent.
  - name: Contexts
    description: Conversational contexts and their tasks.
  - name: Registry
    description: Discoverable, pre-built connectors offered by the platform.
  - name: Artifacts
    description: Retrieve artifacts produced by tasks.
  - name: Feedback
    description: Collect human or automated feedback on tasks and messages.
paths:
  /v2/agentic/agents/{agentId}/a2a/message:stream:
    parameters:
      - $ref: '#/components/parameters/AgentId'
      - $ref: '#/components/parameters/A2AVersionHeader'
    post:
      tags:
        - A2A
      summary: Stream a message (A2A REST)
      description: >
        The `HTTP+JSON` binding of A2A `SendStreamingMessage`. Responds with a

        `text/event-stream` of `Task`, `statusUpdate`, and `artifactUpdate`
        events.
      operationId: A2AStreamMessage
      requestBody:
        required: true
        description: The message to send to the agent.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/A2ASendMessageRequest'
            example:
              message:
                messageId: msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73
                role: ROLE_USER
                parts:
                  - text: What is the ICD-10 code for asthma?
      responses:
        '200':
          description: |
            An SSE stream of streaming responses. Each event's `data` is a
            JSON-encoded `StreamResponse` (`Task`, `statusUpdate`, or
            `artifactUpdate`).
          headers:
            A2A-Version:
              $ref: '#/components/headers/A2AVersion'
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/A2AStreamEventResponse'
              example:
                event: message
                data: >-
                  {"task":{"id":"task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62","contextId":"ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51","status":{"state":"TASK_STATE_WORKING"}}}
        '400':
          $ref: '#/components/responses/A2ABadRequest'
        '401':
          $ref: '#/components/responses/A2AUnauthorized'
        '404':
          $ref: '#/components/responses/A2ANotFound'
components:
  parameters:
    AgentId:
      name: agentId
      in: path
      required: true
      description: Agent identifier (prefixed UUIDv7).
      schema:
        $ref: '#/components/schemas/CommonAgentIDValue'
    A2AVersionHeader:
      name: A2A-Version
      in: header
      required: false
      description: >-
        A2A protocol version in `Major.Minor` form (A2A §3.6). Optional;
        defaults to `1.0` when absent. This surface implements `1.0` only. Patch
        versions MUST NOT be sent and are not considered during negotiation.
      schema:
        type: string
        pattern: ^\d+\.\d+$
        default: '1.0'
  schemas:
    A2ASendMessageRequest:
      type: object
      description: Request body for sending a message to an agent.
      required:
        - message
      properties:
        message:
          $ref: '#/components/schemas/CommonMessage'
        configuration:
          $ref: '#/components/schemas/A2ASendMessageConfiguration'
        metadata:
          type: object
          additionalProperties: true
          description: Free-form request metadata.
          examples:
            - requestSource: mobile
              traceId: trace.abc123
        tenant:
          type: string
          description: >-
            Optional. Opaque routing identifier. Must match the `tenant` value
            from the selected `AgentInterface` in the Agent Card when that field
            is set.
    A2AStreamEventResponse:
      description: An SSE event carrying an A2A `HTTP+JSON` streaming response.
      allOf:
        - $ref: '#/components/schemas/A2ASSEEvent'
        - type: object
          properties:
            data:
              type: string
              contentMediaType: application/json
              contentSchema:
                $ref: '#/components/schemas/A2AStreamResponse'
              description: 'SSE payload: an A2A HTTP+JSON streaming response.'
    CommonAgentIDValue:
      type: string
      format: agent-id
      description: >-
        Agent identifier. Accepts `agt.<uuidv7>` or a bare UUIDv7 on input;
        always returned prefixed.
      pattern: ^(agt\.)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      examples:
        - agt.0192f4c8-2c5a-7b3e-9f1a-3c8d6e2b7a40
    CommonMessage:
      type: object
      description: An A2A message — an ordered list of content parts with a role.
      required:
        - role
        - parts
      properties:
        messageId:
          $ref: '#/components/schemas/CommonMessageIDValue'
        contextId:
          $ref: '#/components/schemas/CommonContextIDValue'
        taskId:
          $ref: '#/components/schemas/CommonTaskIDValue'
        role:
          $ref: '#/components/schemas/CommonRole'
        parts:
          type: array
          items:
            $ref: '#/components/schemas/CommonPart'
          description: Ordered content parts of the message.
        referenceTaskIds:
          type: array
          description: >-
            Task ids this message references (A2A v1.0
            `Message.referenceTaskIds`).
          items:
            $ref: '#/components/schemas/CommonTaskIDValue'
        extensions:
          type: array
          description: >-
            URIs of A2A extensions that contributed to this message (A2A v1.0
            `Message.extensions`).
          items:
            type: string
            format: uri
        metadata:
          type: object
          additionalProperties: true
          description: >
            Free-form A2A metadata. Corti's own first-party keys are prefixed

            with `$` (à la Mixpanel) to set them apart from caller-supplied
            keys.

            A2A defines no message-level timestamp, so Corti carries one as

            `$timestamp` (RFC 3339 / ISO 8601) — useful for timing *user*

            messages, which `TaskStatus.timestamp` cannot.
          examples:
            - $timestamp: '2026-05-19T12:00:00Z'
    A2ASendMessageConfiguration:
      type: object
      description: Per-request options controlling how a message is processed.
      required: []
      properties:
        returnImmediately:
          type: boolean
          default: false
          description: >-
            If `true`, return as soon as the task is submitted, even if
            processing is still in progress. If `false` (default), wait until
            the task reaches a terminal (`COMPLETED`, `FAILED`, `CANCELED`,
            `REJECTED`) or interrupted (`INPUT_REQUIRED`, `AUTH_REQUIRED`)
            state.
        historyLength:
          type: integer
          minimum: 0
          description: Maximum number of prior messages to include as context.
        acceptedOutputModes:
          type: array
          items:
            type: string
          description: Output media types the caller accepts.
    A2ASSEEvent:
      type: object
      description: >-
        A single Server-Sent Event frame (W3C SSE wire format). The server
        currently writes only `id` and `data` lines; `event` and `retry` are
        declared for forward compatibility but not sent.
      required:
        - data
      properties:
        data:
          type: string
          contentMediaType: application/json
          description: SSE payload (JSON-encoded).
        event:
          type: string
          description: Event type. Absent for the default `message` event.
        id:
          type: string
          description: |
            Opaque event id. Clients echo the most recent value in the
            `Last-Event-ID` header to resume a dropped stream.
        retry:
          type: integer
          minimum: 0
          description: Reconnection time in milliseconds the client should use.
    A2AErrorResponse:
      type: object
      description: |
        Google-RPC-style error envelope mandated by the A2A `HTTP+JSON` binding.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - status
            - message
          properties:
            code:
              type: integer
              description: HTTP status code.
            status:
              type: string
              description: Canonical google.rpc status.
              examples:
                - NOT_FOUND
            message:
              type: string
              description: Human-readable error message.
            details:
              type: array
              items:
                type: object
                additionalProperties: true
              description: Additional error details (google.rpc.Status details).
          description: Google-RPC-style error object with code, status, and message.
      examples:
        - error:
            code: 404
            status: NOT_FOUND
            message: Task not found.
            details:
              - '@type': type.googleapis.com/google.rpc.ErrorInfo
                reason: TASK_NOT_FOUND
                domain: a2a-protocol.org
                metadata:
                  taskId: task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62
    CommonMessageIDValue:
      type: string
      format: message-id
      description: >-
        Message identifier. Accepts `msg.<uuidv7>` or a bare UUIDv7 on input;
        always returned prefixed.
      pattern: ^(msg\.)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      examples:
        - msg.0192f4c8-5f8d-7e61-924d-6fb09b5ead73
    CommonContextIDValue:
      type: string
      format: context-id
      description: >-
        Context identifier. Accepts `ctx.<uuidv7>` or a bare UUIDv7 on input;
        always returned prefixed.
      pattern: ^(ctx\.)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      examples:
        - ctx.0192f4c8-3d6b-7c4f-a02b-4d9e7f3c8b51
    CommonTaskIDValue:
      type: string
      format: task-id
      description: >-
        Task identifier. Accepts `task.<uuidv7>` or a bare UUIDv7 on input;
        always returned prefixed.
      pattern: ^(task\.)?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      examples:
        - task.0192f4c8-4e7c-7d50-b13c-5eaf8a4d9c62
    CommonRole:
      type: string
      description: The author of a message.
      enum:
        - ROLE_USER
        - ROLE_AGENT
    CommonPart:
      type: object
      description: A single content part of a message or artifact.
      required: []
      properties:
        text:
          type: string
          description: The string content of the `text` part.
        data:
          type: object
          additionalProperties: true
          description: >-
            Arbitrary structured `data` as a JSON value (object, array, string,
            number, boolean, or null).
        filename:
          type: string
          description: An optional `filename` for the file (e.g., `document.pdf`).
        mediaType:
          type: string
          description: >-
            The `media_type` (MIME type) of the part content (e.g.,
            `text/plain`, `application/json`, `image/png`).
        raw:
          type: string
          contentEncoding: base64
          pattern: ^[A-Za-z0-9+/]*={0,2}$
          description: The `raw` byte content of a file. Encoded as a base64 string.
        url:
          type: string
          description: A `url` pointing to the file's content.
        metadata:
          type: object
          additionalProperties: true
          description: Optional metadata associated with this part.
      additionalProperties: true
  headers:
    A2AVersion:
      description: >-
        The A2A protocol `Major.Minor` version the server used to handle the
        request.
      schema:
        type: string
        examples:
          - '1.0'
  responses:
    A2ABadRequest:
      description: Malformed A2A request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/A2AErrorResponse'
    A2AUnauthorized:
      description: Missing or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/A2AErrorResponse'
    A2ANotFound:
      description: The agent, task, or context was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/A2AErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth 2.0 / OIDC bearer token.
    tenantHeader:
      type: apiKey
      in: header
      name: Tenant-Name
      description: The tenant the request operates within.

````