Sends a message from the agent to a user.

The user must be RCS-enabled and reachable by the RCS for Business platform in order for the agent to successfully send a message. Otherwise, the agent receives a 404 error code.

If the user is online, the RCS for Business platform delivers the message right away. Otherwise, the RCS for Business platform queues the message and delivers it when the user is next online.

The RCS for Business platform ignores any agent message sent with an ID that was used by an earlier message or event sent from the same agent.

Agent messages can be revoked between the time they are sent and the time they are delivered.

### HTTP request

`POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentMessages`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` "phones/{E.164}", where {E.164} is the user's phone number in E.164 format. For example, with the US phone number +1-222-333-4444, the value would be phones/+12223334444, and the resulting endpoint would be <https://rcsbusinessmessaging.googleapis.com/v1/phones/+12223334444/agentMessages>. |

### Query parameters

| Parameters ||
|---|---|
| `messageId` | `string` Required. The unique ID of the message, assigned by the agent. This must be a UUID, as defined in <https://www.rfc-editor.org/info/rfc9562>. The RCS for Business platform ignores any agent message sent with an ID that was used by an earlier message or event sent from the same agent. |
| `agentId` | `string` Required. The agent's unique identifier. |

### Request body

The request body contains an instance of `https://developers.google.com/business-communications/rcs-business-messaging/reference/rest/v1/phones.agentMessages#AgentMessage`.

### Response body

If successful, the response body contains a newly created instance of `https://developers.google.com/business-communications/rcs-business-messaging/reference/rest/v1/phones.agentMessages#AgentMessage`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/rcsbusinessmessaging`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).