Skip to main content

Audit Logs

Ithbat IAM logs every significant event — authentication attempts, admin actions, permission changes, SCIM syncs, and API calls — to an immutable audit log. The audit log is your primary tool for security investigations, compliance audits, and incident response.


What gets logged

Every log entry captures who did what, to which resource, from where, and when.

Authentication events

Event typeDescription
auth.loginSuccessful user authentication
auth.login_failedFailed authentication attempt
auth.logoutUser logout
auth.mfa_verifiedMFA challenge successfully completed
auth.mfa_failedFailed MFA challenge
auth.password_resetPassword reset completed
auth.email_verifiedEmail address verified
auth.session_revokedSession explicitly revoked
auth.account_lockedAccount locked after repeated failures
auth.saml_loginAuthentication via SAML
auth.social_loginAuthentication via social provider
auth.passwordless_loginAuthentication via magic link or OTP

User lifecycle events

Event typeDescription
user.createdUser account created
user.updatedUser profile updated
user.deletedUser account deleted
user.suspendedUser suspended
user.reactivatedSuspended user reactivated
user.unlockedLocked account manually unlocked
user.password_changedUser changed their own password
user.mfa_enabledUser enabled MFA
user.mfa_disabledUser disabled MFA

Role and permission events

Event typeDescription
role.createdNew role created
role.updatedRole permissions modified
role.deletedRole deleted
role.assignedRole assigned to a user
role.revokedRole removed from a user

Invitation events

Event typeDescription
invitation.createdInvitation sent
invitation.acceptedInvitation accepted and account set up
invitation.revokedInvitation revoked
invitation.expiredInvitation expired without being accepted

Tenant and settings events

Event typeDescription
tenant.createdNew tenant registered
tenant.updatedTenant settings updated
tenant.suspendedTenant suspended
tenant.reactivatedTenant reactivated
settings.updatedTenant settings changed
saml.config_createdSAML connection configured
saml.config_updatedSAML connection updated
saml.config_deletedSAML connection deleted
scim.token_createdSCIM token generated
scim.token_revokedSCIM token revoked

Provisioning events

Event typeDescription
scim.user_syncedUser created or updated via SCIM
scim.user_deprovisionedUser deactivated via SCIM
scim.group_syncedGroup created or updated via SCIM
directory.sync_startedDirectory sync job started
directory.sync_completedDirectory sync job completed
directory.sync_failedDirectory sync job failed

API and system events

Event typeDescription
api.key_createdAPI key created
api.key_revokedAPI key revoked
webhook.createdWebhook endpoint created
webhook.deletedWebhook endpoint deleted

Log entry format

Every log entry has the same structure:

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tenantId": "c2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f70",
"eventType": "auth.login",
"actorId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"actorEmail": "[email protected]",
"actorType": "user",
"targetId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"targetType": "user",
"ipAddress": "41.208.100.5",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
"location": "Riyadh, SA",
"success": true,
"metadata": {
"authMethod": "password",
"mfaUsed": true
},
"createdAt": "2026-02-24T10:00:00Z"
}
FieldDescription
idUnique log entry ID
tenantIdThe tenant this event belongs to
eventTypeThe event type string
actorIdID of the user or system that performed the action
actorEmailEmail of the actor at the time of the event
actorTypeuser, admin, system, or scim
targetIdID of the resource the action was performed on
targetTypeResource type (user, role, tenant, etc.)
ipAddressClient IP address
userAgentBrowser/client user agent string
locationApproximate geographic location from IP
successWhether the action succeeded
metadataEvent-specific additional data
createdAtTimestamp (UTC, ISO 8601)

Viewing audit logs in the admin console

  1. Go to Audit Logs in the admin sidebar.
  2. Use the filter bar to narrow results:
    • Event type: Select one or more event types.
    • User: Filter by actor email or user ID.
    • Date range: Select a start and end date.
    • IP address: Filter by source IP.
    • Status: Filter by success or failure.
  3. Click any row to view the full log entry, including metadata.

Querying audit logs via API

List events

GET /api/v1/audit/events
Authorization: Bearer {token}
X-Tenant-ID: {tenant_id}

Supports the following query parameters:

ParameterTypeDescription
eventTypestringFilter by event type, e.g. auth.login
actorIdUUIDFilter by actor user ID
actorEmailstringFilter by actor email (partial match)
targetIdUUIDFilter by target resource ID
successbooltrue or false
fromISO 8601Start of date range
toISO 8601End of date range
ipAddressstringFilter by IP address
pageintPage number (default: 1)
limitintResults per page (default: 50, max: 200)

Example — failed login attempts in the last 24 hours:

GET /api/v1/audit/events?eventType=auth.login_failed&success=false&from=2026-02-23T10:00:00Z
Authorization: Bearer {token}
X-Tenant-ID: {tenant_id}

Get a single event

GET /api/v1/audit/events/{id}
Authorization: Bearer {token}

Login history

GET /api/v1/audit/logins
Authorization: Bearer {token}
X-Tenant-ID: {tenant_id}

Audit statistics

GET /api/v1/audit/stats
Authorization: Bearer {token}
X-Tenant-ID: {tenant_id}

Returns counts of events by type and by day for the last 30 days.

Activity for a specific user

GET /api/v1/audit/users/{userId}/activity
Authorization: Bearer {token}

Login history for a specific user

GET /api/v1/audit/users/{userId}/logins
Authorization: Bearer {token}

History for a specific resource

Retrieve all events that affected a given resource:

GET /api/v1/audit/resources/{type}/{id}/history
Authorization: Bearer {token}

Example — all events on a specific user account:

GET /api/v1/audit/resources/user/3fa85f64-.../history
Authorization: Bearer {token}

My own activity (self-service)

Users can view their own activity without admin permissions:

GET /api/v1/audit/me/activity
Authorization: Bearer {user_token}
GET /api/v1/audit/me/logins
Authorization: Bearer {user_token}

Filtering by event category

You can filter on partial event type prefixes to get all events in a category:

To get all...Use eventType filter
Authentication eventsauth.*
User lifecycle eventsuser.*
Role eventsrole.*
SAML eventssaml.*
SCIM eventsscim.*

Exporting audit data

Export events for offline analysis, archiving, or SIEM ingestion.

Via admin console

  1. Go to Audit Logs.
  2. Apply filters for the date range and event types you want.
  3. Click Export → JSON or Export → CSV.

Via API

POST /api/v1/logs/export
Authorization: Bearer {token}
X-Tenant-ID: {tenant_id}
Content-Type: application/json

{
"format": "json",
"from": "2026-01-01T00:00:00Z",
"to": "2026-01-31T23:59:59Z",
"eventTypes": ["auth.login", "auth.login_failed", "user.created", "user.deleted"]
}

Export is asynchronous. Poll the job endpoint for completion:

GET /api/v1/jobs/{jobId}/status
Authorization: Bearer {token}

Streaming logs

For real-time ingestion into a SIEM (Splunk, Datadog, Elastic), stream logs via:

  1. Webhooks — subscribe to the event types you need. Ithbat POSTs each event to your endpoint in real time. See Webhooks.
  2. Log streaming API — poll or stream:
GET /api/v1/logs/stream
Authorization: Bearer {token}
X-Tenant-ID: {tenant_id}

Retention policy

PlanDefault retentionMaximum
Starter30 days30 days
Growth90 days90 days
Enterprise1 yearCustom (up to 7 years)

Logs are immutable — they cannot be modified or deleted before their retention period expires.


Audit log API reference

MethodEndpointPermission
GET/api/v1/audit/eventsaudit:read
GET/api/v1/audit/events/{id}audit:read
GET/api/v1/audit/loginsaudit:read
GET/api/v1/audit/statsaudit:read
GET/api/v1/audit/users/{userId}/activityaudit:read
GET/api/v1/audit/users/{userId}/loginsaudit:read
GET/api/v1/audit/resources/{type}/{id}/historyaudit:read
GET/api/v1/audit/me/activityAuthenticated user
GET/api/v1/audit/me/loginsAuthenticated user
POST/api/v1/logs/exportlog:read
GET/api/v1/logs/streamlog:read

Next steps