Getting Started with Webhooks
Learn how to receive real-time notifications when events happen in your Nimbus account.
Need help? Click the chat bubble in the bottom right corner to ask questions about our API.
Overview
Webhooks allow you to build integrations that subscribe to certain events on Nimbus. When an event occurs, we'll send an HTTP POST request to the webhook's configured URL.
Setting Up Your Endpoint
Create an HTTP endpoint on your server that accepts POST requests:
webhook-handler.js
app.post('/webhooks/nimbus', (req, res) => {
const event = req.body;
// Verify the webhook signature
const signature = req.headers['x-nimbus-signature'];
if (!verifySignature(event, signature)) {
return res.status(401).send('Invalid signature');
}
// Handle the event
switch (event.type) {
case 'deployment.completed':
handleDeploymentCompleted(event.data);
break;
case 'deployment.failed':
handleDeploymentFailed(event.data);
break;
default:
console.log(`Unhandled event: ${event.type}`);
}
res.status(200).json({ received: true });
});Event Types
The following event types are available for webhook subscriptions:
| Event | Description |
|---|---|
| deployment.created | A new deployment was started |
| deployment.completed | A deployment finished successfully |
| deployment.failed | A deployment failed with an error |
| domain.verified | A custom domain was verified |
Next Steps
- Learn about webhook security and signature verification
- Explore the event payload reference
- Set up retry policies for failed deliveries