Documentation Index Fetch the complete documentation index at: https://mintlify.com/workos/workos-node/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Events API allows you to retrieve events that have occurred in your WorkOS environment. Events represent actions and state changes across all WorkOS services.
Methods
listEvents
Retrieves a list of events based on the provided filter criteria.
Configuration options for listing events Array of event names to filter by
ISO 8601 datetime string for the start of the event range
ISO 8601 datetime string for the end of the event range
Maximum number of events to return (default: 10)
Cursor for pagination to fetch the next page of results
Filter events by a specific organization ID
A paginated list of events Pagination metadata including before and after cursors
Example
import { WorkOS } from '@workos-inc/node' ;
const workos = new WorkOS ( 'sk_example_123456789' );
const events = await workos . events . listEvents ({
events: [ 'user.created' , 'user.updated' ],
rangeStart: '2024-01-01T00:00:00Z' ,
rangeEnd: '2024-12-31T23:59:59Z' ,
limit: 20 ,
organizationId: 'org_01H8Z9Q2Z3Y4X5W6V7U8T9S0R1' ,
});
console . log ( events . data );
Response
{
"data" : [
{
"id" : "event_01H8Z9Q2Z3Y4X5W6V7U8T9S0R1" ,
"event" : "user.created" ,
"data" : {
"id" : "user_01H8Z9Q2Z3Y4X5W6V7U8T9S0R1" ,
"email" : "user@example.com"
},
"createdAt" : "2024-01-15T10:30:00Z"
}
],
"listMetadata" : {
"after" : "event_01H8Z9Q2Z3Y4X5W6V7U8T9S0R1" ,
"before" : null
}
}
Webhooks Configure webhooks to receive events in real-time
Audit Logs Track security and compliance events