管理员日志读取

  • Scope:admin.v1.audit-logs.read
  • 权限项:管理员日志读取(audit-logs)
  • 权限类型:读取
  • 接口:GET/api/openapi/v1/audit-logs

认证与请求头

使用应用 API Key 调用。当前接口只校验上方独立 Scope;读取、管理与执行权限互不隐含。

名称位置类型必填说明示例
Authorizationheaderstring是应用 API Key,使用 Bearer 方式传递。Bearer qwk_***
X-Request-Idheaderstring否可选的调用追踪标识;未传入时由服务端生成。req-20260831-001

请求参数

名称位置类型必填说明示例
fromquerystring · date-time必填Inclusive creation/event time, RFC3339 with timezone; keep fixed while paging."2026-08-27T10:00:00Z"
toquerystring · date-time必填Exclusive creation/event time, after from and at most 180 days later; keep fixed while paging."2026-08-27T10:00:00Z"
cursorquerystring否Opaque next_cursor from the previous page of the same organization and time interval."<string>"
page_sizequeryinteger · int64否-20

请求示例

cURL

curl --request GET \
  --url 'https://example.invalid/api/openapi/v1/audit-logs?from=<from>&to=<to>&cursor=<cursor>&page_size=20' \
  --header 'Authorization: Bearer <API_KEY>'

响应

200 OK

名称类型必填说明示例
has_moreboolean是-false
itemsarray<OpenapifacadeAuditLog>是-[{"action_code":"<string>","actor_auxiliary_identifier_snapshot":"<string>","actor_auxiliary_value_snapshot":"<string>","actor_email_snapshot":"<string>","actor_name_snapshot":"<string>","actor_qid_snapshot":"<string>","actor_user_id":"<string>","after_display":"<string>","before_display":"<string>","category":"<string>","detail_attributes":{},"detail_code":"<string>","detail_text":"<string>","event_id":"<string>","http_method":"<string>","occurred_at":"2026-08-27T10:00:00Z","operation_id":"<string>","org_id":"<string>","payload_hash":"<string>","replay_of_event_id":"<string>","request_id":"<string>","resource_id":"<string>","resource_label":"<string>","resource_type":"<string>","result":"<string>","route_template":"<string>","schema_version":0,"source":"<string>","source_ip":"<string>","source_service":"<string>","success_count":0,"target_count":0,"trace_id":"<string>"}]
items[].action_codestring是-"<string>"
items[].actor_auxiliary_identifier_snapshotstring是-"<string>"
items[].actor_auxiliary_value_snapshotstring是-"<string>"
items[].actor_email_snapshotstring否-"<string>"
items[].actor_name_snapshotstring否-"<string>"
items[].actor_qid_snapshotstring是-"<string>"
items[].actor_user_idstring是-"<string>"
items[].after_displaystring | null是-"<string>"
items[].before_displaystring | null是-"<string>"
items[].categorystring是-"<string>"
items[].detail_attributesobject是-{}
items[].detail_codestring否-"<string>"
items[].detail_textstring否-"<string>"
items[].event_idstring是-"<string>"
items[].http_methodstring是-"<string>"
items[].occurred_atstring · date-time是-"2026-08-27T10:00:00Z"
items[].operation_idstring是-"<string>"
items[].org_idstring是-"<string>"
items[].payload_hashstring是-"<string>"
items[].replay_of_event_idstring | null是-"<string>"
items[].request_idstring是-"<string>"
items[].resource_idstring否-"<string>"
items[].resource_labelstring否-"<string>"
items[].resource_typestring是-"<string>"
items[].resultstring是-"<string>"
items[].route_templatestring是-"<string>"
items[].schema_versioninteger · int64是-0
items[].sourcestring是-"<string>"
items[].source_ipstring否-"<string>"
items[].source_servicestring是-"<string>"
items[].success_countinteger · int64否-0
items[].target_countinteger · int64否-0
items[].trace_idstring否-"<string>"
next_cursorstring是-"<string>"

响应示例

{
  "has_more": false,
  "items": [
    {
      "action_code": "<string>",
      "actor_auxiliary_identifier_snapshot": "<string>",
      "actor_auxiliary_value_snapshot": "<string>",
      "actor_email_snapshot": "<string>",
      "actor_name_snapshot": "<string>",
      "actor_qid_snapshot": "<string>",
      "actor_user_id": "<string>",
      "after_display": "<string>",
      "before_display": "<string>",
      "category": "<string>",
      "detail_attributes": {},
      "detail_code": "<string>",
      "detail_text": "<string>",
      "event_id": "<string>",
      "http_method": "<string>",
      "occurred_at": "2026-08-27T10:00:00Z",
      "operation_id": "<string>",
      "org_id": "<string>",
      "payload_hash": "<string>",
      "replay_of_event_id": "<string>",
      "request_id": "<string>",
      "resource_id": "<string>",
      "resource_label": "<string>",
      "resource_type": "<string>",
      "result": "<string>",
      "route_template": "<string>",
      "schema_version": 0,
      "source": "<string>",
      "source_ip": "<string>",
      "source_service": "<string>",
      "success_count": 0,
      "target_count": 0,
      "trace_id": "<string>"
    }
  ],
  "next_cursor": "<string>"
}

default Flat business error

名称类型必填说明示例
codestring否Stable business error code"<string>"
detailstring是Human-readable error description"<string>"
detailsOpenapiErrorDetails否-{"field":"<string>","reason":"<string>","suggestion":"<string>"}
details.fieldstring否Request field that failed validation"<string>"
details.reasonstring否Stable validation failure reason"<string>"
details.suggestionstring否Suggested normalized value"<string>"
errorstring是Stable HTTP error type"<string>"

响应示例

{
  "code": "<string>",
  "detail": "<string>",
  "details": {
    "field": "<string>",
    "reason": "<string>",
    "suggestion": "<string>"
  },
  "error": "<string>"
}