List
Get audit logs
client.v1.auditLogs.list(AuditLogListParamsquery?, RequestOptionsoptions?): CursorPage<idstringrequestRequesttimestampstringactionstringactorActordescriptionstringresource_idstringresource_typestringstatusunionAuditLogListResponse>
get/v1/auditLogs
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.
Parameters
queryending_beforestringlimitnumbernext_pagestringresource_idstringresource_typestringsortunionstarting_onstringAuditLogListParams
Returns
AuditLogListResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
// Automatically fetches more pages as needed.
for await (const auditLogListResponse of client.v1.auditLogs.list()) {
console.log(auditLogListResponse.id);
}
200 Example
{
"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"
}