Skip to content

Webhooks API

Configure webhooks for real-time notifications.

List Webhooks

http
GET /api/v1/webhooks

Response

json
{
  "data": [
    {
      "id": "whk_abc123",
      "url": "https://your-server.com/webhook",
      "events": ["deployment.completed", "alert.triggered"],
      "active": true,
      "created_at": "2025-01-15T10:00:00Z"
    }
  ]
}

Create Webhook

http
POST /api/v1/webhooks

Request Body

json
{
  "url": "https://your-server.com/webhook",
  "events": ["deployment.completed", "deployment.failed", "alert.triggered"],
  "secret": "your-webhook-secret"
}

Available Events

EventDescription
deployment.startedDeployment has started
deployment.completedDeployment completed successfully
deployment.failedDeployment failed
alert.triggeredAlert condition met
alert.resolvedAlert condition cleared
service.createdNew service added
service.deletedService removed
service.status_changedService health changed

Update Webhook

http
PATCH /api/v1/webhooks/:id

Delete Webhook

http
DELETE /api/v1/webhooks/:id

Test Webhook

http
POST /api/v1/webhooks/:id/test

Webhook Payload

All webhooks receive a JSON payload:

json
{
  "id": "evt_xyz789",
  "event": "deployment.completed",
  "timestamp": "2025-01-15T10:00:00Z",
  "data": {
    "deployment_id": "dpl_abc123",
    "service": "api-gateway",
    "version": "v2.4.1",
    "status": "success"
  }
}

Signature Verification

Webhooks include a signature header for verification:

X-OpsAtlas-Signature: sha256=abc123...

Verify in your code:

javascript
const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return `sha256=${expected}` === signature;
}

Released under the MIT License.