Download OpenAPI specification:
All API requests must include an API key in the Authorization
header.
Example:
Authorization: trail_api_key_k2h63aeo5nh5jj5123
API keys can be created and managed in your Trailonix dashboard.
Unauthorized requests will return 401 Unauthorized
.
Please be sure that your API key has correct permissions for the API you are accessing.
Gets log events (read permission)
eventType | string Default: null Example: eventType=login_failed The type of log event. This is user defined. |
searchTerm | string Default: null Example: searchTerm=61 A search term to filter log events by. |
startDate | date Example: startDate=2025-01-01T00:00:00Z Start of the date range. (defaults to 90 days ago) |
endDate | date Example: endDate=2025-03-01T00:00:00Z end of the date range. (defaults to now) |
isAscending | boolean Default: false Example: isAscending=false If true, the results will be sorted in ascending order. If false, the results will be sorted in descending order. |
orderBy | string Default: "createdDate" Enum: "createdDate" "eventTypeName" "userId" "resource" "ipAddress" "userAgent" Example: orderBy=createdDate The field to order the results by. |
{- "events": [
- {
- "logEventId": "0196d57d-a124-7d30-8556-c6bcb4bd1c72",
- "tenantId": "01967f05-9f86-7a8d-b622-47613d3927c5",
- "userId": "61",
- "eventType": "login_failed",
- "resource": null,
- "metadata": {
- "username": "jdoe"
}, - "ipAddress": "127.0.0.1",
- "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/237.84.2.178 Safari/537.36",
- "createdDate": "2025-001-15T19:48:22.433808Z",
- "totalResults": 2
}
]
}
Submit a log single event (write permissions).
If the log event is invalid, you will receive a 400. A successful response always returns an empty unprocessed array.
Please do not submit sensitive data in the metadata such as passwords or credit card numbers. These are automatically scrubbed.
eventType required | string The type of log event. This is user defined. |
userId | string The ID of the user who performed the action. |
resource | string Default: null The resource affected by an action. |
metadata | object Default: null User defined metadata complex object. |
ipAddress | string Default: null The IP address of the request. |
userAgent | string Default: null The user agent of the request. |
createdDate | string <date-time> Default: "UTC NOW" The date and time the log event was created in UTC. |
{- "eventType": "user_updated",
- "userId": "123",
- "resource": "user:321",
- "metadata": {
- "before": {
- "firstName": "John",
- "lastName": "Doe",
- "phone": "1234567890"
},
}, - "ipAddress": null,
- "userAgent": null,
- "createdDate": "UTC NOW"
}
{- "unprocessed": [ ]
}
Submit an array of log events and returns unprocessed log events (write permission).
If the log event is invalid, you will receive an array of unprocessed log events including a failReason.
Please do not submit sensitive data in the metadata such as passwords or credit card numbers. These are automatically scrubbed.
eventType required | string The type of log event. This is user defined. |
userId | string The ID of the user who performed the action. |
resource | string Default: null The resource affected by an action. |
metadata | object Default: null User defined metadata complex object. |
ipAddress | string Default: null The IP address of the request. |
userAgent | string Default: null The user agent of the request. |
createdDate | string <date-time> Default: "UTC NOW" The date and time the log event was created in UTC. |
[- {
- "eventType": "user_updated",
- "userId": "123",
- "resource": "user:321",
- "metadata": {
- "before": {
- "firstName": "John",
- "lastName": "Doe",
- "phone": "1234567890"
},
}, - "ipAddress": "127.0.0.1",
- "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
- "createdDate": "2025-001-15T19:48:22.433808Z"
}, - {
- "eventType": "login_success",
- "userId": "123",
- "resource": "user:321",
- "metadata": {
- "username": "jdoe"
}, - "ipAddress": "127.0.0.1",
- "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
- "createdDate": "2025-001-15T19:49:02.258798Z"
}
]
{- "unprocessed": [ ]
}