文档
列出已生成的文档
GET/generations
该工作区已生成的文档,最新在前。过滤条件以 AND 组合。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
template | uuid | 仅从此模板生成的文档。 |
created_by | uuid | 仅由此用户生成的文档。 |
source | app | api | app 表示在 PaperClerk 中生成的文档,api 表示通过 API 和 MCP 连接器生成的文档。 |
from | date-time | 仅在此时刻或之后创建的文档。ISO 8601;仅给日期表示 UTC 午夜。 |
to | date-time | 仅在此时刻之前创建的文档。区间为半开区间:包含 from,不包含 to。 |
search | string | 仅标题包含此文本的文档。 |
limit | integer | 每页数量,1 到 200。 |
cursor | string | 上一页的 next_cursor。 |
请求
curl "https://usepaperclerk.com/api/v1/generations?template=4d1f0c2e-7b3a-4c1e-9d2f-1a2b3c4d5e6f&from=2026-09-01&limit=2" \
-H "Authorization: Bearer pc_YOUR_TOKEN"响应
JSON
{
"generations": [
{
"id": "9b8e2f10-5c4d-4e3f-8a7b-6c5d4e3f2a1b",
"template_id": "4d1f0c2e-7b3a-4c1e-9d2f-1a2b3c4d5e6f",
"template_title": "Consulting invoice",
"title": "Invoice — Maple & Fern, September",
"generation_number": 13,
"source": "api",
"source_version": 3,
"created_by": "7e6d5c4b-3a2f-4e1d-9c8b-7a6f5e4d3c2b",
"created_by_name": "Mara Novak",
"created_at": "2026-09-12T14:02:11.480Z",
"pdf_status": "ready",
"pdf_url": "https://usepaperclerk.com/api/v1/generations/9b8e2f10-5c4d-4e3f-8a7b-6c5d4e3f2a1b/pdf",
"url": "https://usepaperclerk.com/app/generated/9b8e2f10-5c4d-4e3f-8a7b-6c5d4e3f2a1b"
},
{ "…": "…" }
],
"total": 27,
"has_more": true,
"next_cursor": "MjAyNi0wOS0xMlQxNDowMDowNS4wMDBafDliOGUyZjEw…"
}- 模板被删除后 template_id 为 null;文档和 template_title 仍然保留。
- 文档在其模板内的编号;source_version 是生成时所用的已保存版本。
- 最后一页的 next_cursor 为 null。
- total 统计符合筛选条件的全部文档数量,与分页大小无关。
- created_by_name 是该用户的显示名称;工作区不再共享时为 null。