Skip to main content

Audit Logs

GET /orgs/{orgId}/api/v1/admin/audit-logs
GET /orgs/{orgId}/api/v1/admin/audit-logs/{logId}
GET /orgs/{orgId}/api/v1/admin/audit-logs/stats
GET /orgs/{orgId}/api/v1/admin/audit-logs/actions
GET /orgs/{orgId}/api/v1/admin/audit-logs/export
GET /orgs/{orgId}/api/v1/admin/audit-logs/retention
PUT /orgs/{orgId}/api/v1/admin/audit-logs/retention

The audit log provides an immutable, tamper-evident record of all actions performed within a organization — by users, administrators, agents, and the LumoAuth platform itself.

Authentication

All audit log endpoints require a valid admin API key or a Bearer token issued to a user with settings.manage permission.

Audit Log Entry Object

Audit Log Entry
{
"id": "01JF3KAUDIT...",
"orgId": "acme-corp",
"eventType": "user.login",
"action": "login",
"severity": "info",
"actorId": "01JF3KUSER...",
"actorType": "user",
"actorEmail": "alice@example.com",
"targetId": "01JF3KUSER...",
"targetType": "user",
"ipAddress": "203.0.113.1",
"userAgent": "Mozilla/5.0 ...",
"result": "success",
"metadata": {
"mfaMethod": "totp",
"clientId": "my-app"
},
"createdAt": "2026-03-01T08:00:00Z"
}

List Audit Logs

List Audit Logs
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs?startDate=2026-03-01T00:00:00Z&limit=50" \
-H "Authorization: ApiKey lmk_abc123"

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerResults per page (default: 20, max: 100)
searchstringFull-text search across log fields
userId or actorIdstringFilter by actor (user/agent/admin)
targetIdstringFilter by target resource
resourceType or targetTypestringFilter by target resource type
actionstringFilter by action (e.g. login)
severitystringFilter by severity (info, warning, error)
resultstringsuccess or failure
startDate or fromISO 8601Start of date range
endDate or toISO 8601End of date range
ipAddressstringFilter by source IP address
List Response
{
"data": {
"data": [
{
"id": "01JF3KAUDIT...",
"eventType": "user.login",
"actorEmail": "alice@example.com",
"ipAddress": "203.0.113.1",
"result": "success",
"createdAt": "2026-03-01T08:00:00Z"
}
],
"meta": { "total": 2847, "page": 1, "limit": 50, "totalPages": 57 }
}
}

Get Single Log Entry

Get a Single Log Entry
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/01JF3KAUDIT..." \
-H "Authorization: ApiKey lmk_abc123"

Audit Log Statistics

Get Statistics
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/stats" \
-H "Authorization: ApiKey lmk_abc123"

Query Parameters for Stats

ParameterDescription
groupByGroup by action or user
startDate / fromStart of time window
endDate / toEnd of time window

List Available Actions

Returns a distinct list of all action types present in the audit log for the organization.

List Available Actions
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/actions" \
-H "Authorization: ApiKey lmk_abc123"
Actions Response
{
"data": {
"data": ["login", "logout", "user.created", "token.issued", "password.changed"]
}
}

Export Audit Logs

Export is synchronous for small datasets (returns 200) or queued for large exports (returns 202).

Export as CSV
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/export?format=csv&startDate=2026-01-01T00:00:00Z&endDate=2026-03-31T23:59:59Z" \
-H "Authorization: ApiKey lmk_abc123" \
-o audit-logs-q1-2026.csv
Export as JSON
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/export?format=json&startDate=2026-01-01T00:00:00Z&endDate=2026-03-31T23:59:59Z" \
-H "Authorization: ApiKey lmk_abc123" \
-o audit-logs-q1-2026.json

Export Parameters

ParameterValuesDefault
formatcsv, jsoncsv
startDate / fromISO 8601
endDate / toISO 8601

Exports are limited to 10,000 records per request.

Retention Settings

Get Retention Settings

Get Retention Settings
curl "https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/retention" \
-H "Authorization: ApiKey lmk_abc123"
Retention Response
{
"data": {
"data": {
"retentionDays": 90,
"autoDelete": true
}
}
}

Update Retention Settings

Update Retention Settings
curl -X PUT https://app.lumoauth.dev/orgs/acme-corp/api/v1/admin/audit-logs/retention \
-H "Authorization: ApiKey lmk_abc123" \
-H "Content-Type: application/json" \
-d '{
"retentionDays": 365,
"autoDelete": true
}'

Common Event Types

EventDescription
user.loginSuccessful user authentication
user.login_failedFailed authentication attempt
user.logoutUser signed out
user.createdNew user provisioned
user.updatedUser profile updated
user.deletedUser deleted
user.blockedUser account blocked
user.password_changedPassword changed
user.mfa_enabledMFA enabled for user
token.issuedOAuth token issued
token.revokedOAuth token revoked
client.createdOAuth client registered
admin.actionAdministrative action by organization admin
super_admin.accessSuper admin accessed this organization
role.assignedRole granted to user
consent.grantedUser granted OAuth scope consent
warning

super_admin.access entries are automatically written whenever a platform super admin accesses or modifies organization data, providing a complete record of privileged access.