> 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.

# Suggested redirects for 404s

`GET /sites/{site}/redirects`

Addresses readers visited in the last 30 days that don't exist, with suggested pages, moved sections that can become one rule, and the redirects already added.

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 |

## Example request

```bash
curl https://api.butterix.com/v1/sites/acme-payments/redirects \
     -H "Authorization: Bearer <token>"
```

## Responses

### 200

Suggestions and redirects

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `suggestions` | list of objects | no |  |
| `suggestions[].path` | string | no |  |
| `suggestions[].count` | integer | no |  |
| `suggestions[].last` | integer | no |  |
| `suggestions[].target` | object | no | 地址最像的页面；没有把握时不给 |
| `suggestions[].target.path` | string | no |  |
| `suggestions[].target.title` | string | no |  |
| `suggestions[].target.score` | number | no |  |
| `groups` | list of objects | no |  |
| `groups[].from` | string | no |  |
| `groups[].to` | string | no |  |
| `groups[].paths` | list of strings | no |  |
| `groups[].count` | integer | no |  |
| `rules` | list of objects | no |  |
| `rules[].from` | string | no |  |
| `rules[].to` | string | no |  |
| `rules[].status` | enum | no | Allowed: `301`, `302`. |
| `rules[].at` | integer | no |  |
| `rules[].active` | boolean | no | 原地址有了页面时为 false，不再跳转 |

### Example response (200)

```json
{
  "suggestions": [
    {
      "path": "/gide",
      "count": 12,
      "last": 1,
      "target": {
        "path": "/guide",
        "title": "string",
        "score": 1.1
      }
    }
  ],
  "groups": [
    {
      "from": "/docs/old/*",
      "to": "/docs/new/:splat",
      "paths": [
        "string"
      ],
      "count": 1
    }
  ],
  "rules": [
    {
      "from": "string",
      "to": "string",
      "status": 301,
      "at": 1,
      "active": true
    }
  ]
}
```
