Skip to content

Export audit logs

GET
/api/v1/audit/export
curl --request GET \
--url 'http://localhost:3000/api/v1/audit/export?userId=550e8400-e29b-41d4-a716-446655440000&apiKeyId=550e8400-e29b-41d4-a716-446655440001&action=CREATE&action=UPDATE&entityType=Device&entityType=User&entityId=550e8400-e29b-41d4-a716-446655440002&success=true&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z&ipAddress=192.168.1.100&search=device-001&page=1&limit=50&cursor=eyJpZCI6IjEyMzQifQ%3D%3D&maxRecords=10000' \
--header 'X-API-Key: <X-API-Key>'

Exports audit logs to CSV format.

userId
string format: uuid
Example
550e8400-e29b-41d4-a716-446655440000

Filter by user ID

apiKeyId
string format: uuid
Example
550e8400-e29b-41d4-a716-446655440001

Filter by API key ID

action
Array<string>
Allowed values: CREATE READ UPDATE DELETE LOGIN LOGOUT LOGIN_FAILED PERMISSION_GRANTED PERMISSION_DENIED EXPORT IMPORT BULK_UPDATE BULK_DELETE PASSWORD_CHANGE API_KEY_CREATED API_KEY_REVOKED CERTIFICATE_ISSUED CERTIFICATE_REVOKED DEPLOYMENT_STARTED DEPLOYMENT_COMPLETED DEPLOYMENT_FAILED DEPLOYMENT_ROLLED_BACK DEVICE_ONBOARDING_REJECTED DEVICE_CAPABILITY_REPORT_REJECTED DEVICE_STATUS_REPORT_REJECTED DEVICE_DESIRED_STATE_FETCH_REJECTED DEVICE_ONBOARDING_REJECTED_SUMMARY
Example
[
"CREATE",
"UPDATE"
]

Filter by audit action type(s)

entityType
Array<string>
Example
[
"Device",
"User"
]

Filter by entity type(s)

entityId
string format: uuid
Example
550e8400-e29b-41d4-a716-446655440002

Filter by specific entity ID

success
boolean
Example
true

Filter by success status

startDate
string format: date-time
Example
2024-01-01T00:00:00Z

Filter logs from this date

endDate
string format: date-time
Example
2024-12-31T23:59:59Z

Filter logs until this date

ipAddress
string
Example
192.168.1.100

Filter by IP address

search
string
Example
device-001

Full-text search in entity name and error message

page
number
default: 1 >= 1
Example
1

Page number

limit
number
default: 50 >= 1 <= 100
Example
50

Number of results per page

cursor
string
Example
eyJpZCI6IjEyMzQifQ==

Cursor for cursor-based pagination

maxRecords
number
default: 10000 >= 1 <= 100000
Example
10000

Maximum records to export

CSV file with audit logs

Media type text/csv
string format: binary

Unauthorized

Forbidden — caller lacks required permission