调用日志
调用日志是按调用方隔离的执行记录,用于对账、客服排障和用量核对。所有接口都需要 executions:read 权限,并且只会返回你自己的执行记录。记录中不包含请求内容和查询结果。
列表 GET /v1/executions
Section titled “列表 GET /v1/executions”按开始时间倒序,使用游标分页。
| 参数 | 说明 |
|---|---|
from、to |
RFC 3339 时间窗口,按 started_at 过滤,to 不含。默认最近 24 小时,最长 31 天 |
invocation_id |
精确匹配某次调用。不传 from/to 时在整个保留期内查找 |
capability、operation、provider |
精确过滤 |
outcome |
succeeded、failed、unknown、accepted、expired、in_progress。按报告的状态过滤,超期未结束的记录会匹配 unknown |
limit |
1–100,默认 50 |
cursor |
上一页返回的 meta.next_cursor |
curl -sS "https://services.zgi.im/v1/executions?outcome=unknown&limit=20" \ -H "Authorization: Bearer $ZGI_SERVICES_TOKEN"{ "code": 0, "message": "success", "data": [ { "id": "exe_...", "invocation_id": "...", "outcome": "unknown", "upstream_ref": "...", "duration_ms": 30012 } ], "meta": { "per_page": 20, "has_more": true, "next_cursor": "eyJ0Ijoi..." }}调用日志中的执行记录比普通返回多两个字段:upstream_ref(数据源自己的请求或任务 ID,可以拿去和数据源后台核对)和 duration_ms。
单条 GET /v1/executions/{id}
Section titled “单条 GET /v1/executions/{id}”按执行 ID 查询一条记录。其他调用方的 ID 会返回 404 COMMON.NOT_FOUND。
汇总 GET /v1/executions/summary
Section titled “汇总 GET /v1/executions/summary”按(能力,数据源)汇总一个时间窗口内的执行情况,窗口最长 31 天,默认最近 24 小时。
curl -sS "https://services.zgi.im/v1/executions/summary?from=2026-10-01T00:00:00Z&to=2026-10-08T00:00:00Z" \ -H "Authorization: Bearer $ZGI_SERVICES_TOKEN"{ "code": 0, "message": "success", "data": { "from": "2026-10-01T00:00:00Z", "to": "2026-10-08T00:00:00Z", "rows": [{ "capability": "public_holiday", "provider": "holiday-cn", "total": 120, "succeeded": 118, "failed": 2, "unknown": 0, "accepted": 0, "expired": 0, "in_progress": 0, "provider_requests": 0, "units": { "days": 2760 }, "duration_ms_p50": 3, "duration_ms_p95": 9 }] }}参数、时间窗口或游标无效时返回 422 COMMON.VALIDATION_FAILED;记录存储不可用时返回 503 SERVICES.RECORD_UNAVAILABLE。
保留期与隐私
Section titled “保留期与隐私”执行记录保留 90 天,到期自动清理。记录只包含标识、结果状态、错误分类、用量和数据源的请求引用,不保存查询内容、URL、文档内容、结果、凭据或数据源的错误详情。