Skip to main content

Webhook events revisited for DirectorySync!

We decided to improve our event payloads to make them easier to read and use.

Indeed, we noticed that events concerning groups were most of the time linked to additions or removals of users. This is why we decided to refocus these events on members. From now on all events you will receive about groups will contain the added_users & removed_users keys.

What's new?

Each time a user is added or removed from a group you will be notified. To avoid overloading the Payload we have decided to only include the ID of the added or deleted users, in some cases the email is also present (depending on the provider's request).

For other types of events (updating the group name for example) the payload will not change from what you already know.

Here are some examples that focus only on the "changes" key of events:

Members Removed

"changes": {
"added_users": [],
"removed_users": [
{
"email": "termi.nator@gmail.com",
"id": "225be929-51d6-4772-8fbd-a57930d4371d"
}
]
}

Members Removed with other field updated

"changes": {
"added_users": [],
"new_values": {
"external_id": "externalId2",
"updated_at": "2024-03-22T17:14:27"
},
"previous_values": {
"external_id": "externalId",
"updated_at": "2024-03-22T17:02:45"
},
"removed_users": [
{
"email": "termi.nator@gmail.com",
"id": "225be929-51d6-4772-8fbd-a57930d4371d"
}
]
}

Member is added:

"changes": {
"added_users": [
{
"id": "493c5c2a-33a0-4cd1-9888-fbc47a8c94d2"
}
],
"removed_users": []
}

New Events Code

In addition to this we are adding 4 new event codes which are as follows:

  • dir_sync.group.users_added.success (Success when adding a member)
  • dir_sync.group.users_added.fail (Failed to add a member)
  • dir_sync.group.users_removed.success (Success when deleting a member)
  • dir_sync.group.users_removed.fail (Failed to delete a member)

We hope these changes will help you when using Cryptr Webhooks!

See you next time for new exciting features.