# Agent Knowledge - Websites

Manage website URLs for AI agent knowledge crawling.

This endpoint provides CRUD operations for managing website URLs that the AI agent should crawl and ingest into its knowledge base. Businesses can submit website URLs and the system crawls and extracts content from these websites to supplement the agent's knowledge when responding to customer queries. Websites are periodically recrawled to ensure the agent's knowledge remains up to date. Each operation is rate limited separately for each app and `entity_id` pair, to 1,000 requests per hour. Once a limit is exhausted, further requests return `429` until the limit resets.

## Base URL

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

## Authorization

This API requires:

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

## APIs

| Method | Endpoint |
|--------|----------|
| DELETE | [/{website_id}](#delete-website-id) |
| GET | [/](#get) |
| GET | [/{website_id}](#get-website-id) |
| POST | [/](#post) |
| PUT | [/{website_id}](#put-website-id) |

<jumplink id="delete-website-id"></jumplink>
## DELETE /{website_id}

Delete a knowledge website

Delete a website crawl entry by its ID. The agent stops drawing on content from that site. Other knowledge sources for the entity are unaffected.


### 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 for the Meta Business Agent. |
| website_id | string | ✓ | The identifier of the website crawl entry, as returned in the `id` field when the entry was created or listed. Pass that value through unchanged. |

### Responses

**204**

Website crawl 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 knowledge websites

Retrieve every website crawl entry configured for the specified entity, including the scoping rules applied to each one.


### 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 for the Meta Business Agent. |

### Responses

**200**

A list of all website crawl entries

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

**Schema**: array of [BizAIKnowledgeWebsiteResponse](#bizaiknowledgewebsiteresponse)

**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-website-id"></jumplink>
## GET /{website_id}

Get a knowledge website

Retrieve a single website crawl entry by its ID, including the subdomain and URL-pattern rules that scope the crawl.


### 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 for the Meta Business Agent. |
| website_id | string | ✓ | The identifier of the website crawl entry, as returned in the `id` field when the entry was created or listed. Pass that value through unchanged. |

### Responses

**200**

The requested website crawl entry

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

**Schema**: [BizAIKnowledgeWebsiteResponse](#bizaiknowledgewebsiteresponse)

**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="post"></jumplink>
## POST /

Add a knowledge website

Register a website for the agent to crawl into its knowledge base. By default the whole domain at `url` is crawled. Use the subdomain, URL-pattern, and single-URL fields to narrow that scope. Narrowing matters most for multi-region and multi-language sites, where crawling everything gives the agent contradictory content, such as prices or policies from a market the customer is not in.


### 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 for the Meta Business Agent. |

### Request Body (Required)

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

**Schema**: [BizAIKnowledgeWebsiteRequest](#bizaiknowledgewebsiterequest)

### Responses

**201**

The newly created website crawl entry

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

**Schema**: [BizAIKnowledgeWebsiteResponse](#bizaiknowledgewebsiteresponse)

**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="put-website-id"></jumplink>
## PUT /{website_id}

Update a knowledge website

Update a website crawl entry by its ID. Use it to widen or narrow the crawl scope after reviewing the content the agent picked up.


### 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 for the Meta Business Agent. |
| website_id | string | ✓ | The identifier of the website crawl entry, as returned in the `id` field when the entry was created or listed. Pass that value through unchanged. |

### Request Body (Required)

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

**Schema**: [BizAIKnowledgeWebsiteRequest](#bizaiknowledgewebsiterequest)

### Responses

**200**

The updated website crawl entry

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

**Schema**: [BizAIKnowledgeWebsiteResponse](#bizaiknowledgewebsiteresponse)

**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="bizaiknowledgewebsiterequest"></jumplink>
### BizAIKnowledgeWebsiteRequest

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| url | string | ✓ | The URL of the website to crawl |
| included_sub_domains | array of string |  | Restrict crawling to these subdomains. When set, only pages on these subdomains are added to the knowledge base. |
| included_url_patterns | array of string |  | Restrict crawling to URLs containing these patterns. When set, only matching pages are added to the knowledge base. |
| excluded_sub_domains | array of string |  | Subdomains to exclude from the knowledge base. |
| excluded_url_patterns | array of string |  | URL patterns to exclude from the knowledge base. Any URL containing one of these substrings is skipped. |
| single_urls | array of string |  | Crawl only these exact URLs instead of the whole website domain. |

<jumplink id="bizaiknowledgewebsiteresponse"></jumplink>
### BizAIKnowledgeWebsiteResponse

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| id | string | ✓ | The unique identifier for this website crawl entry. Pass this value unchanged as the `website_id` path parameter to read, update, or delete the entry. |
| url | string | ✓ | The URL of the website being crawled |
| crawl_status | string |  | The current status of the crawl: "not_started", "pending", "in_progress", "completed" (we crawled the site and extracted knowledge), "completed_no_data" (we crawled it successfully but found nothing extractable) or "failed" (the crawl itself did not fetch any pages -- see crawl_error). |
| crawl_error | string |  | A human-readable explanation of why the crawl failed, for example the site being unreachable or blocking our crawler in robots.txt. Empty while a crawl is still running, and empty for a crawl that fetched pages -- crawl_status already says whether anything was extractable. |
| pages_crawled | integer |  | The number of pages successfully crawled |
| last_crawled_at | integer |  | The timestamp when the website was last successfully crawled |
| created_at | integer |  | The timestamp when the website entry was created |
| included_sub_domains | array of string |  | Subdomains crawling is restricted to, if any |
| included_url_patterns | array of string |  | URL patterns crawling is restricted to, if any |
| excluded_sub_domains | array of string |  | Subdomains excluded from the knowledge base, if any |
| excluded_url_patterns | array of string |  | URL patterns excluded from the knowledge base, if any |
| single_urls | array of string |  | Exact URLs crawled instead of the whole domain, if any |

<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}`