---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/message:stream"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/message:stream"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/message:stream

`POST /v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/message:stream`

## Request

- Base URL: `https://ces.googleapis.com`
- URL: `https://ces.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/apps/{appsId}/message:stream`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/ces`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/ces`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Sends a streaming message to an agent, allowing for real-time interaction and status updates. Streaming version of `SendMessage`

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `appsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- LfA2aV1SendMessageRequest: Represents a request for the `SendMessage` method.
  - `configuration` LfA2aV1SendMessageConfiguration: Configuration of a send message request.
    - `acceptedOutputModes` string[]: A list of media types the client is prepared to accept for response parts. Agents SHOULD use this to tailor their output.
    - `historyLength` integer: The maximum number of most recent messages from the task's history to retrieve in the response. An unset value means the client does not impose any limit. A value of zero is a request to not include any messages. The server MUST NOT return more messages than the provided value, but MAY apply a lower limit.
    - `returnImmediately` boolean: If `true`, the operation returns immediately after creating the task, even if processing is still in progress. If `false` (default), the operation MUST wait until the task reaches a terminal (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`) or interrupted (`INPUT_REQUIRED`, `AUTH_REQUIRED`) state before returning.
    - `taskPushNotificationConfig` LfA2aV1TaskPushNotificationConfig: A container associating a push notification configuration with a specific task.
      - `authentication` LfA2aV1AuthenticationInfo: Defines authentication details, used for push notifications.
        - `credentials` string: Push Notification credentials. Format depends on the scheme (e.g., token for Bearer).
        - `scheme` string: Required. HTTP Authentication Scheme from the [IANA registry](https://www.iana.org/assignments/http-authschemes/). Examples: `Bearer`, `Basic`, `Digest`. Scheme names are case-insensitive per [RFC 9110 Section 11.1](https://www.rfc-editor.org/rfc/rfc9110#section-11.1).
      - `id` string: The push notification configuration details. A unique identifier (e.g. UUID) for this push notification configuration.
      - `taskId` string: The ID of the task this configuration is associated with.
      - `tenant` string: Optional. Opaque routing identifier. Must match the `tenant` value from the selected `AgentInterface` in the Agent Card when that field is set.
      - `token` string: A token unique for this task or session.
      - `url` string: Required. The URL where the notification should be sent.
  - `message` LfA2aV1Message: `Message` is one unit of communication between client and server. It can be associated with a context and/or a task. For server messages, `context_id` must be provided, and `task_id` only if a task was created. For client messages, both fields are optional, with the caveat that if both are provided, they have to match (the `context_id` has to be the one that is set on the task). If only `task_id` is provided, the server will infer `context_id` from it.
    - `contextId` string: Optional. The context id of the message. If set, the message will be associated with the given context.
    - `extensions` string[]: The URIs of extensions that are present or contributed to this Message.
    - `messageId` string: Required. The unique identifier (e.g. UUID) of the message. This is created by the message creator.
    - `metadata` object: Optional. Any metadata to provide along with the message.
    - `parts` LfA2aV1Part[]: Required. Parts is the container of the message content.
      - `data` unknown
      - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
      - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
      - `metadata` object: Optional. metadata associated with this part.
      - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
      - `text` string: The string content of the `text` part.
      - `url` string: A `url` pointing to the file's content.
    - `referenceTaskIds` string[]: A list of task IDs that this message references for additional context.
    - `role` 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_AGENT': Required. Identifies the sender of the message.
    - `taskId` string: Optional. The task id of the message. If set, the message will be associated with the given task.
  - `metadata` object: A flexible key-value map for passing additional context or parameters.

## Response `200`

Successful response

- LfA2aV1StreamResponse: A wrapper object used in streaming operations to encapsulate different types of response data.
  - `artifactUpdate` LfA2aV1TaskArtifactUpdateEvent: A task delta where an artifact has been generated.
    - `append` boolean: If true, the content of this artifact should be appended to a previously sent artifact with the same ID.
    - `artifact` LfA2aV1Artifact: Artifacts represent task outputs.
      - `artifactId` string: Required. Unique identifier (e.g. UUID) for the artifact. It must be unique within a task.
      - `description` string: Optional. A human readable description of the artifact.
      - `extensions` string[]: The URIs of extensions that are present or contributed to this Artifact.
      - `metadata` object: Optional. Metadata included with the artifact.
      - `name` string: A human readable name for the artifact.
      - `parts` LfA2aV1Part[]: Required. The content of the artifact. Must contain at least one part.
        - `data` unknown
        - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
        - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
        - `metadata` object: Optional. metadata associated with this part.
        - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
        - `text` string: The string content of the `text` part.
        - `url` string: A `url` pointing to the file's content.
    - `contextId` string: Required. The ID of the context that this task belongs to.
    - `lastChunk` boolean: If true, this is the final chunk of the artifact.
    - `metadata` object: Optional. Metadata associated with the artifact update.
    - `taskId` string: Required. The ID of the task for this artifact.
  - `message` LfA2aV1Message: `Message` is one unit of communication between client and server. It can be associated with a context and/or a task. For server messages, `context_id` must be provided, and `task_id` only if a task was created. For client messages, both fields are optional, with the caveat that if both are provided, they have to match (the `context_id` has to be the one that is set on the task). If only `task_id` is provided, the server will infer `context_id` from it.
    - `contextId` string: Optional. The context id of the message. If set, the message will be associated with the given context.
    - `extensions` string[]: The URIs of extensions that are present or contributed to this Message.
    - `messageId` string: Required. The unique identifier (e.g. UUID) of the message. This is created by the message creator.
    - `metadata` object: Optional. Any metadata to provide along with the message.
    - `parts` LfA2aV1Part[]: Required. Parts is the container of the message content.
      - `data` unknown
      - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
      - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
      - `metadata` object: Optional. metadata associated with this part.
      - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
      - `text` string: The string content of the `text` part.
      - `url` string: A `url` pointing to the file's content.
    - `referenceTaskIds` string[]: A list of task IDs that this message references for additional context.
    - `role` 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_AGENT': Required. Identifies the sender of the message.
    - `taskId` string: Optional. The task id of the message. If set, the message will be associated with the given task.
  - `statusUpdate` LfA2aV1TaskStatusUpdateEvent: An event sent by the agent to notify the client of a change in a task's status.
    - `contextId` string: Required. The ID of the context that the task belongs to.
    - `metadata` object: Optional. Metadata associated with the task update.
    - `status` LfA2aV1TaskStatus: A container for the status of a task
      - `message` LfA2aV1Message: `Message` is one unit of communication between client and server. It can be associated with a context and/or a task. For server messages, `context_id` must be provided, and `task_id` only if a task was created. For client messages, both fields are optional, with the caveat that if both are provided, they have to match (the `context_id` has to be the one that is set on the task). If only `task_id` is provided, the server will infer `context_id` from it.
        - `contextId` string: Optional. The context id of the message. If set, the message will be associated with the given context.
        - `extensions` string[]: The URIs of extensions that are present or contributed to this Message.
        - `messageId` string: Required. The unique identifier (e.g. UUID) of the message. This is created by the message creator.
        - `metadata` object: Optional. Any metadata to provide along with the message.
        - `parts` LfA2aV1Part[]: Required. Parts is the container of the message content.
          - `data` unknown
          - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
          - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
          - `metadata` object: Optional. metadata associated with this part.
          - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
          - `text` string: The string content of the `text` part.
          - `url` string: A `url` pointing to the file's content.
        - `referenceTaskIds` string[]: A list of task IDs that this message references for additional context.
        - `role` 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_AGENT': Required. Identifies the sender of the message.
        - `taskId` string: Optional. The task id of the message. If set, the message will be associated with the given task.
      - `state` 'TASK_STATE_UNSPECIFIED' | 'TASK_STATE_SUBMITTED' | 'TASK_STATE_WORKING' | 'TASK_STATE_COMPLETED' | 'TASK_STATE_FAILED' | 'TASK_STATE_CANCELED' | 'TASK_STATE_INPUT_REQUIRED' | 'TASK_STATE_REJECTED' | 'TASK_STATE_AUTH_REQUIRED': Required. The current state of this task.
      - `timestamp` string, google-datetime: ISO 8601 Timestamp when the status was recorded. Example: "2023-10-27T10:00:00Z"
    - `taskId` string: Required. The ID of the task that has changed.
  - `task` LfA2aV1Task: `Task` is the core unit of action for A2A. It has a current status and when results are created for the task they are stored in the artifact. If there are multiple turns for a task, these are stored in history.
    - `artifacts` LfA2aV1Artifact[]: A set of output artifacts for a `Task`.
      - `artifactId` string: Required. Unique identifier (e.g. UUID) for the artifact. It must be unique within a task.
      - `description` string: Optional. A human readable description of the artifact.
      - `extensions` string[]: The URIs of extensions that are present or contributed to this Artifact.
      - `metadata` object: Optional. Metadata included with the artifact.
      - `name` string: A human readable name for the artifact.
      - `parts` LfA2aV1Part[]: Required. The content of the artifact. Must contain at least one part.
        - `data` unknown
        - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
        - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
        - `metadata` object: Optional. metadata associated with this part.
        - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
        - `text` string: The string content of the `text` part.
        - `url` string: A `url` pointing to the file's content.
    - `contextId` string: Unique identifier (e.g. UUID) for the contextual collection of interactions (tasks and messages).
    - `history` LfA2aV1Message[]: protolint:disable REPEATED_FIELD_NAMES_PLURALIZED The history of interactions from a `Task`.
      - `contextId` string: Optional. The context id of the message. If set, the message will be associated with the given context.
      - `extensions` string[]: The URIs of extensions that are present or contributed to this Message.
      - `messageId` string: Required. The unique identifier (e.g. UUID) of the message. This is created by the message creator.
      - `metadata` object: Optional. Any metadata to provide along with the message.
      - `parts` LfA2aV1Part[]: Required. Parts is the container of the message content.
        - `data` unknown
        - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
        - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
        - `metadata` object: Optional. metadata associated with this part.
        - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
        - `text` string: The string content of the `text` part.
        - `url` string: A `url` pointing to the file's content.
      - `referenceTaskIds` string[]: A list of task IDs that this message references for additional context.
      - `role` 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_AGENT': Required. Identifies the sender of the message.
      - `taskId` string: Optional. The task id of the message. If set, the message will be associated with the given task.
    - `id` string: Required. Unique identifier (e.g. UUID) for the task, generated by the server for a new task.
    - `metadata` object: protolint:enable REPEATED_FIELD_NAMES_PLURALIZED A key/value object to store custom metadata about a task.
    - `status` LfA2aV1TaskStatus: A container for the status of a task
      - `message` LfA2aV1Message: `Message` is one unit of communication between client and server. It can be associated with a context and/or a task. For server messages, `context_id` must be provided, and `task_id` only if a task was created. For client messages, both fields are optional, with the caveat that if both are provided, they have to match (the `context_id` has to be the one that is set on the task). If only `task_id` is provided, the server will infer `context_id` from it.
        - `contextId` string: Optional. The context id of the message. If set, the message will be associated with the given context.
        - `extensions` string[]: The URIs of extensions that are present or contributed to this Message.
        - `messageId` string: Required. The unique identifier (e.g. UUID) of the message. This is created by the message creator.
        - `metadata` object: Optional. Any metadata to provide along with the message.
        - `parts` LfA2aV1Part[]: Required. Parts is the container of the message content.
          - `data` unknown
          - `filename` string: An optional `filename` for the file (e.g., "document.pdf").
          - `mediaType` string: The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
          - `metadata` object: Optional. metadata associated with this part.
          - `raw` string, byte: The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
          - `text` string: The string content of the `text` part.
          - `url` string: A `url` pointing to the file's content.
        - `referenceTaskIds` string[]: A list of task IDs that this message references for additional context.
        - `role` 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_AGENT': Required. Identifies the sender of the message.
        - `taskId` string: Optional. The task id of the message. If set, the message will be associated with the given task.
      - `state` 'TASK_STATE_UNSPECIFIED' | 'TASK_STATE_SUBMITTED' | 'TASK_STATE_WORKING' | 'TASK_STATE_COMPLETED' | 'TASK_STATE_FAILED' | 'TASK_STATE_CANCELED' | 'TASK_STATE_INPUT_REQUIRED' | 'TASK_STATE_REJECTED' | 'TASK_STATE_AUTH_REQUIRED': Required. The current state of this task.
      - `timestamp` string, google-datetime: ISO 8601 Timestamp when the status was recorded. Example: "2023-10-27T10:00:00Z"

## Changes

- **2026-11-17** `455f2f484021`: 4 info
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-11** `d1599b011b2e`: 4 info
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/ces` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/ces/changes/v1/projects/:projectsId/locations/:locationsId/apps/:appsId/message:stream/post.md)

---

[API](https://skmtc.dev/google/apis/ces.md) - [All operations](https://skmtc.dev/google/apis/ces/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/ces/revisions/455f2f484021?raw)
