← 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 successfullyrender.failed– Render failed (validation error, etc.)
Payload format
All events follow the same envelope structure: event, timestamp, and a data object.
render.success
json
{
"event": "render.success",
"timestamp": "2024-01-15T12:00:00.000Z",
"data": {
"requestId": "req_abc123",
"chartType": "line",
"format": "png",
"width": 800,
"height": 400,
"renderTimeMs": 42
}
}render.failed
json
{
"event": "render.failed",
"timestamp": "2024-01-15T12:00:01.000Z",
"data": {
"requestId": "req_xyz789",
"error": "Invalid chart specification",
"renderTimeMs": 5
}
}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.