列出网站的路由,支持分页,并包含有效的区块 ID。
列出网站的路由,支持分页,并可按状态和模式进行可选过滤。对于 block_ids 为空的路由,将从匹配的动态默认路由回填,因此返回的 block_ids 是要渲染的有效区块。
认证: API 密钥(x-api-key 请求头或 api_key 查询参数)。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
websiteId | uuid | 是 | 目标网站。 |
api_key | string | 否 | x-api-key 请求头的替代方案。 |
state | string | 否 | 按路由状态过滤(精确匹配)。 |
pattern | string | 否 | 对路由模式进行子串匹配(LIKE,通配符已转义)。 |
limit | integer | 否 | 页面大小,默认 50,限定在 1–100。 |
offset | integer | 否 | 要跳过的行数,默认 0。 |
结果按 updated_at DESC 排序。
{
"routes": [
{
"website_id": "...",
"path": "/docs/getting-started",
"pattern": "/docs/getting-started",
"label": "Getting Started",
"tags": [],
"block_ids": ["..."],
"template_block_ids": ["..."],
"override_mode": "merge",
"state": "Live",
"param_bindings": {},
"created_at": "2026-06-23T18:34:16Z",
"updated_at": "2026-06-23T20:36:55Z"
}
],
"total": 42,
"hasMore": true
}
total 是过滤后的完整计数;hasMore 为 offset + limit < total。当未设置时,label、param_bindings、template_block_ids 和 override_mode 会被省略或为 null。
curl '{CMS_API_URL}/routes?websiteId=<uuid>&limit=20' \
-H 'x-api-key: <key>'
400 — 缺失或无效的 websiteId401 — 无效的 API 密钥(或在服务器要求时缺失)