Get audit log by ID
const url = 'http://localhost:3000/api/v1/audit/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/audit/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'X-API-Key: <X-API-Key>'Retrieves a specific audit log entry.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Audit log UUID
Responses
Section titled “ Responses ”Audit log retrieved successfully
object
Unique audit log identifier
Organization ID
User ID who performed the action
Display name of the user at the time of the action. Captured at write time so audit entries remain readable after the user is deleted.
API key ID used for the action
Display name of the API key at the time of the action.
Type of action performed
Entity type that was affected
ID of the affected entity
Human-readable name of the affected entity
State of the entity before the change
object
State of the entity after the change
object
List of fields that were changed
IP address of the client
User agent of the client
Request correlation ID
Session ID
Whether the action was successful
Error message if action failed
Additional metadata
object
When the audit log was created
Example
{ "id": "550e8400-e29b-41d4-a716-446655440000", "organizationId": "550e8400-e29b-41d4-a716-446655440001", "userId": "550e8400-e29b-41d4-a716-446655440002", "userName": "Alice Admin", "apiKeyId": "550e8400-e29b-41d4-a716-446655440003", "apiKeyName": "ci-publisher", "action": "CREATE", "entityType": "Device", "entityId": "550e8400-e29b-41d4-a716-446655440004", "entityName": "Production Gateway 1", "beforeState": { "status": "OFFLINE", "name": "Old Name" }, "afterState": { "status": "ONLINE", "name": "New Name" }, "changedFields": [ "status", "name" ], "ipAddress": "192.168.1.100", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", "requestId": "req-123456", "sessionId": "sess-789012", "success": true, "errorMessage": "Permission denied", "metadata": { "source": "api", "version": "1.0" }, "createdAt": "2024-01-15T10:30:00Z"}Unauthorized
Forbidden — caller lacks required permission
Audit log not found