Compliance - Audit Events
Query the audit event log for your tenants. Results are ordered by most recent first and use cursor-based pagination.
List Audit Events
Return a paginated list of audit events visible to the caller.
Endpoint
GET /v1/compliance/events
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Number of results to return (1–1000, default: 50). |
cursor |
string | No | Opaque pagination cursor returned by a previous response. |
start |
string | No | ISO 8601 start timestamp (inclusive), e.g. 2026-01-01T00:00:00Z. |
end |
string | No | ISO 8601 end timestamp (inclusive), e.g. 2026-12-31T23:59:59Z. |
event_type |
string | No | Filter by event type string (e.g. auth.login_success). See GET /v1/compliance/event-types for valid values. |
search |
string | No | Case-insensitive text search by actor email or resource name. |
tenant_id |
string | No | Filter to a specific tenant (e.g. tenant_abc123). |
Example Query
curl 'https://ai.hatz.ai/v1/compliance/events?limit=25&tenant_id=tenant_abc123&event_type=auth.login_success' \
-H 'X-API-Key: $HATZ_API_KEY'
Response
{
"data": [
{
"id": "a1b2c3d4-0000-0000-0000-000000000001",
"event_type": "auth.login_success",
"created_at": "2026-05-15T10:32:00+00:00",
"tenant": {
"id": "tenant_abc123",
"name": "Acme Corporation"
},
"actor": {
"id": "user_xyz789",
"email": "john.doe@acme.com"
},
"target": null,
"metadata": null
},
{
"id": "a1b2c3d4-0000-0000-0000-000000000002",
"event_type": "api_key.created",
"created_at": "2026-05-15T09:18:00+00:00",
"tenant": {
"id": "tenant_abc123",
"name": "Acme Corporation"
},
"actor": {
"id": "user_xyz789",
"email": "john.doe@acme.com"
},
"target": {
"resource_type": "api_key",
"resource_id": "key_def456"
},
"metadata": null
}
],
"pagination": {
"has_more": true,
"next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0xNVQwOToxODowMCswMDowMCIsImlkIjoiYTFiMmMzZDQtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAyIn0="
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
data |
array | List of audit event objects. |
data[].id |
string | Unique event UUID. |
data[].event_type |
string | Event type identifier (see GET /v1/compliance/event-types). |
data[].created_at |
string | UTC ISO 8601 timestamp of when the event occurred. |
data[].tenant |
object|null | Tenant snapshot at event time: id and name. |
data[].actor |
object | Identity of the user who triggered the event: id (external user ID) and email. |
data[].target |
object|null | The resource affected by the event, if applicable. Shape varies by event_type. |
data[].metadata |
object|null | Additional context for the event. Shape varies by event_type. |
pagination.has_more |
boolean | true if additional results exist beyond this page. |
pagination.next_cursor |
string|null | Pass this value as cursor on the next request to retrieve the next page. null when there are no more results. |
Pagination
This endpoint uses cursor-based pagination. To retrieve subsequent pages, pass the next_cursor value from the previous response as the cursor query parameter. Cursors are opaque — do not parse or construct them manually.
curl 'https://ai.hatz.ai/v1/compliance/events?limit=25&cursor=eyJjcmVhdGVkX2F0IjoiMjAyNi0wNS0xNVQwOToxODowMCswMDowMCIsImlkIjoiYTFiMmMzZDQtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAyIn0=' \
-H 'X-API-Key: $HATZ_API_KEY'