Audit Log Reference
Every mutating request against ScaiGrid is recorded in the audit log. This reference describes how to query and export it.
Required permission: admin:access (for tenant audit), accounting:view_partner (for partner-wide), super admin (for platform-wide).
What's recorded#
For every POST/PUT/PATCH/DELETE request (with a few exceptions like audit queries themselves, OAI-compat inference, and health checks):
- Actor identity (user ID, email, partner, tenant)
- Actor type (
user/service/webhook) - Action (
model.create,user.update,budget.delete, etc.) - Resource type and ID
- IP address and User-Agent
- Status (
SUCCESS/FAILURE) - Timestamp
- Request ID (for correlating with application logs)
Read requests are not logged by default to avoid log explosion. Module-specific audit can be enabled for sensitive reads via module config.
GET /v1/audit-log#
Query the audit log.
Query params:
| Param | Description |
|---|---|
start |
ISO 8601 timestamp |
end |
ISO 8601 timestamp |
action |
Filter by action string (e.g., user.create) |
actor_id |
Filter by actor |
resource_type |
user, model, backend, budget, etc. |
resource_id |
Specific resource |
status |
SUCCESS / FAILURE |
ip_address |
Filter by IP |
limit |
Page size (default 100, max 1000) |
cursor |
Pagination cursor |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
Per default, tenant admins see only their tenant's audit events. Partner admins see all tenants under their partner. Super admins see the platform-wide log.
GET /v1/audit-log/export#
Export audit trail to CSV, JSON, or NDJSON.
Query params: same filters as /audit-log, plus format.
1 2 3 | |
For large exports (> 100K events), use narrower time windows. Streams the entire result.
Common action patterns#
1 | |
Examples:
model.create,model.update,model.deleteuser.create,user.update,user.delete,user.role_updateapi_key.create,api_key.deletebudget.create,budget.update,budget.deletewebhook.create,webhook.update,webhook.deletetenant.create,tenant.suspend,tenant.unsuspend- Module events:
scaibot.bot.create,scaicore.core.deploy, etc.
Unusual patterns:
auth.login— successful user loginauth.logout— explicit logoutmcp.tool.invoke— MCP tool invocationscailink.capability.invoke— ScaiLink tool invocation
Retention#
Default retention is 365 days. Configurable per tenant (minimum 90 days for compliance).
Expired events are permanently deleted. Export before deletion if you need longer retention.
Error codes#
| Code | Meaning |
|---|---|
AUTHZ_PERMISSION_DENIED |
Caller lacks admin:access or higher |
VALIDATION_ERROR |
Invalid query parameters |
Related#
- Webhooks — subscribe to audit-level events
- Authentication Reference — login/logout events
- Users and Access — user management actions