import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const auditEvent = await client.auditEvents.retrieve('audit-event-id');
console.log(auditEvent.actor);{
"auditEventId": "<string>",
"actor": {
"id": "<string>",
"email": "<string>"
},
"target": "<string>",
"source": "<string>",
"timestamp": "<string>",
"type": "<string>"
}Fetch a specific audit event by ID.
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const auditEvent = await client.auditEvents.retrieve('audit-event-id');
console.log(auditEvent.actor);{
"auditEventId": "<string>",
"actor": {
"id": "<string>",
"email": "<string>"
},
"target": "<string>",
"source": "<string>",
"timestamp": "<string>",
"type": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
A unique identifier associated with the audit event you wish to retrieve