# Agent Event

Trigger an agent action asynchronously for a specific consumer conversation.

This endpoint triggers agent actions asynchronously in response to business events. Use it to notify the Meta Business Agent about events occurring in your systems — such as a completed purchase, identity verification, or shipping update — so the agent can take appropriate action in the customer conversation. Uses POST to submit an event (returns immediately with status "accepted") and GET to poll the processing status of a previously submitted event.

## Base URL

| URL | Description |
|-----|-------------|
| https://api.facebook.com/{entity_id}/agent_event |  |

## Authorization

This API requires:

any of the following
  - Capability: bizai_wa_enterprise_api_3p_access
  - Capability: bizai_ig_enterprise_api_3p_access
  - Permission: whatsapp_business_messaging

## APIs

| Method | Endpoint |
|--------|----------|
| GET | [/{agent_event_id}](#get-agent-event-id) |
| POST | [/](#post) |

<jumplink id="get-agent-event-id"></jumplink>
## GET /{agent_event_id}

Get an agent event status

Retrieve the current processing status of a previously submitted agent event, identified by its ID.


### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-API-Version | "2.0.0" |  |  |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| entity_id | string | ✓ | The WhatsApp Business Phone Number ID or Instagram account ID for the Meta Business Agent. |
| agent_event_id | string | ✓ | The ID of the agent event, as returned by the POST /{entity_id}/agent_event endpoint. |

### Responses

**200**

The current status of the agent event.

**Content Type**: `application/json`

**Schema**: [BizAIOmniChannelAgentEventStatusResponse](#bizaiomnichannelagenteventstatusresponse)

**400**

Bad request

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**401**

Unauthorized

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**403**

Forbidden

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**404**

Not found

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**429**

Too many requests

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**500**

Server error

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)


<jumplink id="post"></jumplink>
## POST /

Send an agent event

Trigger an agent action asynchronously for a consumer of the specified WhatsApp business phone number or Instagram account. On WhatsApp the event is enqueued for processing and the endpoint returns immediately with status "accepted"; on Instagram the agent turn is served before the response is returned. In both cases the consumer must have an existing conversation with the business.


### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-API-Version | "2.0.0" |  |  |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| entity_id | string | ✓ | The WhatsApp Business Phone Number ID or Instagram account ID for the Meta Business Agent. |

### Request Body (Required)

**Content Type**: `application/json`

**Schema**: [BizAIOmniChannelAgentEventRequestV2](#bizaiomnichannelagenteventrequestv2)

### Responses

**200**

Acknowledgment that the event was accepted for processing.


**Content Type**: `application/json`

**Schema**: [BizAIOmniChannelAgentEventResponse](#bizaiomnichannelagenteventresponse)

**400**

Bad request

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**401**

Unauthorized

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**403**

Forbidden

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**429**

Too many requests

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)

**500**

Server error

**Content Type**: `application/json`

**Schema**: [StandardError](#standarderror)


# Components

## Schemas

<jumplink id="bizaiomnichannelagenteventrequestv2"></jumplink>
### BizAIOmniChannelAgentEventRequestV2

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| to | string | ✓ | The consumer to reach, in the form used by the entity in the path. For a WhatsApp business phone number, either the consumer phone number in E.164 format, or the consumer's business-scoped user ID (BSUID), which is the `user_id` value delivered to your webhook, such as `US.13491208655302741918`. Use the BSUID for a consumer whose phone number is not available to you, such as a consumer who has adopted a WhatsApp username. Parent BSUIDs (`parent_user_id`) are not supported. For an Instagram business account, either the Instagram-scoped ID delivered to your webhook when the consumer messages your account, or the consumer's Instagram username, with or without the leading `@`. A value made up only of digits is read as a scoped ID, never as a username. The consumer must have an existing conversation with your business. |
| event | [Event](#object-event-1) | ✓ | Event-specific fields. |

<jumplink id="bizaiomnichannelagenteventresponse"></jumplink>
### BizAIOmniChannelAgentEventResponse

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| status | string | ✓ | "accepted" when the event is successfully enqueued. |
| agent_event_id | string |  | The ID of the recorded agent event, when one was created. |

<jumplink id="standarderror"></jumplink>
### StandardError

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| detail | string | ✓ |  |
| status | integer |  |  |
| title | string | ✓ |  |
| type | string |  |  |

<jumplink id="bizaiomnichannelagenteventstatusresponse"></jumplink>
### BizAIOmniChannelAgentEventStatusResponse

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| status | One of "request_received", "processing", "sent", "failed", "skipped", "success" | ✓ | The current processing status of the agent event. One of "request_received", "processing", "skipped", "sent", "success", or "failed". |
| event_type | string | ✓ | The partner-defined event identifier supplied when the event was submitted, e.g. "document_verified". |
| error_message | string |  | Why the event was not delivered, if event state is FAILED. "agent_not_enabled": the agent is turned off for this phone number. "agent_temporarily_unavailable": retry later. "billing_not_configured": the billing setup of the agent does not allow a billable message, because a payment method is missing or the account details are incomplete. "consumer_not_in_agent_audience": the agent does not serve this consumer, because the audience is restricted to an allowlist the consumer is not on, or a rollout excludes them. "event_content_rejected": the event text was declined. "internal_server_error": any other failure. "thread_not_owned_by_agent": another participant owns the conversation. |
| skipped_reason | string |  | Summary of skip reason, if event state is SKIPPED. |
| conversation_id | string |  | App-scoped opaque identifier for the conversation the event was delivered into, as returned by Conversation Turns. Omitted when the agent had not yet served the conversation when the event was received. |
| created_at | string | ✓ | The ISO 8601 timestamp at which the agent event was received. |
| updated_at | string | ✓ | The ISO 8601 timestamp at which the agent event status was last updated. |

## Inline Object Definitions

<jumplink id="object-event-1"></jumplink>
### Event

Event-specific fields.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| type | string | ✓ | Required. Partner-defined event identifier, e.g. "document_verified", "payment_received". Max 256 characters. |
| description | string | ✓ | Required. Human-readable description of the event, e.g. "User's identity document has been verified". Max 1024 characters. |
| payload | string | ✓ | Required. Opaque JSON string passed through to the agent as-is. Max 4096 characters. |

## Authentication

| Method | How to send it |
|--------|----------------|
| Authorization header | `Authorization: Bearer {access-token}` |

### Global Authentication Requirements

All endpoints require: `Authorization: Bearer {access-token}`