← Back to Guides

Webhooks

Subscribe to render events. Chart-Output sends HTTP POST requests to your endpoint when renders succeed or fail.

Events

  • render.success – Chart rendered successfully
  • render.failed – Render failed (validation error, etc.)

Payload format

{
  "event": "render.success",
  "timestamp": "2024-01-15T12:00:00.000Z",
  "data": {
    "requestId": "req_abc123",
    "chartType": "line",
    "format": "png",
    "width": 800,
    "height": 400,
    "renderTimeMs": 42
  }
}

Verification

Each webhook request includes an X-Signature header (HMAC-SHA256 of the raw body). Verify it using your webhook secret:

// Node.js
const crypto = require('crypto');
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
if (expected !== req.headers['x-signature']) {
  return res.status(401).send('Invalid signature');
}

Setup

Create webhooks from the Webhooks page in your dashboard. The secret is shown only at creation time.