审计日志和操作
目的:查询提供者操作、作业执行和故障排除的操作历史记录。
用户界面流程
- UI 加载每个帐户的最新日志。
- 用户按任务/作业/电子邮件/凭证事件过滤日志。
- UI 公开每个日志的范围详细信息页面。
- UI 可以首先使用搜索删除干运行对旧日志进行受控清理。
客户端库流程
const logs = await api.logs.list(accountId, { limit: 50, offset: 0 });
const filtered = await api.logs.search(accountId, {
query: "smtp_send_message",
limit: 20,
});
if (filtered.data.length > 0) {
await api.logs.get(filtered.data[0].id);
}
HTTP/curl 流程
API_BASE_URL="https://api.inbox-manager.com"
curl -sS "${API_BASE_URL}/api/accounts/${ACCOUNT_ID}/logs?limit=20&offset=0" \
-H "authorization: Bearer ${BEARER_TOKEN}"
curl -sS -X POST "${API_BASE_URL}/api/accounts/${ACCOUNT_ID}/logs/search" \
-H "authorization: Bearer ${BEARER_TOKEN}" \
-H "content-type: application/json" \
--data '{"query":"imap_fetch_body","limit":20,"offset":0}'
curl -sS "${API_BASE_URL}/api/logs/${LOG_ID}" \
-H "authorization: Bearer ${BEARER_TOKEN}"
curl -sS -X POST "${API_BASE_URL}/api/accounts/${ACCOUNT_ID}/logs/search-delete" \
-H "authorization: Bearer ${BEARER_TOKEN}" \
-H "content-type: application/json" \
--data '{"query":"debug","dry_run":true,"limit":100,"older_than":"2026-01-01T00:00:00.000Z"}'
注释
- 日志是帐户和应用程序范围内的。
- 安全策略从日志中排除凭证明文。
search-delete需要older_than。