---
title: "POST /v1/{+tenant}/message:send"
method: POST
path: "/v1/{+tenant}/message:send"
tags: ["projects"]
---

# POST /v1/{+tenant}/message:send

`POST /v1/{+tenant}/message:send`

Sends a message to an agent.

## Path parameters

- `tenant` string, required

## Request body

- LfA2aV1SendMessageRequest — Represents a request for the `SendMessage` method.
  - `configuration` LfA2aV1SendMessageConfiguration — Configuration of a send message request.
    - `taskPushNotificationConfig` LfA2aV1TaskPushNotificationConfig — A container associating a push notification configuration with a specific task.
      - `authentication` LfA2aV1AuthenticationInfo — Defines authentication details, used for push notifications.
        - `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).
        - `credentials` string — Push Notification credentials. Format depends on the scheme (e.g., token for Bearer).
      - `taskId` string — The ID of the task this configuration is associated with.
      - `url` string — Required. The URL where the notification should be sent.
      - `tenant` string — Optional. Tenant ID.
      - `id` string — The push notification configuration details. A unique identifier (e.g. UUID) for this push notification configuration.
      - `token` string — A token unique for this task or session.
    - `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.
    - `acceptedOutputModes` string[] — A list of media types the client is prepared to accept for response parts. Agents SHOULD use this to tailor their output.
    - `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.
  - `metadata` object — A flexible key-value map for passing additional context or parameters.
  - `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.
    - `parts` LfA2aV1Part[] — Required. Parts is the container of the message content.
      - `filename` string — An optional `filename` for the file (e.g., "document.pdf").
      - `text` string — The string content of the `text` part.
      - `url` string — A `url` pointing to the file's content.
      - `data` unknown
      - `raw` string, byte — The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
      - `metadata` object — Optional. metadata associated with this part.
      - `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. Any metadata to provide along with the message.
    - `extensions` string[] — The URIs of extensions that are present or contributed to this Message.
    - `role` 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_AGENT' — Required. Identifies the sender of the message.
    - `referenceTaskIds` string[] — A list of task IDs that this message references for additional context.
    - `taskId` string — Optional. The task id of the message. If set, the message will be associated with the given task.
    - `messageId` string — Required. The unique identifier (e.g. UUID) of the message. This is created by the message creator.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/ces.md) · [All operations](https://skmtc.net/google/apis/ces/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/ces/versions/429598666166/schema)
