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

1

Go to Settings > Webhooks in your dashboard.

2

Add your HTTPS endpoint URL.

3

Select the events you want to receive.

bash
// 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/webhooks

Available events

EventDescription
context.createddocs.wh.ev.created
context.updateddocs.wh.ev.updated
context.deleteddocs.wh.ev.deleted
context.publisheddocs.wh.ev.published
context.version.createddocs.wh.ev.version
team.member.addeddocs.wh.ev.memberAdded
team.member.removeddocs.wh.ev.memberRemoved
export.completeddocs.wh.ev.export

Payload format

All webhooks send a JSON with the following structure:

json
{
  "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.

javascript
// 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:

AttemptDelay
11 min
25 min
330 min
42 h
524 h

Best practices

docs.wh.best.1

docs.wh.best.2

docs.wh.best.3

docs.wh.best.4

docs.wh.best.5

We use cookies

We use cookies to improve your experience, analyze traffic, and personalize content. You can accept all, reject optional ones, or configure your preferences. Cookie policy