New Ory Agent Security is now live! Claim your complimentary test drive. Get Started!

Skip to main content

Events

Ory Polis uses webhooks to notify your application any time changes are made to directory, users, groups, and memberships.

User Events​

We'll notify you of the following 3 events related to users. Each event will be sent to the webhook URL you've configured in the Directory Sync app.

user.created - New user has been assigned to the app.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "user.created",
"tenant": "ory",
"product": "polis",
"data": {
"id": "038e767b-9bc6-4dbd-975e-fbc38a8e7d82",
"first_name": "Deepak",
"last_name": "Prabhakara",
"email": "[email protected]",
"active": true,
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "[email protected]",
"name": {
"givenName": "Deepak",
"familyName": "Prabhakara"
},
"emails": [
{
"primary": true,
"value": "[email protected]",
"type": "work"
}
],
"title": "CEO",
"displayName": "Deepak Prabhakara",
"locale": "en-US",
"externalId": "00u1ldzzogFkXFmvT5d7",
"groups": [],
"active": true,
"id": "038e767b-9bc6-4dbd-975e-fbc38a8e7d82"
}
}
}

user.updated - A user's properties has been updated.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "user.updated",
"tenant": "ory",
"product": "polis",
"data": {
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"first_name": "Kiran",
"last_name": "Krishnan",
"email": "[email protected]",
"active": true,
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "[email protected]",
"name": {
"givenName": "Kiran",
"familyName": "Krishnan"
},
"emails": [
{
"primary": true,
"value": "[email protected]",
"type": "work"
}
],
"displayName": "Kiran Krishnan",
"addresses": [
{
"primary": true,
"region": "Kerala"
}
],
"locale": "en-US",
"externalId": "00u3e3cmpdDydXdzV5d7",
"active": true,
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"groups": []
}
}
}

user.deleted - A user has been removed from the Directory Provider.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "user.deleted",
"tenant": "ory",
"product": "polis",
"data": {
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"first_name": "Kiran",
"last_name": "Krishnan",
"email": "[email protected]",
"active": false,
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "[email protected]",
"name": {
"givenName": "Kiran",
"familyName": "Krishnan"
},
"emails": [
{
"primary": true,
"value": "[email protected]",
"type": "work"
}
],
"displayName": "Kiran Krishnan",
"addresses": [
{
"primary": true,
"region": "Kerala"
}
],
"locale": "en-US",
"externalId": "00u3e3cmpdDydXdzV5d7",
"active": false,
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"groups": []
}
}
}

Group Events​

We'll notify you of the following 5 events related to groups and memberships. Each event will be sent to the webhook URL you've configured in the Directory Sync app.

Memberships are not part of the group: raw.members in group.created and group.updated is always empty, even when the identity provider sent members with the group. Track membership with the group.user_added and group.user_removed events, or read the full membership with List group members.

group.created - New group has been added to the app.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "group.created",
"tenant": "ory",
"product": "polis",
"data": {
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6",
"name": "dev",
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"displayName": "dev",
"members": [],
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6"
}
}
}

group.updated - A group's properties has been updated.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "group.updated",
"tenant": "ory",
"product": "polis",
"data": {
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6",
"name": "developers",
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"displayName": "developers",
"members": [],
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6"
}
}
}

group.deleted - A group has been removed from the app.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "group.deleted",
"tenant": "ory",
"product": "polis",
"data": {
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6",
"name": "developers",
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"displayName": "developers",
"members": [],
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6"
}
}
}

group.user_added - A user has been added to a directory group.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "group.user_added",
"tenant": "ory",
"product": "polis",
"data": {
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"first_name": "Kiran",
"last_name": "Krishnan",
"email": "[email protected]",
"active": true,
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "[email protected]",
"name": {
"givenName": "Kiran",
"familyName": "Krishnan"
},
"emails": [
{
"primary": true,
"value": "[email protected]",
"type": "work"
}
],
"displayName": "Kiran Krishnan",
"addresses": [
{
"primary": true,
"region": "Kerala"
}
],
"locale": "en-US",
"externalId": "00u3e3cmpdDydXdzV5d7",
"active": true,
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"title": "Developer",
"groups": []
},
"group": {
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6",
"name": "developers",
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"displayName": "developers",
"members": [],
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6"
}
}
}
}

group.user_removed - A user has been removed from a directory group.

{
"directory_id": "58b5cd9dfaa39d47eb8f5f88631f9a629a232016",
"event": "group.user_removed",
"tenant": "ory",
"product": "polis",
"data": {
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"first_name": "Kiran",
"last_name": "Krishnan",
"email": "[email protected]",
"active": true,
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "[email protected]",
"name": {
"givenName": "Kiran",
"familyName": "Krishnan"
},
"emails": [
{
"primary": true,
"value": "[email protected]",
"type": "work"
}
],
"displayName": "Kiran Krishnan",
"addresses": [
{
"primary": true,
"region": "Kerala"
}
],
"locale": "en-US",
"externalId": "00u3e3cmpdDydXdzV5d7",
"active": true,
"id": "ebc31d6e-7d62-4f81-b9e5-eb5f1a04ee92",
"title": "Developer",
"groups": []
},
"group": {
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6",
"name": "developers",
"raw": {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
"displayName": "developers",
"members": [],
"id": "29e3adde-b4bb-45fc-bf65-2b44f29fd6f6"
}
}
}
}

Directory Events​

To configure the webhook, you have to set the following environment variables.

  • WEBHOOK_URL - The URL to which the webhook events will be sent.
  • WEBHOOK_SECRET - The secret key used to sign the webhook events.

We'll notify you of the following 4 events related to the directory connections. They are delivered on a best-effort basis, as SSO connection events are: a failed request is retried a few times, a few seconds apart, and then dropped; see Delivery. Unlike the user and group events with batching, they are not queued or retried later.

dsync.created - New connection has been created.

{
"event": "dsync.created",
"tenant": "ory",
"product": "demo",
"data": {
"id": "d8aa6c93-c960-4925-9b31-4a4d2ad3bb44",
"name": "Okta Directory",
"type": "okta-scim-v2"
}
}

dsync.deactivated - A connection has been deactivated.

{
"event": "dsync.deactivated",
"tenant": "ory",
"product": "demo",
"data": {
"id": "d8aa6c93-c960-4925-9b31-4a4d2ad3bb44",
"name": "Okta Directory",
"type": "okta-scim-v2"
}
}

dsync.activated - A connection has been activated.

{
"event": "dsync.activated",
"tenant": "ory",
"product": "demo",
"data": {
"id": "d8aa6c93-c960-4925-9b31-4a4d2ad3bb44",
"name": "Okta Directory",
"type": "okta-scim-v2"
}
}

dsync.deleted - A connection has been deleted.

{
"event": "dsync.deleted",
"tenant": "ory",
"product": "demo",
"data": {
"id": "d8aa6c93-c960-4925-9b31-4a4d2ad3bb44",
"name": "Okta Directory",
"type": "okta-scim-v2"
}
}

Frequently asked questions​

Provider-specific webhook behavior, including why Okta and Microsoft Entra ID never send a user.deleted event, is covered in the directory sync FAQ.