# Agent Event Insights
Retrieve agent event volume, completion, and latency for a business.
Returns what happened to the events you sent your agent over a date range: how many arrived, how many the agent finished handling, and how long they took, broken down by the event type you supplied. Figures are rolled up once a day, so the most recent day may still be incomplete. This endpoint allows 1,000 requests per hour for each app and `entity_id` pair. Once that is exhausted, further requests return `429` until the limit resets.
## Base URL
| URL | Description |
|-----|-------------|
| https://api.facebook.com/{entity_id}/insights/agent_events | |
## Authorization
This API requires:
any of the following
- Capability: bizai_wa_enterprise_api_3p_access
- Permission: whatsapp_business_messaging
- Permission: instagram_basic
## APIs
| Method | Endpoint |
|--------|----------|
| GET | [/](#get) |
<jumplink id="get"></jumplink>
## GET /
Get agent event insights
Retrieve per-event-type volume, completion, and latency for the specified date range
### Header Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-API-Version | "2.0.0" | | |
### Path Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| entity_id | string | ✓ | The business asset whose agent event insights to return. |
### Query Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| start_date | string | ✓ | First day to include, as YYYY-MM-DD in Pacific Time, which may differ from your own time zone. The boundary is inclusive. |
| end_date | string | ✓ | Last day to include, as YYYY-MM-DD in Pacific Time, which may differ from your own time zone. The boundary is inclusive. start_date and end_date may span at most 30 days, counting both the first and last day. |
| event_type | string | | Return only this event type, named as you sent it. Omit to get every event type received in the range. |
### Responses
**200**
The agent event insights for the requested range
**Content Type**: `application/json`
**Schema**: object
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| data | array of [BizAIOmniChannelAgentEventInsights](#bizaiomnichannelagenteventinsights) | ✓ | One row per event type received in the range, busiest first. Empty when no event of yours was received. |
| avg_e2e_latency_ms | number | | Mean time in milliseconds from receiving an event to the agent finishing with it, across every event type in the range. Null when nothing ran end to end. |
**400**
Bad request
**Content Type**: `application/json`
**Schema**: [StandardError](#standarderror)
**404**
Not found
**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="bizaiomnichannelagenteventinsights"></jumplink>
### BizAIOmniChannelAgentEventInsights
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| event_type | string | ✓ | The event type these figures cover, exactly as you sent it in the agent event request. |
| received | integer | ✓ | Requests of this event type that arrived over the range, counted once each and summed across days. |
| successfully_processed | integer | ✓ | Requests of this event type the agent finished handling, summed across days. Requests that were turned away, skipped, or failed are not counted here. Finishing means the agent sent its message; it is not a delivery signal, and does not guarantee the message reached the customer device. |
| avg_e2e_latency_ms | number | | Mean time in milliseconds from receiving one of these events to the agent finishing with it, over every request in the range that ran end to end. Null when none did. |
<jumplink id="standarderror"></jumplink>
### StandardError
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| detail | string | ✓ | |
| status | integer | | |
| title | string | ✓ | |
| type | string | | |
## Authentication
| Method | How to send it |
|--------|----------------|
| Authorization header | `Authorization: Bearer {access-token}` |
### Global Authentication Requirements
All endpoints require: `Authorization: Bearer {access-token}`