# Manage Pages

Add or delete pages from your chatbot's knowledge base. This allows you to dynamically update what content your chatbot can reference.

## Delete Pages

Remove specific pages from your chatbot's knowledge base.

### Endpoint

```
POST https://app.wonderchat.io/api/v1/delete-pages
```

### Request Parameters

| Parameter   | Type   | Required | Description                                |
| ----------- | ------ | -------- | ------------------------------------------ |
| `apiKey`    | string | ✅ Yes    | Your API key                               |
| `chatbotId` | string | ✅ Yes    | The ID of the chatbot to delete pages from |
| `urls`      | array  | ✅ Yes    | List of URLs to delete from your chatbot   |

### Example Request

```bash
curl --location --request POST 'https://app.wonderchat.io/api/v1/delete-pages' \
--header 'Content-Type: application/json' \
--data-raw '{
  "apiKey": "YOUR_API_KEY",
  "chatbotId": "YOUR_CHATBOT_ID",
  "urls": [
    "https://wonderchat.io/pricing"
  ]
}'
```

## Add Pages

Add new pages to your chatbot's knowledge base.

### Endpoint

```
POST https://app.wonderchat.io/api/v1/add-pages
```

### Request Parameters

| Parameter       | Type   | Required | Description                                    |
| --------------- | ------ | -------- | ---------------------------------------------- |
| `apiKey`        | string | ✅ Yes    | Your API key                                   |
| `chatbotId`     | string | ✅ Yes    | The ID of the chatbot to add pages to          |
| `urls`          | array  | ✅ Yes    | List of URLs to add to your chatbot            |
| `sessionCookie` | string | ❌ No     | Session cookie for crawling sites behind login |

### Example Request

```bash
curl --location --request POST 'https://app.wonderchat.io/api/v1/add-pages' \
--header 'Content-Type: application/json' \
--data-raw '{
  "apiKey": "YOUR_API_KEY",
  "chatbotId": "YOUR_CHATBOT_ID",
  "urls": [
    "https://wonderchat.io"
  ]
}'
```

### Session Cookie

For pages behind authentication, you can provide a `sessionCookie` parameter. For detailed instructions on obtaining a valid session cookie, visit: <https://docs.wonderchat.io/setup-guides/setting-up-your-chatbot/how-to-crawl-and-update-private-sites>

## Use Cases

* **Content Updates**: Keep your chatbot's knowledge current
* **Seasonal Content**: Add/remove pages based on business cycles
* **A/B Testing**: Test different content sets
* **Compliance**: Remove outdated or incorrect information
* **Private Content**: Add authenticated pages using session cookies


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wonderchat.io/api-reference/pages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
