List
Get audit logs
Retrieves a range of audit logs. If no further audit logs are currently available, the data array will be empty. As new audit logs are created, subsequent requests using the same next_page value will be in the returned data array, ensuring a continuous and uninterrupted reading of audit logs.
Query Parameters
RFC 3339 timestamp (exclusive). Cannot be used with 'next_page'.
Max number of results that should be returned
Cursor that indicates where the next page of results should start.
Optional parameter that can be used to filter which audit logs are returned. If you specify resource_id, you must also specify resource_type.
Optional parameter that can be used to filter which audit logs are returned. If you specify resource_type, you must also specify resource_id.
Sort order by timestamp, e.g. date_asc or date_desc. Defaults to date_asc.
RFC 3339 timestamp of the earliest audit log to return. Cannot be used with 'next_page'.
Returns
The next_page parameter is always returned to support ongoing log retrieval. It enables continuous querying, even when some requests return no new data. Save the next_page token from each response and use it for future requests to ensure no logs are missed. This setup is ideal for regular updates via automated processes, like cron jobs, to fetch logs continuously as they become available. When you receive an empty data array, it indicates a temporary absence of new logs, but subsequent requests might return new data.
curl https://api.metronome.com/v1/auditLogs \
-H "Authorization: Bearer $METRONOME_BEARER_TOKEN"
{
"data": [
{
"id": "id",
"request": {
"id": "id",
"ip": "ip",
"user_agent": "user_agent"
},
"timestamp": "2019-12-27T18:11:19.117Z",
"action": "action",
"actor": {
"id": "id",
"name": "name",
"email": "email"
},
"description": "description",
"resource_id": "resource_id",
"resource_type": "resource_type",
"status": "success"
}
],
"next_page": "next_page"
}