---
title: "Audit"
method: GET
path: "/admin/audit"
tags: ["admin"]
---

# Audit

`GET /admin/audit`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/admin/audit`
- Auth: none declared

游标分页（keyset：按 (created_at, id) 降序）。next_cursor 非空则可继续加载。

`changes_only` 只留下改了数据的记录。判据是 `entity` 字段——轨迹自动记录的每条都带，
手写埋点里改了东西的也带（见 app/audit.py）——而不是对动作名后缀的猜测：登录、连接测试、
工具调用这类只读记录数量上远多于真正的改动，会把后者淹掉。

## Query parameters

- `tenant_id` string, uuid, nullable
- `action` string, nullable
- `changes_only` boolean
- `date_from` string, nullable
- `date_to` string, nullable
- `limit` integer
- `offset` integer
- `cursor` string, nullable

## Response `200`

Successful Response

- AuditPage
  - `items` AuditOut[], required
    - `id` string, required
    - `tenant_id` string, nullable
    - `tenant_name` string, nullable
    - `actor_type` string, required
    - `actor_id` string, nullable
    - `action` string, required
    - `target` string, nullable
    - `meta` object, nullable
    - `created_at` string, date-time, required
    - `actor_label` string, nullable
    - `via` string, nullable
    - `entity` string, nullable
    - `entity_id` string, nullable
    - `before` object, nullable
    - `after` object, nullable
  - `next_cursor` string, nullable
  - `total` integer, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
