> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 审计日志 - GET /v1/workspaces/:workspace_id/audit

> 通过 GET /v1/workspaces/:workspace_id/audit 返回工作空间的操作审计日志（最近 200 条）。最小角色 admin。

返回工作空间的操作审计日志，按时间倒序，最多 200 条。记录建库、上传文档、导入代码仓库等关键动作。

## 接口

```http theme={null}
GET /v1/workspaces/:workspace_id/audit
```

## 认证

`Authorization: Bearer <jwt>` 或 `X-API-Key <sk_...>`。最小角色：**admin**。

## 路径参数

<ParamField path="workspace_id" type="string" required>
  工作空间 id。
</ParamField>

## 响应

响应为一个数组，每个元素为审计记录：

<ResponseField name="id" type="string">
  记录 id（`aud_...`）。
</ResponseField>

<ResponseField name="workspace_id" type="string">
  所属工作空间 id。
</ResponseField>

<ResponseField name="user_id" type="string">
  操作人用户 id。
</ResponseField>

<ResponseField name="action" type="string">
  动作类型（如 `create_kb`、`upload_document`）。
</ResponseField>

<ResponseField name="object" type="string">
  动作作用对象的 id。
</ResponseField>

<ResponseField name="detail" type="string">
  动作详情（JSON 字符串）。
</ResponseField>

<ResponseField name="created_at" type="string">
  发生时间（RFC3339）。
</ResponseField>

## 示例

<RequestExample>
  ```bash cURL theme={null}
  curl https://memo.ariacompute.cn/v1/workspaces/ws_01a2b3c4d5e6/audit \
    -H "Authorization: Bearer <jwt>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "id": "aud_01a2b3c4d5e6",
      "workspace_id": "ws_01a2b3c4d5e6",
      "user_id": "usr_01a2b3c4d5e6",
      "action": "create_kb",
      "object": "kb_01a2b3c4d5e6",
      "detail": "产品文档",
      "created_at": "2026-10-12T08:05:00Z"
    }
  ]
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.