Export audit log entries as a CSV file for compliance, reporting, or offline analysis.
Exports audit log entries matching the specified filters as a downloadable CSV file. Supports the same filtering options as the query endpoint. Maximum 10,000 rows per export.
organization_id string required
The unique identifier of the organization.
entity_type string optional
Filter by entity type. Values: user, department, role, role_assignment, department_membership, permission, knowledge_slice, vector_store, knowledge_grant, knowledge_composite.
action_type string optional
Filter by action type. Values: created, updated, deleted, invited, deactivated, reactivated, removed, assigned, unassigned, reparented, membership_added, membership_removed, and more.
actor_id string optional
Filter by the user who performed the action.
target_id string optional
Filter by the target entity of the action.
department_id string optional
Filter by department context.
from_date string optional
Filter entries from this date (ISO 8601 format, e.g. 2025-01-01).
to_date string optional
Filter entries until this date (ISO 8601 format, e.g. 2025-12-31).
search_term string optional
Full-text search across entity name, actor name, and actor email.
Returns a CSV file as a streaming download. The CSV contains these columns:
| Column | Description |
|---|---|
| Timestamp | When the action occurred (ISO 8601) |
| Entity Type | Type of entity affected |
| Entity Name | Name of the entity |
| Action | Action performed |
| Actor Name | Name of the user who performed the action |
| Actor Email | Email of the user |
| Target Name | Name of the target (if applicable) |
| Previous Value | Value before the change (if applicable) |
| New Value | Value after the change (if applicable) |
The response has Content-Type: text/csv and Content-Disposition header with filename audit-log-{org_id}-{date}.csv.
- Bash
- Python
- Python
- JavaScript
curl -s -X GET "https://api.aitronos.com/v1/organizations/org_abc123/audit-log/export?from_date=2025-01-01&to_date=2025-12-31" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-o audit-log.csv