|Nimbus Docschat

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:

EventDescription
deployment.createdA new deployment was started
deployment.completedA deployment finished successfully
deployment.failedA deployment failed with an error
domain.verifiedA custom domain was verified

Next Steps