Audit Logs

Overview

The Audit Logs API provides a comprehensive tracking system for monitoring and retrieving historical changes made to various resources within the system. It captures detailed information about who made changes when they occurred, and what specific modifications were made.

Request Parameters

ParameterTypeRequiredDescription
fromTimestampLongYesStart time in Unix milliseconds (epoch)
toTimestampLongYesEnd time in Unix milliseconds (epoch)
pageIntegerYesPage number (0-based indexing)
sizeIntegerYesNumber of records per page (default: 10)
... with more specific params

Response Structure

Response Fields

FieldTypeDescription
listArrayArray of audit log entries
totalRecordsIntegerTotal number of records matching the query
totalPagesIntegerTotal number of pages available

Audit Log Entry Fields

FieldTypeDescription
requestTimestampLongTimestamp of the action in Unix milliseconds
initiatorTenantNameStringName of the tenant initiating the action
principalTypeStringType of principal ("API_KEY" or "USER")
principalIdStringAPI key ID (for API_KEY) or user ID (for USER)
principalNameStringAPI key ID (for API_KEY) or email address (for USER)
ipAddressStringIP address of the requester
userAgentStringUser agent string of the requester
auditableActionStringType of action performed (e.g., "ASSIGN", "UNASSIGN")
auditableResourceStringType of resource modified (e.g., "TRIGGER_VARIABLE", "SCHEME")
resourceNameStringName of the specific resource
additionalMetadataStringJSON string containing additional context
previousStateStringJSON string of the previous state
newStateStringJSON string of the new state

Additional Metadata Structure

The additionalMetadata field is a JSON string containing:

{
    "tenantName": "string",
    "endpointId": "long",
    "deviceSerialNumber": "string",
    "triggerCategoryName": "string",
    "targetLevel": "string",
    "targetLevelName": "string"
}

Example Response

{
    "list": [
        {
            "requestTimestamp": 1733315569000,
            "initiatorTenantName": "ExampleTenant",
            "principalType": "API_KEY",
            "principalId": "api-key-123",
            "principalName": "api-key-123",
            "ipAddress": "192.168.1.1",
            "userAgent": "Mozilla/5.0...",
            "auditableAction": "ASSIGN",
            "auditableResource": "TRIGGER_VARIABLE",
            "resourceName": "TriggerVariableA",
            "additionalMetadata": "{\"tenantName\":\"tenant name\",\"endpointId\":1,\"deviceSerialNumber\":\"something\",\"triggerCategoryName\":\"Tailgating\",\"targetLevel\":\"ENDPOINT\",\"targetLevelName\":\"1\"}",
            "previousState": "{\"value\":\"1.5\"}",
            "newState": "{\"value\":\"1.0\"}"
        }
    ],
    "totalRecords": 322,
    "totalPages": 161
}

Pagination

  • Use page parameter to specify the page number (0-based)
  • Use size parameter to specify the number of records per page
  • Total number of records and pages are included in the response
  • Calculate total pages: ⌈totalRecords ÷ size⌉