Webhooks Guide
CodeNx fires an HTTP POST to your endpoint whenever a record is created, updated, or deleted. No polling, no cron jobs — real-time data events delivered to any URL.
Overview
Configure webhook endpoints in the admin panel under Settings → Webhooks. Each endpoint receives a JSON payload with the event type, the collection, and the full record before and after the change.
Event Types
record.created A new record was created in the collection.record.updated One or more fields on a record were changed.record.deleted A record was deleted (soft delete).bulk.imported A CSV import completed — fired once per batch.pipeline.completed An AI pipeline run finished on one or more records.schema.changed A field was added, renamed, or removed from the schema.You can also configure field-level triggers — fire only
when a specific field changes. Useful for triggering emails only when status changes to "shipped".
Payload Format
"event": "record.updated",
"timestamp": "2025-03-15T10:42:00.000Z",
"collection": "products",
"tenant_id": "ten_abc123",
"user_id": "usr_xyz789",
"record": { /* full record after change */ },
"previous": { /* full record before change */ },
"diff": { "price": { "from": 1299, "to": 999 } }
}
Verifying Webhooks
Every webhook includes a signature header. Verify it to ensure the payload came from CodeNx and wasn't tampered with.
import crypto from 'crypto'
const signature = req.headers['x-codenx-signature']
const expected = crypto
.createHmac('sha256', process.env.WEBHOOK_SECRET)
.update(JSON.stringify(req.body))
.digest('hex')
if (signature !== expected) {
return res.status(401).json({ error: 'Invalid signature' })
}
Automatic Retries
If your endpoint returns a non-2xx status or times out, CodeNx retries with exponential backoff: