# Agent Allowlist
Manage the consumer allowlist for the AI agent on a specific entity.
This endpoint manages the consumer allowlist for the AI agent on a specific entity. When the AIAudience setting is set to ALLOWLISTED_ONLY, the agent only responds to consumers whose identifiers are in this list. Uses POST to add entries, GET to list all entries, and DELETE to remove individual entries. Adding, listing, and removing entries are each rate limited for each app and `entity_id` pair, counted separately per operation, to 1,000 requests per hour each. Exceeding a limit returns `429 Too Many Requests`. These limits are subject to change.
## Base URL
| URL | Description |
|-----|-------------|
| https://api.facebook.com/{entity_id}/agent_config/allowlist | |
## 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
- Permission: instagram_basic
## APIs
| Method | Endpoint |
|--------|----------|
| DELETE | [/{entry_id}](#delete-entry-id) |
| GET | [/](#get) |
| POST | [/](#post) |
<jumplink id="delete-entry-id"></jumplink>
## DELETE /{entry_id}
Remove from allowlist
Remove a specific allowlist entry 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 phone number ID or Instagram business account ID for the agent. |
| entry_id | string | ✓ | The identifier of the allowlist entry, as returned in the `id` field when the entry was added or listed. Pass that value through unchanged. |
### Responses
**204**
Allowlist entry successfully deleted
**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)
<jumplink id="get"></jumplink>
## GET /
List allowlist entries
Retrieve all allowlisted consumers for the specified entity
### Header Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-API-Version | "2.0.0" | | |
### Path Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| entity_id | string | ✓ | The WhatsApp phone number ID or Instagram business account ID for the agent. |
### Responses
**200**
A list of all allowlist entries
**Content Type**: `application/json`
**Schema**: array of [BizAIOmniChannelAllowlistResponseV2](#bizaiomnichannelallowlistresponsev2)
**400**
Bad request
**Content Type**: `application/json`
**Schema**: [StandardError](#standarderror)
**401**
Unauthorized
**Content Type**: `application/json`
**Schema**: [StandardError](#standarderror)
**404**
Not found
**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)
<jumplink id="post"></jumplink>
## POST /
Add to allowlist
Add a consumer to the allowlist for the specified entity. Identify a WhatsApp consumer by either `consumer_phone_number` or `consumer_bsuid`, and an Instagram consumer by `consumer_instagram_username`. Each request adds one entry. A WhatsApp business phone number can hold up to 20 allowlisted consumers across both identifiers, and an Instagram business account can hold up to 20 allowlisted Instagram accounts. The two limits are counted separately. Adding an entry once the allowlist is full returns `400 Bad Request`, and the error detail reports the current maximum.
### Header Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-API-Version | "2.0.0" | | |
### Path Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| entity_id | string | ✓ | The WhatsApp phone number ID or Instagram business account ID for the agent. |
### Request Body (Required)
**Content Type**: `application/json`
**Schema**: [BizAIOmniChannelAllowlistRequestV2](#bizaiomnichannelallowlistrequestv2)
### Responses
**201**
The newly created allowlist entry
**Content Type**: `application/json`
**Schema**: [BizAIOmniChannelAllowlistResponseV2](#bizaiomnichannelallowlistresponsev2)
**400**
Bad request
**Content Type**: `application/json`
**Schema**: [StandardError](#standarderror)
**401**
Unauthorized
**Content Type**: `application/json`
**Schema**: [StandardError](#standarderror)
**404**
Not found
**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="bizaiomnichannelallowlistrequestv2"></jumplink>
### BizAIOmniChannelAllowlistRequestV2
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| consumer_phone_number | string | | Consumer WhatsApp phone number in E.164 format. Allowed only when the entity is a WhatsApp business phone number. Mutually exclusive with `consumer_bsuid` and `consumer_instagram_username`. |
| consumer_bsuid | string | | The Business-Scoped User ID (BSUID) of the consumer, as webhooks deliver it, for example `US.2788620304833812`. Use this instead of `consumer_phone_number` to allowlist a consumer whose messages carry no phone number. Allowed only when the entity is a WhatsApp business phone number. Mutually exclusive with `consumer_phone_number` and `consumer_instagram_username`. |
| consumer_instagram_username | string | | Instagram username for the consumer, without the leading `@`. Required when the entity is an Instagram business asset, and must be omitted for WhatsApp business phone numbers. Mutually exclusive with `consumer_phone_number` and `consumer_bsuid`. |
<jumplink id="bizaiomnichannelallowlistresponsev2"></jumplink>
### BizAIOmniChannelAllowlistResponseV2
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| id | string | ✓ | The unique identifier for this allowlist entry. Pass this value unchanged as the `entry_id` path parameter to remove the entry. |
| consumer_phone_number | string | | Consumer WhatsApp phone number in E.164 format. Present on entries for WhatsApp business phone number entities that were added by phone number. Mutually exclusive with `consumer_bsuid` and `consumer_instagram_username`. |
| consumer_bsuid | string | | The Business-Scoped User ID (BSUID) of the consumer. Present on entries for WhatsApp business phone number entities that were added by BSUID. Mutually exclusive with `consumer_phone_number` and `consumer_instagram_username`. |
| consumer_instagram_username | string | | Current Instagram username for the consumer. Present on Instagram entries when the account is available. Mutually exclusive with `consumer_phone_number` and `consumer_bsuid`. |
<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}`