Skip to content

Audit Log Endpoints

Audit logs provide an immutable, time-series record of every action performed within your VeraID organization. Logs are stored in TimescaleDB hypertables with automatic time-based partitioning for efficient querying across large time ranges.

Audit Log Fields

Every audit log entry contains the following fields:

FieldTypeDescription
idstringUnique identifier for the log entry
actorTypestringType of actor: USER, IDENTITY, SYSTEM
actorIdstringIdentifier of the actor
actorNamestringDisplay name of the actor
actionstringThe action that was performed
resourceTypestringType of resource affected (e.g., identity, credential, policy)
resourceIdstringIdentifier of the affected resource
outcomestringResult of the action: SUCCESS, FAILURE, DENIED
ipAddressstringSource IP address of the request
userAgentstringUser agent string of the client
metadataobjectAdditional context specific to the action
timestampstringISO 8601 timestamp of when the action occurred

Query Audit Logs

Retrieve audit logs with filters for actor, action, resource, outcome, and time range.

GET /api/v1/audit-logs

Query Parameters

ParameterTypeDescription
actorTypestringFilter by actor type: USER, IDENTITY, SYSTEM
actorIdstringFilter by specific actor ID
actionstringFilter by action (e.g., identity.created, credential.used)
resourceTypestringFilter by resource type (e.g., identity, credential, policy)
outcomestringFilter by outcome: SUCCESS, FAILURE, DENIED
startDatestringStart of time range (ISO 8601)
endDatestringEnd of time range (ISO 8601)
pagenumberPage number (default: 1)
limitnumberItems per page (default: 20, max: 100)

Example Request

Terminal window
curl -X GET "https://app.veraid.io/api/v1/audit-logs?actorType=IDENTITY&action=credential.used&outcome=SUCCESS&startDate=2026-03-18T00:00:00Z&endDate=2026-03-19T23:59:59Z&limit=50" \
-H "Authorization: Bearer kd_live_abc123..."

Example Response

{
"data": [
{
"id": "log_abc123",
"actorType": "IDENTITY",
"actorId": "id_xyz789",
"actorName": "aws-deploy-prod",
"action": "credential.used",
"resourceType": "credential",
"resourceId": "cred_def456",
"outcome": "SUCCESS",
"ipAddress": "10.0.1.50",
"userAgent": "veraid-sdk/1.2.0",
"metadata": {
"scopes": ["secrets.read"],
"endpoint": "/api/v1/secrets/db-url",
"credentialName": "Production API Key"
},
"timestamp": "2026-03-19T09:15:00Z"
},
{
"id": "log_def456",
"actorType": "IDENTITY",
"actorId": "id_ci_001",
"actorName": "github-deploy-myapp",
"action": "credential.used",
"resourceType": "credential",
"resourceId": "cred_ghi789",
"outcome": "SUCCESS",
"ipAddress": "140.82.112.0",
"userAgent": "veraid-secrets-action/1.0.0",
"metadata": {
"scopes": ["secrets.read", "deploy.execute"],
"endpoint": "/api/v1/secrets/deploy-token",
"credentialName": "GitHub Actions Key",
"pipelineId": "run-12345",
"commitSha": "a1b2c3d"
},
"timestamp": "2026-03-19T08:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1847,
"totalPages": 37,
"hasMore": true
}
}

Filtering by Denied Access

To find all denied access attempts:

Terminal window
curl -X GET "https://app.veraid.io/api/v1/audit-logs?outcome=DENIED&startDate=2026-03-01T00:00:00Z" \
-H "Authorization: Bearer kd_live_abc123..."
{
"data": [
{
"id": "log_denied001",
"actorType": "IDENTITY",
"actorId": "id_unknown",
"actorName": "legacy-service-v1",
"action": "secret.read",
"resourceType": "secret",
"resourceId": "secret_prod_db",
"outcome": "DENIED",
"ipAddress": "203.0.113.42",
"userAgent": "curl/8.1.2",
"metadata": {
"reason": "Policy denied: IP address not in allowed range",
"matchedPolicy": "pol_abc123",
"policyName": "Production Secrets - Office IPs Only"
},
"timestamp": "2026-03-15T22:45:00Z"
}
]
}

Filtering by System Actions

System-initiated actions include automated credential rotations, scheduled syncs, and anomaly detection triggers:

Terminal window
curl -X GET "https://app.veraid.io/api/v1/audit-logs?actorType=SYSTEM&limit=10" \
-H "Authorization: Bearer kd_live_abc123..."
{
"data": [
{
"id": "log_sys001",
"actorType": "SYSTEM",
"actorId": "system",
"actorName": "VeraID System",
"action": "credential.rotated",
"resourceType": "credential",
"resourceId": "cred_rotate001",
"outcome": "SUCCESS",
"ipAddress": "internal",
"userAgent": "veraid-scheduler/1.0",
"metadata": {
"identityName": "gcp-analytics-prod",
"rotationPolicy": "90-day auto-rotation",
"gracePeriodHours": 24,
"previousKeyAge": "91 days"
},
"timestamp": "2026-03-19T02:00:00Z"
}
]
}

Export Audit Logs

Export audit logs in bulk for compliance reporting, archival, or analysis in external tools.

GET /api/v1/audit-logs/export

Query Parameters

ParameterTypeRequiredDescription
formatstringYesExport format: csv or json
startDatestringYesStart of time range (ISO 8601)
endDatestringYesEnd of time range (ISO 8601)

Example Request

Terminal window
curl -X GET "https://app.veraid.io/api/v1/audit-logs/export?format=json&startDate=2026-03-01T00:00:00Z&endDate=2026-03-19T23:59:59Z" \
-H "Authorization: Bearer kd_live_abc123..." \
-o audit-logs-march.json

CSV Export

Terminal window
curl -X GET "https://app.veraid.io/api/v1/audit-logs/export?format=csv&startDate=2026-03-01T00:00:00Z&endDate=2026-03-19T23:59:59Z" \
-H "Authorization: Bearer kd_live_abc123..." \
-o audit-logs-march.csv

The CSV export includes the following columns:

id,timestamp,actorType,actorId,actorName,action,resourceType,resourceId,outcome,ipAddress,userAgent

The metadata field is serialized as a JSON string in the CSV output.


Common Actions

Reference of common action values used in audit log entries:

Identity Actions

ActionDescription
identity.createdA new identity was created
identity.updatedAn identity’s configuration was modified
identity.suspendedAn identity was suspended
identity.activatedA suspended identity was reactivated
identity.deletedAn identity was permanently deleted

Credential Actions

ActionDescription
credential.createdA new credential was issued
credential.usedA credential was used to authenticate
credential.rotatedA credential was rotated (new secret generated)
credential.expiredA credential reached its expiration date
credential.revokedA credential was manually revoked

Policy Actions

ActionDescription
policy.createdA new policy was created
policy.updatedA policy was modified
policy.deletedA policy was deleted
policy.evaluatedA policy was evaluated for an access decision
policy.violatedAn access attempt violated a policy

System Actions

ActionDescription
sync.startedA directory or cloud provider sync started
sync.completedA sync operation completed
sync.failedA sync operation failed
alert.triggeredA new alert was generated
alert.resolvedAn alert was resolved

Retention

Audit logs are retained for the duration specified by your organization’s plan:

PlanRetention Period
Starter90 days
Professional1 year
Enterprise7 years (or custom)

Exported logs are not subject to retention limits. Export regularly to maintain a complete archive if your plan’s retention period is shorter than your compliance requirements.