Public Cloud (Infra) Webhooks
Webhooks enable your applications to receive real-time notifications when events occur in your infrastructure and cloud resources. This eliminates the need for polling and ensures your systems stay synchronized with infrastructure changes, deployments, and resource modifications across all integrated platforms.
Unizo normalizes webhook events from AWS, Azure, Google Cloud, Terraform, Kubernetes, and other infrastructure 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 Public Cloud (Infra) webhooks. The list keeps growing as we add support for more events across different platforms.
Event Type Description Trigger Conditions resource:created A new resource has been created VM, container, database, or other resource creation resource:updated Resource configuration has been modified Configuration changes, scaling, or tag updates resource:deleted A resource has been deleted Resource termination or removal deployment:started Deployment process has started Application or infrastructure deployment initiation deployment:completed Deployment successfully completed Successful deployment completion deployment:failed Deployment failed Deployment errors or rollback scaling:triggered Auto-scaling event triggered Scale up or scale down based on metrics maintenance:scheduled Maintenance window scheduled Planned maintenance or updates cost:alert Cost threshold exceeded Budget alerts or cost anomalies
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
Resource Events
Event Type Description Trigger Conditions resource:created A new resource has been created VM, container, database, or other resource creation resource:updated Resource configuration has been modified Configuration changes, scaling, or tag updates resource:deleted A resource has been deleted Resource termination or removal
Triggered when a new infrastructure resource is created
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: resource: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 resource.idstring Yes Unique resource identifier resource.namestring Yes Resource name resource.typestring Yes Resource type (vm, container, database, etc.) resource.regionstring Yes Deployment region resource.providerstring Yes Cloud provider resource.configurationobject Yes Resource configuration resource.tagsobject No Resource tags resource.createdDateTimestring Yes ISO 8601 timestamp resource.createdByobject No User or system that created the resource integrationobject Yes Integration details
Example Payload Copy {
"type" : "resource:created" ,
"version" : "1.0.0" ,
"resource" : {
"id" : "i-1234567890abcdef0" ,
"name" : "prod-web-server-01" ,
"type" : "vm" ,
"region" : "us-east-1" ,
"provider" : "aws" ,
"configuration" : {
"instanceType" : "t3.medium" ,
"imageId" : "ami-0123456789" ,
"vpcId" : "vpc-12345" ,
"subnetId" : "subnet-67890" ,
"securityGroups" : [
"sg-web-prod"
]
} ,
"tags" : {
"Environment" : "production" ,
"Application" : "web-app" ,
"Owner" : "platform-team"
} ,
"createdDateTime" : "2024-01-15T14:00:00Z" ,
"createdBy" : {
"id" : "user-123" ,
"email" : "devops@example.com" ,
"type" : "user"
}
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "AWS Production" ,
"provider" : "aws"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Triggered when a resource configuration is modified
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: resource: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 resource.idstring Yes Unique resource identifier resource.namestring Yes Resource name resource.typestring Yes Resource type resource.changesobject Yes Object containing changed fields resource.updatedDateTimestring Yes ISO 8601 timestamp resource.updatedByobject No User or system that updated the resource integrationobject Yes Integration details
Example Payload Copy {
"type" : "resource:updated" ,
"version" : "1.0.0" ,
"resource" : {
"id" : "i-1234567890abcdef0" ,
"name" : "prod-web-server-01" ,
"type" : "vm" ,
"changes" : {
"instanceType" : {
"from" : "t3.medium" ,
"to" : "t3.large"
} ,
"tags" : {
"added" : {
"ScalingGroup" : "web-asg-prod"
} ,
"removed" : { } ,
"modified" : {
"LastModified" : {
"from" : "2024-01-01" ,
"to" : "2024-01-15"
}
}
}
} ,
"updatedDateTime" : "2024-01-15T15:00:00Z" ,
"updatedBy" : {
"id" : "auto-scaling" ,
"type" : "system"
}
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "AWS Production" ,
"provider" : "aws"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Triggered when a resource is terminated or deleted
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: resource: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 resource.idstring Yes Unique resource identifier resource.namestring Yes Resource name resource.typestring Yes Resource type resource.deletedDateTimestring Yes ISO 8601 timestamp resource.deletedByobject No User or system that deleted the resource resource.reasonstring No Reason for deletion integrationobject Yes Integration details
Example Payload Copy {
"type" : "resource:deleted" ,
"version" : "1.0.0" ,
"resource" : {
"id" : "i-1234567890abcdef0" ,
"name" : "prod-web-server-01" ,
"type" : "vm" ,
"deletedDateTime" : "2024-01-15T16:00:00Z" ,
"deletedBy" : {
"id" : "user-456" ,
"email" : "admin@example.com" ,
"type" : "user"
} ,
"reason" : "Instance replaced by new deployment"
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "AWS Production" ,
"provider" : "aws"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Deployment Events
Event Type Description Trigger Conditions deployment:started Deployment process has started Application or infrastructure deployment initiation deployment:completed Deployment successfully completed Successful deployment completion deployment:failed Deployment failed Deployment errors or rollback
Triggered when a deployment process begins
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: deployment:started 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 deployment.idstring Yes Unique deployment identifier deployment.namestring Yes Deployment name deployment.environmentstring Yes Target environment deployment.versionstring Yes Application or configuration version deployment.typestring Yes Deployment type (rolling, blue-green, canary) deployment.startedDateTimestring Yes ISO 8601 timestamp deployment.initiatedByobject Yes User or system that initiated deployment integrationobject Yes Integration details
Example Payload Copy {
"type" : "deployment:started" ,
"version" : "1.0.0" ,
"deployment" : {
"id" : "deploy-789" ,
"name" : "web-app-v2.5.0" ,
"environment" : "production" ,
"version" : "2.5.0" ,
"type" : "rolling" ,
"startedDateTime" : "2024-01-15T14:00:00Z" ,
"initiatedBy" : {
"id" : "ci-system" ,
"name" : "Jenkins Pipeline" ,
"type" : "system"
}
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "Kubernetes Production" ,
"provider" : "kubernetes"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Triggered when a deployment successfully completes
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: deployment:completed 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 deployment.idstring Yes Unique deployment identifier deployment.namestring Yes Deployment name deployment.environmentstring Yes Target environment deployment.versionstring Yes Application or configuration version deployment.durationstring Yes Deployment duration deployment.completedDateTimestring Yes ISO 8601 timestamp deployment.summaryobject Yes Deployment summary statistics integrationobject Yes Integration details
Example Payload Copy {
"type" : "deployment:completed" ,
"version" : "1.0.0" ,
"deployment" : {
"id" : "deploy-789" ,
"name" : "web-app-v2.5.0" ,
"environment" : "production" ,
"version" : "2.5.0" ,
"duration" : "5m32s" ,
"completedDateTime" : "2024-01-15T14:05:32Z" ,
"summary" : {
"nodesUpdated" : 6 ,
"podsReplaced" : 18 ,
"healthChecks" : "passed" ,
"rollbackRequired" : false
}
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "Kubernetes Production" ,
"provider" : "kubernetes"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Scaling Events
Event Type Description Trigger Conditions scaling:triggered Auto-scaling event triggered Scale up or scale down based on metrics
Triggered when auto-scaling adjusts resource capacity
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: scaling:triggered 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 scaling.resourceIdstring Yes Resource being scaled scaling.resourceTypestring Yes Type of resource scaling.directionstring Yes Scale direction: up or down scaling.fromnumber Yes Previous capacity scaling.tonumber Yes New capacity scaling.metricobject Yes Metric that triggered scaling scaling.triggeredDateTimestring Yes ISO 8601 timestamp integrationobject Yes Integration details
Example Payload Copy {
"type" : "scaling:triggered" ,
"version" : "1.0.0" ,
"scaling" : {
"resourceId" : "asg-web-prod" ,
"resourceType" : "auto-scaling-group" ,
"direction" : "up" ,
"from" : 3 ,
"to" : 5 ,
"metric" : {
"name" : "cpu_utilization" ,
"value" : 85 ,
"threshold" : 80 ,
"unit" : "percent"
} ,
"triggeredDateTime" : "2024-01-15T14:30:00Z"
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "AWS Production" ,
"provider" : "aws"
}
}
Response 200 OKWebhook processed successfully 400 Bad RequestInvalid webhook payload 401 UnauthorizedInvalid or missing signature
Cost Events
Event Type Description Trigger Conditions cost:alert Cost threshold exceeded Budget alerts or cost anomalies
Triggered when cloud costs exceed defined thresholds
Headers Name Type Required Description Content-Typestring Yes Always application/json x-unizo-event-typestring Yes Event type: cost:alert 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 cost.alertIdstring Yes Cost alert identifier cost.alertNamestring Yes Alert name cost.budgetnumber Yes Budget amount cost.actualnumber Yes Actual spend cost.forecastnumber No Forecasted spend cost.currencystring Yes Currency code cost.periodstring Yes Budget period cost.triggeredDateTimestring Yes ISO 8601 timestamp integrationobject Yes Integration details
Example Payload Copy {
"type" : "cost:alert" ,
"version" : "1.0.0" ,
"cost" : {
"alertId" : "budget-123" ,
"alertName" : "Monthly AWS Budget" ,
"budget" : 10000 ,
"actual" : 11250 ,
"forecast" : 13500 ,
"currency" : "USD" ,
"period" : "2024-01" ,
"triggeredDateTime" : "2024-01-15T12:00:00Z" ,
"breakdown" : {
"compute" : 6500 ,
"storage" : 2500 ,
"network" : 1500 ,
"other" : 750
}
} ,
"integration" : {
"type" : "INFRASTRUCTURE" ,
"id" : "int_123456" ,
"name" : "AWS Billing" ,
"provider" : "aws"
}
}
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/infrastructure', (req, res) => {
// Validate signature
if (!verifySignature(req)) {
return res.status(401).send('Invalid signature');
}
// Queue for processing
infraQueue.add(req.body);
// Return immediately
res.status(200).send('OK');
});
3. Resource Tracking
Resource State Tracking async function processResourceEvent(payload) {
const { resource, type } = payload;
switch (type) {
case 'resource:created':
await addToInventory(resource);
await updateCostTracking(resource);
break;
case 'resource:updated':
await updateInventory(resource);
await checkComplianceRules(resource);
break;
case 'resource:deleted':
await removeFromInventory(resource);
await updateBilling(resource);
break;
}
// Update CMDB
await updateCMDB(payload);
}
Need Help?
For webhook-related support: