Sends an event from the agent to a user.

Agent events can be used to indicate that the agent has read a message from the user or that the agent is in the process of typing (which adds a human element to the RCS for Business experience). If the user doesn't have RCS enabled, the RCS for Business platform returns a `NOT_FOUND` (HTTP 404) error. If the user has RCS enabled but cannot be reached at the moment, the platform returns a `200 OK` response and handles delivery based on the event type. Agent events are queued in a store-and-forward queue for up to 30 days and delivered once the user comes back online. Only `IS_TYPING` events are ephemeral and not queued.

Unlike agent messages, agent events cannot be revoked after sending.

### HTTP request

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

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, for a user 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/agentEvents>. |

### Query parameters

| Parameters ||
|---|---|
| `eventId` | `string` The ID of the event, 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.agentEvents#AgentEvent`.

### 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.agentEvents#AgentEvent`.

### 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).