> ## Documentation Index
> Fetch the complete documentation index at: https://docs.my-aichatbot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a page

> Take a Page down. Its URLs stop working right away and its slug is never reused.

Delete a Page owned by the key's bot. Needs a key with **Pages write** turned on. Every URL of the Page, including versioned ones, returns a not-found page from then on, and the slug is retired for good: a later create with the same slug gets `409 SLUG_TAKEN`.

## Authorization

<ParamField header="Authorization" type="string" required>
  `Bearer mac_live_…`
</ParamField>

## Path parameters

<ParamField path="page_id" type="string" required>
  The Page's id.
</ParamField>

## Response

`204 No Content` with an empty body.

<RequestExample>
  ```bash curl theme={null}
  curl -X DELETE "https://app.my-aichatbot.com/api/v1/pages/$PAGE_ID" \
    -H "Authorization: Bearer $MAC_KEY"
  ```

  ```javascript Node.js theme={null}
  await fetch(`https://app.my-aichatbot.com/api/v1/pages/${pageId}`, {
    method: 'DELETE',
    headers: { Authorization: `Bearer ${process.env.MAC_KEY}` }
  })
  ```

  ```python Python theme={null}
  import os, requests

  requests.delete(
      f"https://app.my-aichatbot.com/api/v1/pages/{page_id}",
      headers={"Authorization": f"Bearer {os.environ['MAC_KEY']}"},
  )
  ```
</RequestExample>

<ResponseExample>
  ```text 204 No Content theme={null}
  ```

  ```json 403 Another bot's Page theme={null}
  {
    "ok": false,
    "error": {
      "code": "FORBIDDEN_CHATBOT",
      "message": "This key's chatbot does not own that page (writes are scoped to the key's chatbot)."
    }
  }
  ```
</ResponseExample>

## Errors

| Status | Code                   | Meaning                                                                  |
| ------ | ---------------------- | ------------------------------------------------------------------------ |
| `401`  | `INVALID_API_KEY`      | Missing, broken, or revoked.                                             |
| `403`  | `PAGES_WRITE_DISABLED` | Turn on **Pages write** for this key.                                    |
| `403`  | `FORBIDDEN_CHATBOT`    | The Page belongs to another bot.                                         |
| `404`  | `NOT_FOUND`            | No live Page with that id in this workspace. Deleting twice is a `404`.  |
| `429`  | `RATE_LIMITED`         | Over 120 writes per minute for this key. Wait for `retry_after_seconds`. |
| `500`  | `PERSIST_FAILED`       | We could not delete the Page. Safe to retry.                             |
