> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.butterix.com/en/llms.txt
> - v0: https://docs.butterix.com/en/v0/llms.txt

> For the MDX source of any page, append .mdx to the page URL.
> For a complete documentation index, see https://docs.butterix.com/en/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.butterix.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.butterix.com/_biti/feedback/agent.

# Fetch website again

`POST /sites/{site}/sources/{id}/refresh`

Requires the `editor` role. `website` only; runs in the background.

Base URL: https://api.butterix.com/v1

Authentication: bearer token in Authorization header or API key in cookie `biti_session`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `site` | string | yes | Site slug or id |
| `id` | string | yes | Content source id |

## Example request

```bash
curl -X POST https://api.butterix.com/v1/sites/acme-payments/sources/src_01jd8x2k7q/refresh \
     -H "Authorization: Bearer <token>"
```

## Responses

### 202

Queued

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | no |  |
| `kind` | enum | no | Allowed: `document`, `website`. |
| `title` | string | no |  |
| `url` | string | no |  |
| `config` | object | no | Fetch settings, `website` only |
| `config.paths` | list of strings | no |  |
| `config.exclude` | list of strings | no |  |
| `config.maxPages` | integer | no |  |
| `config.refresh` | enum | no | Allowed: `never`, `daily`, `weekly`, `monthly`. |
| `status` | enum | no | Allowed: `ready`, `queued`, `running`, `failed`. |
| `error` | string | no | Why the last fetch failed |
| `pageCount` | integer | no |  |
| `createdAt` | integer | no |  |
| `refreshedAt` | integer | no | When the content was last updated May be null. |
| `nextAt` | integer | no | When it's fetched next May be null. |
| `pages` | list of objects | no | Pages, 500 at most; not in lists |
| `pages[].url` | string | no |  |
| `pages[].title` | string | no |  |
| `pages[].size` | integer | no | Number of characters of text |
| `document` | string | no | Markdown content, `document` only; not in lists |

### 400

Invalid request parameters

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | string | yes | Human-readable error message |
| `code` | string | no | Machine-readable error code (some endpoints) |

### Example response (202)

```json
{
  "id": "src_01jd8x2k7q",
  "kind": "document",
  "title": "help.acme.com",
  "url": "https://help.acme.com/",
  "config": {
    "paths": [
      "string"
    ],
    "exclude": [
      "string"
    ],
    "maxPages": 1,
    "refresh": "never"
  },
  "status": "ready",
  "error": "string",
  "pageCount": 86,
  "createdAt": 1,
  "refreshedAt": 1,
  "nextAt": 1,
  "pages": [
    {
      "url": "string",
      "title": "string",
      "size": 1
    }
  ],
  "document": "string"
}
```
