{"openapi":"3.1.0","info":{"title":"LeanCrawl API","version":"0.1.0","description":"API-first web data for agents: capture, crawl, monitor. Auth: `Authorization: Bearer ac-…`。"},"servers":[{"url":"https://api.leancrawl.com"}],"paths":{"/v1/markdown":{"post":{"summary":"Read a page as clean Markdown","description":"Costs 1 credit per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MarkdownData"},"meta":{"$ref":"#/components/schemas/ResultMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkdownRequest"}}}}}},"/v1/html":{"post":{"summary":"Fully rendered HTML after JS execution","description":"Costs 1 credit per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/HtmlData"},"meta":{"$ref":"#/components/schemas/ResultMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HtmlRequest"}}}}}},"/v1/links":{"post":{"summary":"All links on a single page","description":"Costs 1 credit per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/LinksData"},"meta":{"$ref":"#/components/schemas/ResultMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinksRequest"}}}}}},"/v1/screenshot":{"post":{"summary":"Page screenshot → screenshot_url（鉴权下载）","description":"Costs 2 credits per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ScreenshotData"},"meta":{"$ref":"#/components/schemas/ResultMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenshotRequest"}}}}}},"/v1/pdf":{"post":{"summary":"Page → PDF → pdf_url（鉴权下载）","description":"Costs 2 credits per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/PdfData"},"meta":{"$ref":"#/components/schemas/ResultMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfRequest"}}}}}},"/v1/extract":{"post":{"summary":"AI structured extraction → JSON（schema 或 prompt 必填其一）","description":"Costs 3 credits per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ExtractData"},"meta":{"$ref":"#/components/schemas/ExtractMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}}}}},"/v1/map":{"post":{"summary":"Discover site URLs（sitemap 优先 + 页面链接兜底）","description":"Costs 1 credit per call.","tags":["capture"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MapData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapRequest"}}}}}},"/v1/crawl":{"post":{"summary":"Start an async crawl job（预扣 limit 额度，逐页结算）","description":"HTTP 202。轮询 GET /v1/crawl/{jobId}；credits 语义见 docs credits.md。","tags":["crawl"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"幂等键：同 key 重试不二次建 job"}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncSuccess"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlRequest"}}}}},"get":{"summary":"List crawl jobs（keyset 分页）","description":"Free (not billed).","tags":["crawl"],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","completed","partial","failed","cancelled"]},"description":"状态过滤"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Keyset 分页游标（上一响应的 next_cursor）；畸形 → 400"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50},"description":"每页条数（1–50，默认 20）"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CrawlJobList"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/crawl/{jobId}":{"get":{"summary":"Crawl job status（+ ?include=pages 取页内容）","description":"Free (not billed).","tags":["crawl"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"},"description":"job id（crawl_start 返回）"},{"name":"include","in":"query","required":false,"schema":{"type":"string","enum":["pages"]},"description":"终态取回页内容"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200},"description":"pages 批量大小（默认 20）"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Keyset 分页游标（上一响应的 next_cursor）；畸形 → 400"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CrawlStatusData"},"meta":{"$ref":"#/components/schemas/CrawlStatusMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"summary":"Cancel crawl job（未用预扣退回）","description":"Free (not billed).","tags":["crawl"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"},"description":"job id（crawl_start 返回）"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CrawlStatusData"},"meta":{"$ref":"#/components/schemas/CrawlStatusMeta"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/monitor":{"post":{"summary":"Create a periodic change monitor","description":"Free (not billed). interval_minutes 下限按 plan 分档（Free 60 / 付费 15）。每次 check 1 credit。","tags":["monitor"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MonitorData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorCreate"}}}}},"get":{"summary":"List monitors（keyset 分页）","description":"Free (not billed).","tags":["monitor"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Keyset 分页游标（上一响应的 next_cursor）；畸形 → 400"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50},"description":"每页条数（1–50，默认 20）"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MonitorList"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/monitor/{id}":{"get":{"summary":"Monitor detail","description":"Free (not billed).","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MonitorData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"summary":"Pause / resume / retune monitor","description":"Free (not billed).","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MonitorData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorPatch"}}}}},"delete":{"summary":"Delete monitor（级联 checks + snapshots）","description":"Free (not billed).","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/monitor/{id}/checks":{"get":{"summary":"Monitor check history（keyset 分页）","description":"Free (not billed).","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Keyset 分页游标（上一响应的 next_cursor）；畸形 → 400"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50},"description":"每页条数（1–50，默认 20）"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MonitorCheckList"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/monitor/{id}/checks/{checkId}/diff":{"get":{"summary":"Adjacent-snapshot line diff for a check（monitor-diff）","description":"Free (not billed). available=false + reason（not_diffable/snapshot_expired/too_large）为常态非错误；new=全 added，removed=全 removed；context 默认 3，行段 hunk 化带 elision 折叠。","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"},{"name":"checkId","in":"path","required":true,"schema":{"type":"string"},"description":"check id"},{"name":"context","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":50},"description":"变更块两侧保留的 context 行数"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MonitorCheckDiff"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/monitor/{id}/snapshots/{snapshotId}":{"get":{"summary":"Fetch a monitor snapshot as normalized markdown（agent-selfserve）","description":"Free (not billed). text/markdown 直出（非 JSON 信封）；ETag=content_hash，X-Snapshot-Char-Count/X-Snapshot-Created-At 带元信息。每 monitor 留最近 10 个快照——已淘汰/不存在均 404，取回宜在事件后尽快进行。check 行 snapshot_id/prev_snapshot_id 可喂本端点。","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"},{"name":"snapshotId","in":"path","required":true,"schema":{"type":"string"},"description":"snapshot id（checks 行 snapshot_id/prev_snapshot_id）"}],"responses":{"200":{"description":"OK","content":{"text/markdown":{"schema":{"type":"string","description":"规整化 markdown 快照原文（逐行 trim、去空行、剥 ignore_patterns 行）——体积可能较大"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/monitor/{id}/run":{"post":{"summary":"Trigger a manual check now（验证 webhook 链路）","description":"Costs 1 credit per call. 立即派发一次 check（paused 态也可手动跑）；HTTP 202。","tags":["monitor"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"monitor id"}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"scheduled_ts":{"type":"integer"}},"required":["id","scheduled_ts"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/account/usage":{"get":{"summary":"Credit balance + quota + in-flight reserved","description":"Free (not billed).","tags":["account"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UsageData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/account/usage/daily":{"get":{"summary":"Daily usage aggregation（UTC 日历日，days 轴预填）","description":"Free (not billed).","tags":["account"],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":90},"description":"滚动天数（默认 30）"},{"name":"endpoint","in":"query","required":false,"schema":{"type":"string","enum":["markdown","html","links","screenshot","pdf","extract","map","crawl","monitor"]},"description":"端点过滤"},{"name":"api_key_id","in":"query","required":false,"schema":{"type":"string"},"description":"api key id 过滤；'self'=调用方 key；不匹配 NULL（system）桶"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UsageDailyData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/account/activity":{"get":{"summary":"Run-level activity log（过滤 + keyset 分页）","description":"Free (not billed).","tags":["account"],"parameters":[{"name":"endpoint","in":"query","required":false,"schema":{"type":"string","enum":["markdown","html","links","screenshot","pdf","extract","map","crawl","monitor"]},"description":"端点过滤"},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["success","error","blocked","cached"]},"description":"状态过滤"},{"name":"from","in":"query","required":false,"schema":{"type":"integer"},"description":"起始 unix 秒（含）"},{"name":"to","in":"query","required":false,"schema":{"type":"integer"},"description":"截止 unix 秒（含）"},{"name":"api_key_id","in":"query","required":false,"schema":{"type":"string"},"description":"api key id 过滤；'self'=调用方 key；不匹配 NULL（system）桶"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Keyset 分页游标（上一响应的 next_cursor）；畸形 → 400"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"每页条数（1–100，默认 50）"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ActivityData"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/account/keys":{"get":{"summary":"List API keys（掩码）","description":"Free (not billed).","tags":["account"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ApiKeyList"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"summary":"Create API key（明文仅本次返回）","description":"Free (not billed).","tags":["account"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ApiKeyCreated"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}}}},"/v1/account/keys/{id}/revoke":{"post":{"summary":"Revoke API key","description":"Free (not billed).","tags":["account"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"api key id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["revoked"]}},"required":["id","status"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/notifications/channels":{"get":{"summary":"List notification channels（不含 secrets/signing_secret）","description":"Free (not billed).","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"}}},"required":["channels"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"summary":"Create notification channel（custom 的 signing_secret 仅此一次返回）","description":"Free (not billed). channel_type: slack/discord/telegram/feishu/wecom/dingtalk/email/custom。预置渠道 url 校验「白名单域名 + 固定 path 前缀」；custom 用预置验证方式 config.auth_type（none/bearer/basic），凭证 token/username/password 在 secrets（值加密入库、永不回显）；telegram/email 无 url（chat_id/bot_token、recipients 在 config/secrets）。渠道事件不含 crawl.page（每页一发的高频事件仅请求级 crawl webhook 可用）。每 team 上限 20。","tags":["notifications"],"parameters":[],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ChannelCreated"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCreate"}}}}}},"/v1/notifications/channels/{id}":{"get":{"summary":"Channel detail","description":"Free (not billed).","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/NotificationChannel"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"summary":"Update channel（url/events/status/config/secrets；channel_type 与 id 不可变）","description":"Free (not billed). secrets 逐键合并：留空的已有键保留原值，新键必须填值，删除键即删除。url 变更会把未完结 deliveries（pending/failed/dead）改派到新地址；delivered 行保留历史地址。","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/NotificationChannel"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelPatch"}}}}},"delete":{"summary":"Delete channel（deliveries 留审计；挂接的 monitor 自动解绑）","description":"Free (not billed).","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deleted":{"type":"boolean"},"detached_monitors":{"type":"integer"}},"required":["deleted"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/notifications/channels/{id}/rotate":{"post":{"summary":"Rotate signing secret（仅 custom；id/挂接不动，旧 secret 立即失效）","description":"Free (not billed). 新 signing_secret 仅此一次返回。旧 secret 立即失效：在途重试/resend 自动用新密钥重签，接收方需尽快更新。","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ChannelCreated"},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/notifications/channels/{id}/test":{"post":{"summary":"Send a test notification（notification.test 事件，走真实投递链路）","description":"Free (not billed). 团队级限流 10 次/小时，超限 429。","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"delivery_id":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed","dead"]},"response_code":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["delivery_id","status"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/notifications/channels/{id}/deliveries":{"get":{"summary":"Recent deliveries（最近 50 条，无分页）","description":"Free (not billed).","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/ChannelDelivery"}}},"required":["deliveries"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/notifications/channels/{id}/deliveries/{deliveryId}/resend":{"post":{"summary":"Resend a delivery（attempts 归零重计 3 次配额）","description":"Free (not billed). 已 delivered 的投递 → 400。","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"channel id"},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string"},"description":"delivery id（deliveries 列表行）"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed","dead"]},"attempts":{"type":"integer"},"response_code":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["id","status","attempts"]},"credit_cost":{"type":"integer"}},"required":["success","data","credit_cost"]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/artifacts/{runId}":{"get":{"summary":"Download run artifact（screenshot/png 或 pdf）","description":"Free (not billed). capture 响应里的 URL 自带 `?exp&sig` 预授权 query：24h 内持链免 Bearer 直接下载。无 query 时需 Bearer 且按 run→team 归属校验。","tags":["artifacts"],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"},"description":"capture run id"}],"responses":{"200":{"description":"OK","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary","description":"二进制产物（image/png · application/pdf）"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}}},"components":{"schemas":{"MarkdownRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},"timeout":{"description":"Request budget in ms (1000–60000). Default is provider default.","type":"integer","minimum":1000,"maximum":60000}},"required":["url"]},"HtmlRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},"timeout":{"description":"Request budget in ms (1000–60000). Default is provider default.","type":"integer","minimum":1000,"maximum":60000}},"required":["url"]},"LinksRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"include_external":{"type":"boolean"},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},"timeout":{"description":"Request budget in ms (1000–60000). Default is provider default.","type":"integer","minimum":1000,"maximum":60000}},"required":["url"]},"ScreenshotRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"format":{"type":"string","enum":["png","jpeg","webp"]},"full_page":{"type":"boolean"},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":200,"maximum":4096},"height":{"type":"integer","minimum":200,"maximum":4096}},"required":["width","height"]},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},"timeout":{"description":"Request budget in ms (1000–60000). Default is provider default.","type":"integer","minimum":1000,"maximum":60000}},"required":["url"]},"PdfRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"landscape":{"type":"boolean"},"print_background":{"type":"boolean"},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},"timeout":{"description":"Request budget in ms (1000–60000). Default is provider default.","type":"integer","minimum":1000,"maximum":60000}},"required":["url"]},"ExtractRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"prompt":{"type":"string","maxLength":4000},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},"timeout":{"description":"Request budget in ms (1000–60000). Default is provider default.","type":"integer","minimum":1000,"maximum":60000}},"required":["url"]},"MapRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"search":{"type":"string","maxLength":200},"include_subdomains":{"type":"boolean"},"limit":{"default":5000,"type":"integer","minimum":1,"maximum":100000}},"required":["url"]},"CrawlRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","format":"uri","description":"Page URL to fetch (http or https).","pattern":"^https?://"},"limit":{"default":100,"type":"integer","minimum":1,"maximum":10000},"include_paths":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"exclude_paths":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"webhook":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.page","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}},"secret":{"type":"string","minLength":8,"maxLength":200}},"required":["url","events"]}},"required":["url"]},"MonitorCreate":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"pattern":"^https?://"},"name":{"type":"string","minLength":1,"maxLength":80},"interval_minutes":{"default":60,"type":"integer","minimum":1,"maximum":10080},"ignore_patterns":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"webhook_id":{"type":"string","minLength":1,"maxLength":64},"wait_for":{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000}},"required":["url"]},"MonitorPatch":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"pattern":"^https?://"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"interval_minutes":{"type":"integer","minimum":1,"maximum":10080},"ignore_patterns":{"anyOf":[{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},{"type":"null"}]},"webhook_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"wait_for":{"anyOf":[{"description":"Extra wait after page load, in ms (0–60000). Use for slow JS-heavy pages.","type":"integer","minimum":0,"maximum":60000},{"type":"null"}]},"status":{"type":"string","enum":["active","paused"]}}},"ChannelCreate":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"channel_type":{"type":"string","const":"custom"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"url":{"type":"string","format":"uri"},"config":{"type":"object","properties":{"auth_type":{"type":"string","enum":["none","bearer","basic"]}}},"secrets":{"type":"object","properties":{"token":{"type":"string","minLength":1,"pattern":"^[^\\r\\n]*$"},"username":{"type":"string","minLength":1,"pattern":"^[^\\r\\n]*$"},"password":{"type":"string","minLength":1,"pattern":"^[^\\r\\n]*$"}},"additionalProperties":false},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","url","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"slack"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","url","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"discord"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","url","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"telegram"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"config":{"type":"object","properties":{"chat_id":{"type":"string","minLength":1,"maxLength":64}},"required":["chat_id"]},"secrets":{"type":"object","properties":{"bot_token":{"type":"string","pattern":"^\\d+:[A-Za-z0-9_-]+$"}},"required":["bot_token"],"additionalProperties":false},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","config","secrets","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"email"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"config":{"type":"object","properties":{"recipients":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["recipients"]},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","config","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"feishu"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"url":{"type":"string","format":"uri"},"config":{"type":"object","properties":{"keyword":{"type":"string","minLength":1,"maxLength":50}}},"secrets":{"type":"object","properties":{"sign_secret":{"type":"string","minLength":1}},"additionalProperties":false},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","url","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"wecom"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","url","events"]},{"type":"object","properties":{"channel_type":{"type":"string","const":"dingtalk"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},"url":{"type":"string","format":"uri"},"secrets":{"type":"object","properties":{"sign_secret":{"type":"string","minLength":1}},"additionalProperties":false},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}}},"required":["channel_type","url","events"]}]},"ChannelPatch":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80,"pattern":"^[^\\r\\n]*$"},{"type":"null"}]},"url":{"type":"string","format":"uri","pattern":"^https?://"},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}},"status":{"type":"string","enum":["active","disabled"]},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"secrets":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"MarkdownData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markdown":{"type":"string"}},"required":["markdown"],"additionalProperties":false},"HtmlData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"html":{"type":"string"}},"required":["html"],"additionalProperties":false},"LinksData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"text":{"type":"string"}},"required":["url"],"additionalProperties":false}}},"required":["links"],"additionalProperties":false},"ScreenshotData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"screenshot_url":{"type":"string"}},"required":["screenshot_url"],"additionalProperties":false},"PdfData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pdf_url":{"type":"string"}},"required":["pdf_url"],"additionalProperties":false},"ExtractData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"json":{}},"required":["json"],"additionalProperties":false},"MapData":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"links":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"}},"required":["url"],"additionalProperties":false}},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sources":{"type":"object","properties":{"sitemap":{"type":"boolean"},"page_links":{"type":"boolean"}},"required":["sitemap","page_links"],"additionalProperties":false}},"required":["links","count","sources"],"additionalProperties":false},"ResultMeta":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string"},"status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","pattern":"^https?://"},"duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["status_code","url","duration_ms"],"additionalProperties":false},"ExtractMeta":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string"},"status_code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","pattern":"^https?://"},"duration_ms":{"type":"integer","minimum":0,"maximum":9007199254740991},"extraction_warning":{"type":"string"}},"required":["status_code","url","duration_ms"],"additionalProperties":false},"AsyncSuccess":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"job_id":{"type":"string"},"status_url":{"type":"string"}},"required":["job_id","status_url"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"ErrorBody":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","INSUFFICIENT_CREDITS","FORBIDDEN","JOB_NOT_FOUND","NOT_FOUND","TARGET_TIMEOUT","RATE_LIMITED","TARGET_BLOCKED","TARGET_UNREACHABLE","PROVIDER_ERROR","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"CrawlStatusData":{"type":"object","properties":{"status":{"type":"string","enum":["queued","running","completed","partial","failed","cancelled"]},"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"credit_cost":{"type":"integer"},"expires_at":{"type":"integer"},"created_at":{"type":"integer"},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"target_url":{"type":"string"},"limit":{"type":"integer"},"include_paths":{"type":"array","items":{"type":"string"}},"exclude_paths":{"type":"array","items":{"type":"string"}},"reserved_cost":{"type":"integer"},"actual_cost":{"type":"integer"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"pages":{"type":"array","items":{"$ref":"#/components/schemas/CrawlPage"},"description":"仅 ?include=pages 时返回"},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","total","completed","failed","credit_cost","target_url"]},"CrawlPage":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"string"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"markdown":{"type":"string"}},"required":["url","status"]},"CrawlStatusMeta":{"type":"object","properties":{"truncated_by_credits":{"type":"boolean"}}},"CrawlJobList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CrawlJobItem"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor"]},"CrawlJobItem":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","partial","failed","cancelled"]},"target_url":{"type":"string"},"total":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"credit_cost":{"type":"integer"},"created_at":{"type":"integer"},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"expires_at":{"type":"integer"}},"required":["id","status","target_url"]},"MonitorList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MonitorData"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor"]},"MonitorData":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"},"interval_minutes":{"type":"integer"},"ignore_patterns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"wait_for":{"anyOf":[{"type":"integer"},{"type":"null"}]},"status":{"type":"string","enum":["active","paused"]},"webhook_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"next_run_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"last_check_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"last_status":{"anyOf":[{"type":"string","enum":["new","changed","same","removed","error"]},{"type":"null"}]},"last_change_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"consecutive_errors":{"type":"integer"},"created_at":{"type":"integer"}},"required":["id","url","interval_minutes","status"]},"MonitorCheckList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MonitorCheckData"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor"]},"MonitorCheckData":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["new","changed","same","removed","error"]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit_cost":{"type":"integer"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}]},"snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"本次 check 写入的快照（removed/same 为 null）"},"prev_snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"对比基线快照 id；removed/same 行\"当时内容\"取它"},"diff_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduled_ts":{"type":"integer"},"created_at":{"type":"integer"}},"required":["id","status"]},"MonitorCheckDiff":{"type":"object","properties":{"check_id":{"type":"string"},"status":{"type":"string","enum":["new","changed","same","removed","error"]},"snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"prev_snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"available":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["not_diffable","snapshot_expired","too_large"]},{"type":"null"}]},"context":{"type":"integer"},"stats":{"type":"object","properties":{"added":{"type":"integer"},"removed":{"type":"integer"}},"required":["added","removed"]},"lines":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["context","added","removed","elision"]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["type"]}},"truncated":{"type":"boolean"}},"required":["check_id","status","available"]},"UsageData":{"type":"object","properties":{"plan_credits":{"type":"integer"},"one_time_credits":{"type":"integer"},"period_end":{"anyOf":[{"type":"integer"},{"type":"null"}]},"plan_quota":{"type":"integer"},"reserved":{"type":"integer"}},"required":["plan_credits","one_time_credits","plan_quota","reserved"]},"UsageDailyData":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","format":"date"}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/UsageDailyRow"}}},"required":["days","rows"]},"UsageDailyRow":{"type":"object","properties":{"date":{"type":"string","format":"date"},"endpoint":{"type":"string","enum":["markdown","html","links","screenshot","pdf","extract","map","crawl","monitor"]},"runs":{"type":"integer"},"credits":{"type":"integer"},"errors":{"type":"integer"},"cached":{"type":"integer"}},"required":["date","endpoint","runs","credits"]},"ActivityData":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/ActivityRun"}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["runs","next_cursor"]},"ActivityRun":{"type":"object","properties":{"id":{"type":"string"},"endpoint":{"type":"string","enum":["markdown","html","links","screenshot","pdf","extract","map","crawl","monitor"]},"status":{"type":"string","enum":["success","error","blocked","cached"]},"credit_cost":{"type":"integer"},"target_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"auth_via":{"type":"string","enum":["key","session","system","mcp"]},"has_artifact":{"type":"boolean"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"integer"}},"required":["id","endpoint","status","created_at"]},"ApiKeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyData"}},"unattributed_credits_30d":{"type":"integer"}},"required":["keys","unattributed_credits_30d"]},"ApiKeyData":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"key_prefix":{"type":"string"},"kind":{"type":"string","enum":["user","playground"]},"status":{"type":"string","enum":["active","revoked"]},"created_at":{"type":"integer"},"last_used_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"credits_30d":{"type":"integer"}},"required":["id","key_prefix","kind","status","credits_30d"]},"ApiKeyCreated":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key":{"type":"string","description":"完整明文，仅此一次返回"},"key_prefix":{"type":"string"}},"required":["id","key"]},"NotificationChannel":{"type":"object","properties":{"id":{"type":"string"},"channel_type":{"type":"string","enum":["slack","discord","telegram","feishu","wecom","dingtalk","email","custom"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"config":{"anyOf":[{"type":"object"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}},"status":{"type":"string","enum":["active","disabled"]},"created_at":{"type":"integer"}},"required":["id","channel_type","events","status","created_at"]},"ChannelCreated":{"type":"object","properties":{"id":{"type":"string"},"channel_type":{"type":"string","enum":["slack","discord","telegram","feishu","wecom","dingtalk","email","custom"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"config":{"anyOf":[{"type":"object"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed"]}},"status":{"type":"string","enum":["active","disabled"]},"created_at":{"type":"integer"},"signing_secret":{"type":"string","description":"仅 custom 渠道返回；whsec_ 前缀，仅此一次"}},"required":["id","channel_type","events","status","created_at"]},"ChannelDelivery":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["crawl.started","crawl.completed","crawl.failed","monitor.page","monitor.check.completed","notification.test"]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["pending","delivered","failed","dead"]},"attempts":{"type":"integer"},"response_code":{"anyOf":[{"type":"integer"},{"type":"null"}]},"next_retry_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"created_at":{"type":"integer"},"delivered_at":{"anyOf":[{"type":"integer"},{"type":"null"}]},"job_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","event","status","attempts"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"$ref":"#/components/schemas/ErrorBody"}},"required":["success","error"]}},"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"API key `ac-…`"}}}}