Audit Logs API
Auris automatically records every administrative action, authentication event, and security-relevant operation in an immutable audit trail. The Audit Logs API provides read access to these logs and management of log streaming configurations that forward events to external observability platforms.
Audit logs are retained according to your plan’s retention policy. All log entries are immutable — they cannot be edited or deleted through the API.
All endpoints require the x-tenant header and a valid Bearer token.
Querying Logs
/api/audit-logsRequires: view:audit_logsList audit log entries with filtering and pagination. Results are returned in reverse chronological order (newest first). Supports filtering by action, user, resource type, severity level, date range, and free-text search.
Query parameters
Example request
GET /api/audit-logs?action=user.login&level=error&dateFrom=2025-02-01T00:00:00Z&limit=50Success response
{
"ok": true,
"data": {
"data": [
{
"id": "log_abc123",
"action": "user.login",
"userId": "usr_def456",
"resourceType": "session",
"resourceId": "sess_ghi789",
"details": {
"method": "password",
"success": false,
"reason": "invalid_credentials"
},
"level": "error",
"ipAddress": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
"createdAt": "2025-02-18T14:30:00Z"
},
{
"id": "log_jkl012",
"action": "role.update",
"userId": "usr_admin001",
"resourceType": "role",
"resourceId": "role_mno345",
"details": {
"before": { "name": "editor", "permissionsChanged": 3 },
"after": { "name": "editor", "permissionsChanged": 3, "permissions": ["view:invoices", "create:invoices", "edit:invoices"] }
},
"level": "info",
"ipAddress": "10.0.1.50",
"userAgent": "AurisConsole/1.0",
"createdAt": "2025-02-18T13:15:00Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1284,
"totalPages": 26
}
}
}Log Entry Shape
Every audit log entry has the following structure:
Common Action Types
The details field for mutation events (create, update, delete) typically includes before and after snapshots where applicable. For sensitive fields like passwords and secrets, only the fact that the field changed is recorded — not the actual values.
Log Streaming
Log streaming forwards audit events in real-time to external observability and SIEM platforms. When a log stream is configured and active, every audit event is sent to the configured destination in addition to being stored in the Auris database.
/api/log-streamsRequires: manage:log_streamsList all configured log streams for the tenant. Returns stream metadata, type, status, and last delivery time.
Success response
{
"ok": true,
"data": [
{
"id": "ls_abc123",
"name": "Production Datadog",
"type": "DATADOG",
"status": "active",
"config": {
"region": "us1",
"apiKey": "dd_api_***...***"
},
"lastDeliveryAt": "2025-02-18T14:29:55Z",
"createdAt": "2025-01-10T09:00:00Z"
},
{
"id": "ls_def456",
"name": "SIEM Webhook",
"type": "WEBHOOK",
"status": "active",
"config": {
"url": "https://siem.internal.acme.com/auris-logs",
"headers": { "X-Custom-Header": "value" }
},
"lastDeliveryAt": "2025-02-18T14:29:58Z",
"createdAt": "2025-02-01T11:30:00Z"
}
]
}/api/log-streamsRequires: manage:log_streamsCreate a new log stream. Each stream type requires a different configuration shape. Auris validates the configuration and optionally performs a test delivery before saving.
Stream Type: WEBHOOK
Sends each audit event as an HTTP POST to the specified URL. Supports custom headers for authentication.
Request body
{
"name": "SIEM Webhook",
"type": "WEBHOOK",
"config": {
"url": "https://siem.internal.acme.com/auris-logs",
"headers": {
"Authorization": "Bearer your-siem-token",
"X-Source": "auris"
}
}
}The webhook payload is the JSON audit log entry, sent with Content-Type: application/json.
Stream Type: S3
Batches audit events and uploads them as JSON files to an S3-compatible bucket.
Request body
{
"name": "S3 Archive",
"type": "S3",
"config": {
"bucket": "auris-audit-logs",
"region": "us-east-1",
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"prefix": "auris/tenant-name/"
}
}Files are uploaded with keys in the format: {prefix}YYYY/MM/DD/HH-mm-ss-{uuid}.json.
Stream Type: DATADOG
Sends audit events to the Datadog Log Management API.
Request body
{
"name": "Datadog Logs",
"type": "DATADOG",
"config": {
"apiKey": "dd_api_key_here",
"region": "us1",
"service": "auris-iam",
"source": "auris"
}
}Stream Type: SPLUNK
Sends audit events to Splunk via the HTTP Event Collector (HEC).
Request body
{
"name": "Splunk HEC",
"type": "SPLUNK",
"config": {
"hecUrl": "https://splunk.internal.acme.com:8088/services/collector/event",
"hecToken": "your-hec-token",
"index": "auris_audit",
"source": "auris-iam",
"sourcetype": "_json"
}
}Success response (all types)
{
"ok": true,
"data": {
"id": "ls_ghi789",
"name": "Datadog Logs",
"type": "DATADOG",
"status": "active",
"config": {
"region": "us1",
"apiKey": "dd_api_***...***",
"service": "auris-iam",
"source": "auris"
},
"createdAt": "2025-02-18T10:00:00Z"
}
}Sensitive fields in the config (API keys, secrets, tokens) are masked in GET responses. The full values are only used internally for delivery and are never exposed through the API after creation.
Error codes
/api/log-streams/[id]Requires: manage:log_streamsGet full details for a specific log stream, including its configuration (with secrets masked), status, and delivery statistics.
Success response
{
"ok": true,
"data": {
"id": "ls_abc123",
"name": "Production Datadog",
"type": "DATADOG",
"status": "active",
"config": {
"region": "us1",
"apiKey": "dd_api_***...***",
"service": "auris-iam",
"source": "auris"
},
"lastDeliveryAt": "2025-02-18T14:29:55Z",
"deliveryCount": 15420,
"errorCount": 3,
"lastError": null,
"createdAt": "2025-01-10T09:00:00Z",
"updatedAt": "2025-02-15T08:00:00Z"
}
}/api/log-streams/[id]Requires: manage:log_streamsUpdate a log stream’s name, configuration, or status. Use this to rotate API keys, change endpoints, or pause/resume streaming.
Request body — update config
{
"name": "Production Datadog (v2)",
"config": {
"apiKey": "new_dd_api_key_here"
}
}Request body — pause streaming
{
"status": "paused"
}Success response
{
"ok": true,
"data": {
"id": "ls_abc123",
"name": "Production Datadog (v2)",
"status": "active",
"updatedAt": "2025-02-18T11:00:00Z"
}
}Stream statuses:
/api/log-streams/[id]Requires: manage:log_streamsDelete a log stream. Delivery stops immediately. Historical audit logs are not affected — they remain in the Auris database regardless of streaming configuration.
Success response
{
"ok": true,
"data": { "deleted": true }
}Permissions Reference
Audit logs are append-only and immutable. There is no API endpoint to delete or modify log entries. This ensures the integrity of the audit trail for compliance purposes (SOC 2, ISO 27001, GDPR Article 30).
Webhook Delivery Format
For WEBHOOK-type log streams, each event is delivered as an HTTP POST with the following structure:
{
"event": "audit_log",
"timestamp": "2025-02-18T14:30:00Z",
"tenant": "acme-corp",
"data": {
"id": "log_abc123",
"action": "user.login",
"userId": "usr_def456",
"resourceType": "session",
"resourceId": "sess_ghi789",
"details": { "method": "password", "success": true },
"level": "info",
"ipAddress": "203.0.113.42",
"userAgent": "Mozilla/5.0...",
"createdAt": "2025-02-18T14:30:00Z"
}
}The webhook includes the headers configured in the log stream plus Content-Type: application/json and User-Agent: Auris-LogStream/1.0. Deliveries are retried up to 3 times with exponential backoff (5s, 30s, 120s) on non-2xx responses.
Related
- Log Streaming — Stream audit logs to external services like Datadog and Splunk
- Logs & Compliance — View and filter logs from the Console