Events
Respond to activity that occurs within WorkOS and third-party providers.
Events represent activity that has occurred within WorkOS or within third-party identity and directory providers. Your app can sync the data via either the events API or webhooks.
Event object
All event objects share a similar structure.
| Attribute | Description |
|---|---|
event | A string that distinguishes the event type. |
id | Unique identifier for the event. |
data | Event payload. Payloads match the corresponding API objects. |
created_at | Timestamp of when the event occurred. |
context | An optional object of extra information relevant to the event. |
Events emitted when API keys are created, updated, or revoked.
Triggered when an API key is created.
Triggered when an API key is revoked.
Triggered when an API key expiration is set, changed, or cleared.
Each step in the authentication flow emits an authentication event. Authentication success events are emitted even when additional steps, such as MFA, are required to complete the process.
Triggered when a user fails to verify their email.
Triggered when a user successfully verifies their email.
Triggered when a user fails to authenticate via Magic Auth.
Triggered when a user successfully authenticates via Magic Auth.
Triggered when a user fails to authenticate with a multi-factor authentication code.
Triggered when a user successfully authenticates with a multi-factor authentication code.
Triggered when a user fails to authenticate via OAuth.
Triggered when a user successfully authenticates via OAuth.
Triggered when a user fails to authenticate with password credentials.
Triggered when a user successfully authenticates with password credentials.
Triggered when a user fails to authenticate with a passkey.
Triggered when a user successfully authenticates with a passkey.
Triggered when a user fails to authenticate with Single Sign-On.
Triggered when a user successfully authenticates with Single Sign-On.
Triggered when an authentication succeeds but is flagged by Radar. For example, the authentication may have succeeded at passing a Radar challenge.
Events emitted when Single Sign-On connections are activated, deactivated, or deleted. Also emitted when a SAML certificate is renewed for the connection.
Payload data corresponds to the Connection
object.
Triggered when a connection is activated.
Payload data corresponds to the Connection
object.
Triggered when a connection is deactivated.
Payload data corresponds to the Connection
object.
Triggered when a connection is deleted. The state attribute indicates
connection state before deletion.
The certificate_type can be one of ResponseSigning, RequestSigning,
or ResponseEncryption.
Triggered when a SAML certificate is renewed either in the Dashboard or Admin Portal.
The certificate_type can be one of ResponseSigning, RequestSigning,
or ResponseEncryption.
Triggered when a SAML certificate is expiring (multiple events are sent out as it approaches expiry), or expired (once every 7 days after expiry).
Events emitted when directory-related resources are changed. To learn what exactly each of these events represents, see the in-depth Directory Sync events guide.
Payload data is based on the
Directory object, but the domain
property is replaced with a domains array of Organization
Domain.
Triggered when a directory is activated.
Payload data is based on the
Directory object, except the
domain property is omitted.
Triggered when a directory is
deleted.
The state attribute indicates directory state before deletion.
Payload data corresponds to the Directory
Group object.
Triggered when a directory group is created.
Payload data corresponds to the Directory
Group object.
Triggered when a directory group is deleted.
Payload data corresponds to the Directory
Group object.
Triggered when a directory group is updated.
Payload data contains a user which corresponds to the Directory
User object and a group which
corresponds to the Directory
Group object. The groups
field is omitted from the user object to avoid performance issues in
large directories.
Triggered when a directory group user is added.
Payload data contains a user which corresponds to the Directory
User object and a group which
corresponds to the Directory
Group object. The groups
field is omitted from the user object to avoid performance issues in
large directories.
Triggered when a directory group user is removed.
Payload data corresponds to the Directory
User object. The groups field
is omitted to avoid performance issues in large directories.
Triggered when a directory user is created.
Payload data corresponds to the Directory
User object. The groups field
is omitted to avoid performance issues in large directories.
Triggered when a directory user is
deleted.
The state attribute indicates directory user state at time of deletion.
Payload data corresponds to the Directory
User object. The groups field
is omitted to avoid performance issues in large directories.
Triggered when a directory user is updated.
Events emitted when a user is required to verify their email.
Payload data corresponds to the Email
verification object with the code omitted.
Triggered when a user is required to verify their email and a code is created.
Events emitted when WorkOS feature flags are created, updated, deleted, or their rules are updated.
Payload data corresponds to the Feature Flag
object.
Triggered when a feature flag is created.
Payload data corresponds to the Feature Flag
object.
Triggered when a feature flag is updated.
Payload data corresponds to the Feature Flag
object.
Triggered when a feature flag is deleted.
Payload data corresponds to the Feature Flag
object.
Triggered when a feature flag’s rules are modified.
Events emitted when groups are created, updated, deleted, or their members change.
Payload data corresponds to the Group object.
Triggered when a group is created.
Payload data corresponds to the Group object.
Triggered when a group is updated.
Payload data corresponds to the Group object.
Triggered when a group is deleted.
Payload data contains the group_id and organization_membership_id of
the added member.
Triggered when an organization membership is added to a group.
Payload data contains the group_id and organization_membership_id of
the removed member.
Triggered when an organization membership is removed from a group.
Events emitted when an AuthKit user is invited to join an organization.
Payload data corresponds to the
Invitation object with the token and
accept_invitation_url omitted.
Triggered when a user accepts an invitation.
Payload data corresponds to the
Invitation object with the token and
accept_invitation_url omitted.
Triggered when a user is invited to sign up or to join an organization.
Payload data corresponds to the
Invitation object with the token and
accept_invitation_url omitted.
Triggered when an invitation is resent.
Payload data corresponds to the
Invitation object with the token and
accept_invitation_url omitted.
Triggered when an invitation is revoked.
Events emitted when a user requests a Magic Auth code.
Payload data corresponds to the Magic
Auth object with the code omitted.
Triggered when a user initiates Magic Auth and an authentication code is created.
Events emitted when WorkOS organizations are created, updated, or deleted.
Payload data corresponds to the Organization
object.
Triggered when an organization is created.
Payload data corresponds to the Organization
object.
Triggered when an organization is updated.
Payload data corresponds to the Organization
object.
Triggered when an organization is deleted
Events emitted when organization domains are created, updated, deleted, or their verification status changes.
Payload data corresponds to the Organization
Domain object.
Triggered when an organization domain is created.
Payload data corresponds to the Organization
Domain object.
Triggered when an organization domain is updated.
Payload data corresponds to the Organization
Domain object.
Triggered when an organization domain is deleted.
Payload data corresponds to the Organization
Domain object.
Triggered when an organization domain is verified.
Payload data contains a reason and an organization_domain which
corresponds to the Organization Domain
object.
Triggered when an organization domain verification fails.
Events emitted when an AuthKit user joins or leaves an organization.
Payload data corresponds to the Organization
Membership object.
Triggered when an organization membership is created.
Payload data corresponds to the Organization
Membership object.
Triggered when an organization membership is deleted.
Payload data corresponds to the Organization
Membership object.
Triggered when an organization membership is updated.
Events emitted when custom roles are created, updated, or deleted.
Payload data corresponds to the custom role object.
Triggered when a custom role is created.
Payload data corresponds to the custom role object.
Triggered when a custom role is deleted.
Payload data corresponds to the custom role object.
Triggered when a custom role is updated.
Events emitted when a user requests to reset their password.
Payload data corresponds to the Organization
Membership object with the token
omitted.
Triggered when a user requests to reset their password.
Payload data corresponds to the Password
Reset object with the token omitted.
Triggered when a user successfully resets their password.
Events emitted when permissions are created, updated, or deleted.
Payload data corresponds to the permission object.
Triggered when a permission is created.
Payload data corresponds to the permission object.
Triggered when a permission is deleted.
Payload data corresponds to the permission object.
Triggered when a permission is updated.
Events emitted when a Pipes connected account is connected, disconnected, or requires reauthorization.
Triggered when a connected account completes authorization.
Triggered when a connected account is disconnected.
Triggered when a connected account needs to be reauthorized.
Events emitted when environment roles are created, updated, or deleted.
Triggered when a role is created.
Triggered when a role is deleted.
Triggered when a role’s permissions are updated.
Events emitted when AuthKit sessions are created.
Triggered when a session is created. Sessions started using
impersonation will include an additional
impersonator field with data about the impersonator.
Triggered when an issued session is revoked for a user.
Events emitted when AuthKit users are created, updated, or deleted.
Payload data corresponds to the User object.
Triggered when a user is created.
Payload data corresponds to the User object.
Triggered when a user is deleted.
Payload data corresponds to the User object.
Triggered when a user is updated.
Events emitted when Vault data, keys, or metadata are accessed or modified.
Triggered when a bring-your-own-key (BYOK) configuration is deleted from an organization.
Triggered when bring-your-own-key (BYOK) verification completes for an organization.
Triggered when a new encrypted object is stored in Vault.
Triggered when an encrypted object is deleted from Vault.
Triggered when an encrypted object is read from Vault.
Triggered when an existing encrypted object is updated in Vault.
Triggered when a data encryption key (DEK) is decrypted.
Triggered when one or more data encryption keys (DEKs) are read.
Triggered when a new key encryption key (KEK) is created.
Triggered when metadata for a Vault store is read.
Triggered when the list of Vault store names is retrieved.