Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Directory events

Explore webhook events related to directory operations in Scalekit, including user and group creation, updates, and deletions.

This page documents the webhook events Scalekit sends when an organization’s directory, its users or its groups change.

Table of contents


Event envelope

Every directory event has the same top-level fields. The event-specific fields are in data. Keys can arrive in any order, so parse the body as JSON rather than matching it as text.

FieldTypeDescription
spec_versionstringWebhook payload version. Currently "1"
idstringUnique event ID, prefixed with evt_. Use it to ignore duplicate deliveries
typestringEvent type, such as organization.directory.user_created
occurred_atstringWhen the event occurred, in RFC 3339 format
environment_idstringEnvironment the event belongs to
organization_idstringOrganization the directory belongs to
objectstringDirectory, DirectoryUser or DirectoryGroup
dataobjectThe directory, user or group. See each event below

Directory connection events

organization.directory_created

Sent when a directory is created for an organization. A SCIM or LDAP directory is enabled on creation, so organization.directory_enabled follows. A POLL directory is created disabled and sends only this event. data has four fields only.

organization.directory_created
{
"spec_version": "1",
"id": "evt_55136848686612000",
"type": "organization.directory_created",
"occurred_at": "2025-01-15T08:55:22.702860294Z",
"environment_id": "env_27758032200925221",
"organization_id": "org_55135410258444802",
"object": "Directory",
"data": {
"directory_type": "SCIM",
"id": "dir_55135622825771522",
"organization_id": "org_55135410258444802",
"provider": "OKTA"
}
}
FieldTypeDescription
idstringDirectory ID, prefixed with dir_
organization_idstringOrganization that owns the directory
directory_typestringHow the directory syncs, such as SCIM
providerstringDirectory provider, such as OKTA

organization.directory_enabled

Sent when directory sync is enabled for an organization.

organization.directory_enabled
{
"spec_version": "1",
"id": "evt_55136848686613000",
"type": "organization.directory_enabled",
"occurred_at": "2025-01-15T08:55:22.802860294Z",
"environment_id": "env_27758032200925221",
"organization_id": "org_55135410258444802",
"object": "Directory",
"data": {
"directory_type": "SCIM",
"enabled": true,
"id": "dir_55135622825771522",
"organization_id": "org_55135410258444802",
"provider": "OKTA",
"updated_at": "2025-01-15T08:55:22.792993454Z"
}
}
FieldTypeDescription
idstringDirectory ID, prefixed with dir_
organization_idstringOrganization that owns the directory
directory_typestringHow the directory syncs, such as SCIM
providerstringDirectory provider, such as OKTA
enabledbooleanAlways true on this event
updated_atstringWhen the directory was last updated

organization.directory_disabled

Sent when directory sync is disabled for an organization. data has four fields only.

organization.directory_disabled
{
"spec_version": "1",
"id": "evt_53891640779079756",
"type": "organization.directory_disabled",
"occurred_at": "2025-01-06T18:45:21.057814Z",
"environment_id": "env_53814739859406915",
"organization_id": "org_53879494091473415",
"object": "Directory",
"data": {
"directory_type": "SCIM",
"id": "dir_53879621145330183",
"organization_id": "org_53879494091473415",
"provider": "OKTA"
}
}
FieldTypeDescription
idstringDirectory ID, prefixed with dir_
organization_idstringOrganization that owns the directory
directory_typestringHow the directory syncs, such as SCIM
providerstringDirectory provider, such as OKTA

organization.directory_deleted

Sent when a directory is deleted. Deleting a directory through the API or dashboard requires disabling it first. Deleting an organization also deletes its directories, enabled or not, and sends this event for each. data has four fields only.

organization.directory_deleted
{
"spec_version": "1",
"id": "evt_53891640779079900",
"type": "organization.directory_deleted",
"occurred_at": "2025-01-06T18:50:02.118243Z",
"environment_id": "env_53814739859406915",
"organization_id": "org_53879494091473415",
"object": "Directory",
"data": {
"directory_type": "SCIM",
"id": "dir_53879621145330183",
"organization_id": "org_53879494091473415",
"provider": "OKTA"
}
}
FieldTypeDescription
idstringDirectory ID, prefixed with dir_
organization_idstringOrganization that owns the directory
directory_typestringHow the directory syncs, such as SCIM
providerstringDirectory provider, such as OKTA

Directory user events

All three user events send the same user object in data.

  • organization.directory.user_created is sent when the directory provider creates an active user, or reactivates a deactivated user.
  • organization.directory.user_updated is sent when an active user’s attributes change, or when the user is added to or removed from a group.
  • organization.directory.user_deleted is sent when an active user is deactivated or deleted in the directory provider. data carries the last known user record. active is false when the user was deactivated.

Changes to a user who is already inactive send no event.

Directory user fields

The first seven fields are always sent. roles is computed by Scalekit and is sent on every user event when your environment has roles. The rest are sent only when the directory provider supplies them.

FieldTypeDescription
idstringDirectory user ID, prefixed with diruser_
organization_idstringOrganization the user belongs to
activebooleanWhether the user is active in the directory provider
preferred_usernamestringThe user’s userName from the provider. Empty string if not set
dp_idstringThe user’s externalId from the provider. Empty string if not set
emailstring or nullPrimary email address. null if the provider marks no email as primary
groupsarray or nullGroups the user belongs to, each with id and name. null if the user is in no groups
namestringDisplay name
given_namestringGiven (first) name
family_namestringFamily (last) name
nicknamestringNickname
picturestringProfile picture URL
phone_numberstringWork phone number
addressobjectThe user’s SCIM address of type work: street_address, locality, state (from SCIM region), postal_code, country and formatted
profilestringProfile URL
localestringLocale
zoneinfostringTime zone
languagestringPreferred language
titlestringJob title
user_typestringUser type
employee_idstringEmployee number from the SCIM enterprise extension
cost_centerstringCost center from the enterprise extension
organizationstringOrganization from the enterprise extension
divisionstringDivision from the enterprise extension
departmentstringDepartment from the enterprise extension
managerobjectThe user’s manager, with id, email and user_name, when the manager is also in the directory
rolesarrayScalekit roles assigned through group-based role assignment, each with role_name. An empty array when no role applies
dp_rolesarray or nullRoles as sent by the provider, each with display, primary, type and value. null if the provider sends an empty list
entitlementsarray or nullEntitlements as sent by the provider, each with display, primary, type and value. null if the provider sends an empty list
custom_attributesobjectCustom attributes you mapped for this directory, plus home_phone_number and mobile_phone_number when the provider sends them
raw_attributesobjectThe SCIM user resource as received from the provider

organization.directory.user_created

organization.directory.user_created
{
"spec_version": "1",
"id": "evt_53891546994442316",
"type": "organization.directory.user_created",
"occurred_at": "2025-01-06T18:44:25.153954Z",
"environment_id": "env_53814739859406915",
"organization_id": "org_53879494091473415",
"object": "DirectoryUser",
"data": {
"active": true,
"custom_attributes": {
"mobile_phone_number": "+1-555-0101"
},
"department": "Engineering",
"dp_id": "00u1a2b3c4d5e6f7g8h9",
"email": "john.doe@acmecorp.com",
"employee_id": "E1234",
"family_name": "Doe",
"given_name": "John",
"groups": [
{
"id": "dirgroup_53891546960887900",
"name": "Engineering"
}
],
"id": "diruser_53891546960887884",
"locale": "en-US",
"name": "John Doe",
"organization_id": "org_53879494091473415",
"phone_number": "+1-555-0100",
"preferred_username": "john.doe@acmecorp.com",
"raw_attributes": {
"active": true,
"externalId": "00u1a2b3c4d5e6f7g8h9",
"userName": "john.doe@acmecorp.com"
},
"roles": [
{
"role_name": "billing_admin"
}
],
"title": "Software Engineer",
"zoneinfo": "America/New_York"
}
}

organization.directory.user_updated

organization.directory.user_updated
{
"spec_version": "1",
"id": "evt_53891546994442317",
"type": "organization.directory.user_updated",
"occurred_at": "2025-01-06T18:44:25.153954Z",
"environment_id": "env_53814739859406915",
"organization_id": "org_53879494091473415",
"object": "DirectoryUser",
"data": {
"active": true,
"custom_attributes": {
"mobile_phone_number": "+1-555-0101"
},
"department": "Engineering",
"dp_id": "00u1a2b3c4d5e6f7g8h9",
"email": "john.doe@acmecorp.com",
"employee_id": "E1234",
"family_name": "Doe",
"given_name": "John",
"groups": [
{
"id": "dirgroup_53891546960887900",
"name": "Engineering"
}
],
"id": "diruser_53891546960887884",
"locale": "en-US",
"name": "John Doe",
"organization_id": "org_53879494091473415",
"phone_number": "+1-555-0100",
"preferred_username": "john.doe@acmecorp.com",
"raw_attributes": {
"active": true,
"externalId": "00u1a2b3c4d5e6f7g8h9",
"userName": "john.doe@acmecorp.com"
},
"roles": [
{
"role_name": "billing_admin"
}
],
"title": "Senior Software Engineer",
"zoneinfo": "America/New_York"
}
}

organization.directory.user_deleted

This example is a deactivated user, so active is false.

organization.directory.user_deleted
{
"spec_version": "1",
"id": "evt_53891546994442318",
"type": "organization.directory.user_deleted",
"occurred_at": "2025-01-06T18:44:25.153954Z",
"environment_id": "env_53814739859406915",
"organization_id": "org_53879494091473415",
"object": "DirectoryUser",
"data": {
"active": false,
"custom_attributes": {
"mobile_phone_number": "+1-555-0101"
},
"department": "Engineering",
"dp_id": "00u1a2b3c4d5e6f7g8h9",
"email": "john.doe@acmecorp.com",
"employee_id": "E1234",
"family_name": "Doe",
"given_name": "John",
"groups": [
{
"id": "dirgroup_53891546960887900",
"name": "Engineering"
}
],
"id": "diruser_53891546960887884",
"locale": "en-US",
"name": "John Doe",
"organization_id": "org_53879494091473415",
"phone_number": "+1-555-0100",
"preferred_username": "john.doe@acmecorp.com",
"raw_attributes": {
"active": false,
"externalId": "00u1a2b3c4d5e6f7g8h9",
"userName": "john.doe@acmecorp.com"
},
"roles": [
{
"role_name": "billing_admin"
}
],
"title": "Software Engineer",
"zoneinfo": "America/New_York"
}
}

Directory group events

All three group events send the same group object in data. Every key is sent, even when its value is null.

FieldTypeDescription
idstringDirectory group ID, prefixed with dirgroup_
organization_idstringOrganization the group belongs to
directory_idstringDirectory the group belongs to
display_namestringGroup display name
dp_idstring or nullThe group’s externalId from the provider. null if the provider doesn’t send one
raw_attributesobject or nullThe SCIM group resource as received from the provider

organization.directory.group_created

organization.directory.group_created
{
"spec_version": "1",
"id": "evt_38862741515010639",
"type": "organization.directory.group_created",
"occurred_at": "2024-09-25T02:26:39.036398577Z",
"environment_id": "env_32080745237316098",
"organization_id": "org_38609339635728478",
"object": "DirectoryGroup",
"data": {
"directory_id": "dir_38610496391217780",
"display_name": "Engineering",
"dp_id": "00g1a2b3c4d5e6f7g8h9",
"id": "dirgroup_38862741498233423",
"organization_id": "org_38609339635728478",
"raw_attributes": {
"displayName": "Engineering",
"externalId": "00g1a2b3c4d5e6f7g8h9"
}
}
}

organization.directory.group_updated

organization.directory.group_updated
{
"spec_version": "1",
"id": "evt_38864948910162368",
"type": "organization.directory.group_updated",
"occurred_at": "2024-09-25T02:48:34.745030921Z",
"environment_id": "env_32080745237316098",
"organization_id": "org_38609339635728478",
"object": "DirectoryGroup",
"data": {
"directory_id": "dir_38610496391217780",
"display_name": "Platform Engineering",
"dp_id": "00g1a2b3c4d5e6f7g8h9",
"id": "dirgroup_38862741498233423",
"organization_id": "org_38609339635728478",
"raw_attributes": {
"displayName": "Platform Engineering",
"externalId": "00g1a2b3c4d5e6f7g8h9"
}
}
}

organization.directory.group_deleted

organization.directory.group_deleted
{
"spec_version": "1",
"id": "evt_40650399597723966",
"type": "organization.directory.group_deleted",
"occurred_at": "2024-10-07T10:25:26.289331747Z",
"environment_id": "env_12205603854221623",
"organization_id": "org_39802449573184223",
"object": "DirectoryGroup",
"data": {
"directory_id": "dir_39802485862301855",
"display_name": "Admins",
"dp_id": "7c66a173-79c6-4270-ac78-8f35a8121e0a",
"id": "dirgroup_40072007005503806",
"organization_id": "org_39802449573184223",
"raw_attributes": {}
}
}