WorkOS

Run a workflow on WorkOS events — a user is created, an SSO connection is activated, a directory sync adds someone to a group. The event becomes the workflow's input, so you can provision access, sync your own systems, or alert on identity changes.

For behavior shared by every provider (the delivery URL, testing), see the webhook triggers reference.

Prerequisites

WorkOS webhooks are auto-registered: Cotera creates the webhook endpoint for you over WorkOS's API. You supply a WorkOS API Key (sk_live_...) on the trigger's setup page (see WorkOS's webhooks docs). Without it, install fails with workos_credentials_missing.

Setup

  1. Add a From an app trigger and pick WorkOS, and enter your WorkOS API key.
  2. Choose the event (see below).
  3. Save. Cotera creates a WorkOS webhook endpoint enabled for that event, pointed at the trigger's unique URL.

Deleting the trigger removes the endpoint from WorkOS.

Events

The event key is the WorkOS event string.

Event keyFires when
user.createdA user is created
user.updatedA user is updated
user.deletedA user is deleted
organization.createdAn organization is created
organization.updatedAn organization is updated
organization.deletedAn organization is deleted
organization_membership.createdA user joins an organization
organization_membership.deletedA user leaves an organization
connection.activatedAn SSO connection is activated
connection.deactivatedAn SSO connection is deactivated
dsync.user.createdA directory sync user is created
dsync.user.deletedA directory sync user is deleted
dsync.group.user_addedA user is added to a directory group
dsync.group.user_removedA user is removed from a directory group
session.createdA user authentication session is created

Payload

The WorkOS event envelope is passed through as the workflow input; the affected resource is at data. A user.created delivery looks like:

{
  "object": "event",
  "id": "evt_01EXAMPLE0000000000000000",
  "event": "user.created",
  "data": {
    "object": "user",
    "id": "user_01EXAMPLE0000000000000000",
    "email": "jane@example.com",
    "first_name": "Jane",
    "last_name": "Doe"
  },
  "created_at": "2023-07-15T10:30:00.000Z"
}
FieldDescription
idThe WorkOS event id, used to deduplicate retries.
eventThe event type — matches the trigger's selected event.
dataThe affected resource; data.object names its type (user, organization, connection, directory_user, and so on).
created_atWhen the event happened.

Signature verification

WorkOS signs each delivery with the WorkOS-Signature header in the form t=<timestamp>, v1=<hex> — an HMAC-SHA256, in hexadecimal, over <timestamp>.<raw-body>. The signing secret is generated by WorkOS when the endpoint is created, so there's no per-trigger secret for you to manage. Cotera verifies it on every delivery and rejects anything that fails.