Webhooks
Receive real-time HTTP notifications when events occur in your account.
Overview
Webhooks allow you to receive automatic HTTP POST notifications when events occur in your Contextaify account.
This is useful for keeping external systems in sync, triggering CI/CD pipelines, or logging activity.
Setup
Go to Settings > Webhooks in your dashboard.
Add your HTTPS endpoint URL.
Select the events you want to receive.
// Register a webhook via API
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/contextaify",
"events": ["context.updated", "context.created"],
"secret": "whsec_your_signing_secret"
}' \
https://api.contextaify.com/v1/webhooksAvailable events
| Event | Description |
|---|---|
| context.created | docs.wh.ev.created |
| context.updated | docs.wh.ev.updated |
| context.deleted | docs.wh.ev.deleted |
| context.published | docs.wh.ev.published |
| context.version.created | docs.wh.ev.version |
| team.member.added | docs.wh.ev.memberAdded |
| team.member.removed | docs.wh.ev.memberRemoved |
| export.completed | docs.wh.ev.export |
Payload format
All webhooks send a JSON with the following structure:
{
"id": "evt_abc123",
"type": "context.updated",
"timestamp": "2026-04-19T14:30:00Z",
"data": {
"contextId": "ctx_abc123",
"name": "Product Context",
"version": 4,
"updatedBy": "user_xyz",
"changes": {
"sections_modified": ["pricing", "features"],
"word_count_delta": 45
}
}
}Signature verification
Each webhook includes an X-Contextaify-Signature header to verify authenticity.
// Node.js verification example
import crypto from 'crypto';
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(`sha256=${expected}`)
);
}
// In your webhook handler:
app.post('/webhooks/contextaify', (req, res) => {
const signature = req.headers['x-contextaify-signature'];
const isValid = verifyWebhook(
JSON.stringify(req.body),
signature,
process.env.WEBHOOK_SECRET
);
if (!isValid) return res.status(401).send('Invalid signature');
// Process the event
const { type, data } = req.body;
console.log(`Received ${type}`, data);
res.status(200).send('OK');
});Retry policy
If your endpoint doesn't respond with 2xx, we retry with exponential backoff:
| Attempt | Delay |
|---|---|
| 1 | 1 min |
| 2 | 5 min |
| 3 | 30 min |
| 4 | 2 h |
| 5 | 24 h |
Best practices
docs.wh.best.1
docs.wh.best.2
docs.wh.best.3
docs.wh.best.4
docs.wh.best.5