Reference
Audit
Query audit logs and aggregate audit statistics.
Endpoint Map
| Method | Path | Auth | Purpose |
|---|---|---|---|
GET | /api/v1/audit/logs | JWT | Query audit logs |
GET | /api/v1/audit/logs/:id | JWT | Get one audit log |
GET | /api/v1/audit/stats | JWT + admin role | Get aggregate stats |
Query Logs
GET /api/v1/audit/logs?tool_name=slack_send_message&status=failed&limit=50&offset=0
Authorization: Bearer <jwt>Query Parameters
| Parameter | Description |
|---|---|
user_id | Filter by user ID (admins only; non-admin forced to self) |
tenant_id | Filter by tenant |
tool_name | Filter by tool |
status | pending confirmed rejected completed failed |
start_date / end_date | ISO date range |
limit / offset | Pagination |
Response envelope:
{
"data": [
{
"id": "...",
"userId": "usr_...",
"toolName": "slack_send_message",
"status": "failed"
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1
}
}Stats
GET /api/v1/audit/stats
Authorization: Bearer <admin-jwt>Returns { data: { total, byStatus, avgDuration } }.