# 刷新缓存

`POST /cdn/cache/refresh`

按 URL 或目录刷新 CDN 缓存，刷新后访问者会拿到最新内容。

Base URL: https://api.bitiful.com

Authentication: API key in header `Authorization`

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | enum | yes | 刷新类型：`url` 刷新指定 URL，`directory` 刷新整个目录。 Allowed: `url`, `directory`. |
| `url_list` | list of URLs | yes | 要刷新的 URL 或目录列表，最多 20 个。URL 中不能包含星号 `*`；目录或文件名含 `%` 等特殊字符时需先进行 URL 编码。  |

## Example request

```bash
curl -X POST https://api.bitiful.com/cdn/cache/refresh \
  -H "Content-Type: application/json" \
  -d '{"type":"url","url_list":["https://xxx.com/yyy/zzz.png","https://aaa.com/bbb/ccc.png"]}'
```

## Responses

- **200**: 刷新任务已提交（JSON）。
