Webhooks enable your applications to receive real-time notifications when events occur in your identity and access management systems. This eliminates the need for polling and ensures your systems stay synchronized with user provisioning, authentication, and access control changes across all integrated platforms.
Unizo normalizes webhook events from Okta, Auth0, Azure AD, OneLogin, and other identity providers into a consistent format. This means you write your webhook handler once and it works with all supported platforms.
Webhook Configuration To set up webhooks for your integration, visit the Unizo Console Webhooks section for step-by-step configuration guide.
Supported Event Types
These are the event types currently supported by Unizo's Identity webhooks. The list keeps growing as we add support for more events across different platforms.
Event Type Description Trigger Conditions user:created A new user has been created User account creation via UI, API, or sync user:updated User profile information has been modified Profile updates, attribute changes, or status updates user:deleted A user account has been deleted User deletion or deactivation
Webhook Security All webhooks from Unizo include security headers to verify authenticity:
Headers Header Description x-unizo-event-typeThe type of event that triggered the webhook x-unizo-signatureHMAC SHA-256 signature for request validation x-unizo-timestampUnix timestamp when the event was sent x-unizo-delivery-idUnique identifier for this webhook delivery
Signature Verification Verify the authenticity of incoming webhooks using HMAC SHA-256:
const crypto = require('crypto');
function verifyWebhookSignature(payload, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature, 'hex'),
Buffer.from(expectedSignature, 'hex')
);
}
Event Details
Triggered when a new user account is created in the identity system
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: user:created x-unizo-webhook-idstring Yes Unique webhook configuration ID x-unizo-delivery-idstring Yes Unique delivery ID for idempotency x-unizo-signaturestring Yes HMAC SHA-256 signature
Request Body Schema Property Type Required Description typestring Yes Event type identifier versionstring Yes Webhook payload version user.idstring Yes Unique user identifier user.emailstring Yes User's email address user.usernamestring No User's username user.firstNamestring Yes User's first name user.lastNamestring Yes User's last name user.statusstring Yes User status: active, pending, suspended user.createdDateTimestring Yes ISO 8601 timestamp user.createdByobject No User who created this account integrationobject Yes Integration details
Example Payload Copy {
"type" : "user:created" ,
"version" : "1.0.0" ,
"user" : {
"id" : "user-123456" ,
"email" : "john.doe@example.com" ,
"username" : "john.doe" ,
"firstName" : "John" ,
"lastName" : "Doe" ,
"status" : "active" ,
"createdDateTime" : "2024-01-15T14:00:00Z" ,
"createdBy" : {
"id" : "admin-789" ,
"email" : "admin@example.com"
}
} ,
"integration" : {
"type" : "IDENTITY" ,
"id" : "int_123456" ,
"name" : "Okta Production" ,
"provider" : "okta"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Triggered when user profile information is modified
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: user:updated x-unizo-webhook-idstring Yes Unique webhook configuration ID x-unizo-delivery-idstring Yes Unique delivery ID for idempotency x-unizo-signaturestring Yes HMAC SHA-256 signature
Request Body Schema Property Type Required Description typestring Yes Event type identifier versionstring Yes Webhook payload version user.idstring Yes Unique user identifier user.emailstring Yes User's email address user.changesobject Yes Object containing changed fields user.updatedDateTimestring Yes ISO 8601 timestamp user.updatedByobject No User who made the update integrationobject Yes Integration details
Example Payload Copy {
"type" : "user:updated" ,
"version" : "1.0.0" ,
"user" : {
"id" : "user-123456" ,
"email" : "john.doe@example.com" ,
"changes" : {
"lastName" : {
"from" : "Doe" ,
"to" : "Smith"
} ,
"department" : {
"from" : "Engineering" ,
"to" : "Product"
}
} ,
"updatedDateTime" : "2024-01-15T15:00:00Z" ,
"updatedBy" : {
"id" : "admin-789" ,
"email" : "admin@example.com"
}
} ,
"integration" : {
"type" : "IDENTITY" ,
"id" : "int_123456" ,
"name" : "Okta Production" ,
"provider" : "okta"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Triggered when a user account is deleted or deactivated
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: user:deleted x-unizo-webhook-idstring Yes Unique webhook configuration ID x-unizo-delivery-idstring Yes Unique delivery ID for idempotency x-unizo-signaturestring Yes HMAC SHA-256 signature
Request Body Schema Property Type Required Description typestring Yes Event type identifier versionstring Yes Webhook payload version user.idstring Yes Unique user identifier user.emailstring Yes User's email address user.deletedDateTimestring Yes ISO 8601 timestamp user.deletedByobject No User who deleted this account integrationobject Yes Integration details
Example Payload Copy {
"type" : "user:deleted" ,
"version" : "1.0.0" ,
"user" : {
"id" : "user-123456" ,
"email" : "john.doe@example.com" ,
"deletedDateTime" : "2024-01-15T16:00:00Z" ,
"deletedBy" : {
"id" : "admin-789" ,
"email" : "admin@example.com"
}
} ,
"integration" : {
"type" : "IDENTITY" ,
"id" : "int_123456" ,
"name" : "Okta Production" ,
"provider" : "okta"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Webhook Delivery & Retries
Unizo implements automatic retry logic for failed webhook deliveries:
Initial Delivery : Immediate
First Retry : After 1 minute
Second Retry : After 5 minutes
Third Retry : After 15 minutes
Final Retry : After 1 hour
Webhooks are considered failed if:
Your endpoint returns a non-2xx status code
Connection timeout (30 seconds)
SSL/TLS errors
Best Practices
1. Idempotency
Idempotent Webhook Handler async function handleWebhook(request) {
const deliveryId = request.headers['x-unizo-delivery-id'];
// Check if already processed
if (await isProcessed(deliveryId)) {
return { status: 200, message: 'Already processed' };
}
// Process webhook
await processWebhook(request.body);
// Mark as processed
await markProcessed(deliveryId);
return { status: 200 };
}
2. Async Processing
Asynchronous Processing app.post('/webhooks/identity', (req, res) => {
// Validate signature
if (!verifySignature(req)) {
return res.status(401).send('Invalid signature');
}
// Queue for processing
identityQueue.add(req.body);
// Return immediately
res.status(200).send('OK');
});
3. Error Handling
Comprehensive Error Handling async function processWebhook(payload) {
try {
switch (payload.type) {
case 'user:created':
await handleUserCreated(payload);
break;
case 'role:assigned':
await handleRoleAssigned(payload);
break;
default:
logger.warn(`Unknown webhook type: ${payload.type}`);
}
} catch (error) {
logger.error('Webhook processing failed', {
error: error.message,
payload,
stack: error.stack
});
throw error;
}
}
Need Help?
For webhook-related support: