Skip to main content

管理员日志读取

按时间区间分页读取管理后台的管理员操作日志,查看操作人、操作对象、变更前后的展示值及操作结果。可用于对接企业自有的审计与归档系统。

  • 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 --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>是记录列表-
next_cursorstring是下一页游标"<string>"

items[] 字段

以下必填性针对对象存在时的子字段;父对象可否省略或为 null,以上层字段表为准。
字段类型必填说明
action_codestring是操作
actor_auxiliary_identifier_snapshotstring是操作人辅助识别信息类型(操作时快照)
actor_auxiliary_value_snapshotstring是操作人辅助识别信息(操作时快照)
actor_email_snapshotstring否操作人邮箱(操作时快照)
actor_name_snapshotstring否操作人姓名(操作时快照)
actor_qid_snapshotstring是操作人 QID(操作时快照)
actor_user_idstring是操作人 ID
after_displaystring | null是变更后内容
before_displaystring | null是变更前内容
categorystring是日志分类
detail_attributesobject是详情属性
detail_codestring否详情代码
detail_textstring否操作详情
event_idstring是事件 ID
http_methodstring是HTTP 方法
occurred_atstring · date-time是操作时间
operation_idstring是接口操作标识
org_idstring是组织 ID
payload_hashstring是事件内容摘要
replay_of_event_idstring | null是原始重放事件 ID
request_idstring是请求 ID
resource_idstring否资源 ID
resource_labelstring否操作对象
resource_typestring是资源类型
resultstring是操作结果
route_templatestring是接口路由模板
schema_versioninteger · int64是事件结构版本
sourcestring是来源
source_ipstring否来源 IP
source_servicestring是来源服务
success_countinteger · int64否成功数量
target_countinteger · int64否目标用户数
trace_idstring否链路追踪 ID

items[].detail_attributes 字段

以下必填性针对对象存在时的子字段;父对象可否省略或为 null,以上层字段表为准。
字段类型必填说明
{key}any否键为事件详情属性名,值可为任意 JSON;字段随审计事件变化
{
  "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否错误详情-
errorstring是Stable HTTP error type"<string>"

details 字段

以下必填性针对对象存在时的子字段;父对象可否省略或为 null,以上层字段表为准。
字段类型必填说明
fieldstring否校验失败的请求字段
reasonstring否校验失败的原因代码
suggestionstring否建议使用的规范化值
{
  "code": "<string>",
  "detail": "<string>",
  "details": {
    "field": "<string>",
    "reason": "<string>",
    "suggestion": "<string>"
  },
  "error": "<string>"
}