Skip to content

Webhooks

Piora Webhooks let you receive instant HTTP notifications when specific events occur. Use webhooks to integrate Slack notifications, trigger downstream processes, or build custom automation workflows.

  1. Go to “Settings” > “Webhooks”
  2. Click “Add Webhook”
  3. Configure the following parameters:
ParameterDescriptionExample
URLEndpoint to receive notificationshttps://your-server.com/webhook
EventsEvent types to listen forSelect one or more
SecretSigning key (for verification)Auto-generated or custom
StatusEnabled or disabledEnabled
EventDescription
deployment.startedDeployment started
deployment.succeededDeployment succeeded
deployment.failedDeployment failed
deployment.rolled_backDeployment rolled back
EventDescription
application.createdApplication created
application.deletedApplication deleted
application.startedApplication started
application.stoppedApplication stopped
application.crashedApplication crashed unexpectedly
EventDescription
server.connectedServer connected successfully
server.disconnectedServer connection lost
server.alertServer alert (CPU, memory, etc.)
EventDescription
database.createdDatabase created
database.deletedDatabase deleted
backup.completedBackup completed
backup.failedBackup failed

Each webhook request is a POST with a JSON payload:

{
"event": "deployment.succeeded",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"application": {
"id": "app_xxxxxxxxxxxx",
"name": "my-web-app"
},
"deployment": {
"id": "deploy_xxxxxxxxxxxx",
"status": "succeeded",
"commit": "abc1234",
"branch": "main",
"duration": 45
},
"server": {
"id": "srv_xxxxxxxxxxxx",
"name": "production"
}
}
}

Each webhook request includes a signature header to verify it genuinely came from Piora:

X-Piora-Signature: sha256=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// Express.js example
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-piora-signature'];
if (!verifyWebhook(req.body, signature, WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(req.body);
// Handle event...
res.status(200).send('OK');
});

If your webhook endpoint returns a non-2xx status code, Piora automatically retries:

RetryWait Time
1stAfter 1 minute
2ndAfter 5 minutes
3rdAfter 30 minutes
4thAfter 2 hours
5thAfter 12 hours

After 5 retries, the event is marked as failed.

The dashboard shows the delivery history for each webhook:

  • Delivery time
  • Event type
  • HTTP status code
  • Response time
  • Payload content
  • Retry history