# ดูกิจกรรมในบัญชี

Source: https://checkslip.com/docs/list-audit-events

GET `https://api.checkslip.com/api/audit/events`

ใช้ API key

แสดงสิ่งที่เกิดขึ้นในบัญชี ใหม่สุดก่อน เช่น ออกหรือเพิกถอน API key, เชิญหรือถอดสมาชิกออกจากทีม, เปลี่ยนบทบาท · แต่ละรายการบอกว่าใครทำ (actor_type), ทำผ่านช่องทางไหน (channel), ทำกับอะไร (target_type, target_id), ค่าก่อนและหลัง และผล SUCCESS (สำเร็จ), FAILURE (ไม่สำเร็จ) หรือ DENIED (ถูกปฏิเสธ) · กรอง action ด้วยชื่อเต็ม หรือลงท้ายด้วย .* เพื่อดูทั้งกลุ่ม เช่น api_key.* · ค่าเริ่มต้นคือ 24 ชั่วโมงล่าสุด ดูได้ครั้งละไม่เกิน 31 วัน ใช้ next_cursor เพื่อดูหน้าถัดไป ไม่มียอดรวม · ไม่หักเครดิต · ใช้ API key ที่มีสิทธิ์ audit:read หรือเข้าสู่ระบบบนเว็บแอป

## Parameters

| ฟิลด์ | ส่งทาง | ชนิด | จำเป็น |
| --- | --- | --- | --- |
| `from` | query | `string (date-time)` | ไม่ |
| `to` | query | `string (date-time)` | ไม่ |
| `action` | query | `string` | ไม่ |
| `actor_type` | query | `USER \| API_KEY \| ASSISTANT \| STAFF \| SYSTEM` | ไม่ |
| `actor_id` | query | `string (uuid)` | ไม่ |
| `channel` | query | `API \| DASHBOARD \| ASSISTANT \| STAFF \| SYSTEM` | ไม่ |
| `target_type` | query | `string` | ไม่ |
| `target_id` | query | `string` | ไม่ |
| `cursor` | query | `string` | ไม่ |
| `limit` | query | `integer` | ไม่ |

## Responses

### 200 `application/json`

| ฟิลด์ | ชนิด | จำเป็น |
| --- | --- | --- |
| `items` | `AuditEventRecord[]` | ใช่ |
| `items[].event_id` | `string (uuid)` | ใช่ |
| `items[].category` | `MONEY \| ACCESS \| DATA_CHANGE \| SENSITIVE_READ \| SECURITY` | ใช่ |
| `items[].outcome` | `SUCCESS \| FAILURE \| DENIED` | ใช่ |
| `items[].occurred_at` | `string (date-time)` | ใช่ |
| `items[].request_id` | `string (uuid) \| null` | ไม่ |
| `items[].actor` | `object` | ใช่ |
| `items[].actor.type` | `USER \| API_KEY \| ASSISTANT \| STAFF \| SYSTEM` | ใช่ |
| `items[].actor.id` | `string (uuid) \| null` | ไม่ |
| `items[].actor.on_behalf_of_user_id` | `string (uuid) \| null` | ไม่ |
| `items[].channel` | `API \| DASHBOARD \| ASSISTANT \| STAFF \| SYSTEM` | ใช่ |
| `items[].action` | `string` | ใช่ |
| `items[].target` | `object` | ใช่ |
| `items[].target.type` | `string` | ใช่ |
| `items[].target.id` | `string` | ใช่ |
| `items[].before` | `object \| null` | ไม่ |
| `items[].after` | `object \| null` | ไม่ |
| `items[].reason` | `string \| null` | ไม่ |
| `items[].undo_of_event_id` | `string (uuid) \| null` | ไม่ |
| `next_cursor` | `string \| null` | ใช่ |

### Error ที่อาจได้

400 401 403 429

error ในรูป Problem Details ดูรหัสทั้งหมดที่ [รหัสข้อผิดพลาด](https://checkslip.com/docs/errors)

**cURL**

```bash
curl https://api.checkslip.com/api/audit/events \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY"
```

**Node.js**

```javascript
const res = await fetch("https://api.checkslip.com/api/audit/events", {
  headers: {
    Authorization: `Bearer ${process.env.CHECKSLIP_API_KEY}`,
  },
});
const data = await res.json();
```

**Python**

```python
import os

import requests

res = requests.get(
    "https://api.checkslip.com/api/audit/events",
    headers={
        "Authorization": f"Bearer {os.environ['CHECKSLIP_API_KEY']}",
    },
)
data = res.json()
```

```json
{
  "items": [
    {
      "event_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4",
      "category": "MONEY",
      "outcome": "SUCCESS",
      "occurred_at": "2026-11-05T09:30:00+07:00",
      "request_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4",
      "actor": {
        "type": "USER",
        "id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4",
        "on_behalf_of_user_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4"
      },
      "channel": "API",
      "action": "api_key.created",
      "target": {
        "type": "string",
        "id": "string"
      },
      "before": {},
      "after": {},
      "reason": "string",
      "undo_of_event_id": "0b6c2f5e-8a41-4d1e-9c3a-5f7e2d18a6b4"
    }
  ],
  "next_cursor": "string"
}
```
