Skip to main content

Webhooks

Webhooks can be sent in multiple forms, including HTTP requests and Slack-compatible messages. This document describes HTTP webhook usage.

Introduction

Webhooks are sent as HTTP POST requests containing JSON formatted data. The purpose is to let the receiver know that an event of certain type occurred, and they might react to this in some way. A webhook call is performed in response to specific actions, such as the creation or modification of an user account.

The Trigger

A webhook request is sent in response to a change in the system. For example, the creation or modification of an user account.

User eventType code
User account was createdUSER_CREATE
User account was modifiedUSER_EDIT
User account was deletedUSER_DELETE
User's last activity time changedUSER_ACTIVITY_UPDATED
User's email address was verifiedUSER_EMAIL_VERIFIED
User's LegalInfo data was updatedUSER_LEGALINFO_CHANGE
User's mobile number was verifiedUSER_MOBILE_VERIFIED
User's address data was modifiedUSER_ADDRESS_CHANGE
User's consent data was updatedUSER_CONSENT_UPDATED
User's PNS tokens were updatedUSER_PNS_TOKEN_CHANGE
Group eventType code
Group was createdGROUP_CREATE
Group was modifiedGROUP_EDIT
Group was deletedGROUP_DELETE

See the Webhook editor in the Management UI for the full list of webhook event types.

Webhook Request

The webhook request content includes basic data of the triggering event. It has enough information to identify the type of event, and the target of the event. This is enough for the recipient to determine if the event is interesting. In such case, the recipient may retrieve more information through the Management API.

The webhook call typically contains just the identifiers of the event target, which enables the receiver to retrieve more data if necessary. The data is serialized as JSON content.

Typical webhook fields:

FieldPurpose
idTarget of event, for example user ID when modifying an user account
typeType of event
timeTimestamp of event
webhookIdIdentifier for webhook configuration
webhookCallIdIdentifier for this request (do retries have the same id?)
dataFree form data, content depends on type of event
Example JSON webhook request content
{
"id": "65645e360a3c9d1354097ef6",
"type": "USER_EDIT",
"time": "2024-09-03T12:55:14.178Z",
"webhookId": "66d7069f5d58f830d11f322a",
"webhookCallId": "66d707325d58f830d11f323f",
"namespaceCode": "root",
"data": {
"changedProperties": [
"emails",
"emails/0.address",
"lastChangedEmail"
]
}
}

Response to received webhook call

The integrated HTTP service should respond to the webhook call with response status code 200 to indicate it received it correctly. Any error response status code means the ID service will retry sending the webhook call later for a number of times.