Webhooks
Configure subscriptions under Administration → Webhooks. Each specifies a URL, event types, optional conditions and an optional HMAC signing secret. Matching events are sent as JSON over HTTP POST.
How dispatch works
Each event stored in the audit log is checked against webhook subscriptions. A subscription fires when:
- it is Enabled;
- its event-type list contains the event's
event_type— exact string match, no wildcards; - its condition set (if any) evaluates to true against the event JSON.
Delivery runs asynchronously, off the request path. A failing webhook never slows down or rolls back the operation that produced the event.
Event types
The event picker uses GET /api/v1/webhooks/event-catalog and groups events with presets for all events, all created events, a group, or an object.
| Group | Event types |
|---|---|
| inventory | inventory.tenant.created, inventory.tenant.updated, inventory.tenant.deleted |
| connections | connection.session.created, connection.session.activated, connection.session.disconnected, connection.session.failed, connection.session.terminated |
| sync | sync.mapping.created, sync.mapping.updated, sync.mapping.deleted |
Session events originate from interactive sessions (see Active sessions); mapping events from inventory sync.
Subscription fields
| Field | Rules |
|---|---|
| Name | 1–200 characters |
| Target URL | valid http:// or https:// URL |
| Secret | optional, 8–512 characters; enables request signing |
| Event Types | at least one; each must match ^[a-z][a-z0-9.]*$ |
| Enabled | disabled subscriptions never fire |
| Conditions | optional JSON condition set (below) |
An SSRF guard rejects target URLs that resolve to private, loopback, or link-local addresses — both at delivery time and on Test fire. HTTP redirects are never followed.
The secret is write-only: API responses expose only a boolean secret_set. To rotate it, send a new non-empty secret in an update (leaving it blank keeps the current one); to remove it, use Clear secret (DELETE /api/v1/webhooks/{id}/secret).
Conditions
A condition set is a boolean tree of and/or groups whose leaves compare an attribute of the event JSON against a literal value (the shape mirrors NetBox webhook conditions):
{
"and": [
{ "attr": "event_type", "op": "eq", "value": "inventory.tenant.created" },
{
"or": [
{ "attr": "metadata.name", "op": "contains", "value": "prod" },
{ "attr": "metadata.priority", "op": "gte", "value": 5 }
]
}
]
}
| Operator | Matches when |
|---|---|
eq / ne | value equals / does not equal the literal |
gt, gte, lt, lte | numeric comparison |
in | value is contained in the literal array |
contains | string contains substring, or array contains the literal |
regex | string value matches the regular expression |
attris a dot path into the event JSON; numeric segments index arrays (metadata.tags.0).- A missing path fails every operator except
ne, which then matches. - Each group contains exactly one of
andororwith a non-empty member list; groups nest up to 16 levels. - No conditions — the webhook fires on every selected event.
Use the row editor or Edit as JSON to define conditions. Invalid conditions are rejected on save.
Delivery and retries
- One HTTP
POSTper matching subscription; the body is the event JSON,Content-Type: application/json. - Per-attempt timeout: 10 seconds.
- Up to 3 attempts. Any non-2xx status or network error is retried after a linear backoff of 200 ms × attempt number.
- Any 2xx response counts as success and stops retrying.
- The final outcome is persisted on the subscription and shown in the list: Last Status (HTTP status;
0means the request never completed) and Last Fired, plus the last error text.
Delivery is best-effort: there is no durable queue. If all attempts fail, the event is not redelivered — reconcile by querying the audit log through the REST API.
Signing and verification
Every delivery carries:
| Header | Value |
|---|---|
X-Piping-Timestamp | Unix seconds at send time |
X-Piping-Nonce | unique UUID per attempt |
X-Piping-Signature | sha256=<hex> — present only when a secret is set |
The signature is HMAC-SHA256 over the string <timestamp>.<raw body>, keyed with the subscription secret, hex-encoded. To verify:
import hashlib, hmac
signing_string = f"{timestamp_header}.{raw_body}".encode()
expected = "sha256=" + hmac.new(secret.encode(), signing_string, hashlib.sha256).hexdigest()
assert hmac.compare_digest(expected, signature_header)
Tip: Signature verification alone does not stop replays. Reject deliveries whose timestamp is too old and track recently seen nonces.
Payload
The body is the audit event serialized as JSON:
{
"id": "0197a3f0-5b6e-7c3d-9e1f-2a4b6c8d0e1f",
"event_type": "inventory.tenant.created",
"actor_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"actor_kind": "user",
"target_type": "tenant",
"target_id": "9b2e4d6f-8a1c-4e3b-b5d7-0f2a4c6e8b1d",
"metadata": { "name": "acme" },
"created_at": "2026-06-10T12:34:56.789Z"
}
| Field | Meaning |
|---|---|
event_type | dotted event name; matches the subscription |
actor_id, actor_kind | who triggered the event (user, service_principal, …); actor_id may be null |
target_type, target_id | the object the event concerns |
metadata | event-specific JSON object |
created_at | RFC 3339 timestamp |
metadata content varies per event type — inspect a real delivery or the audit log before writing conditions against it.
Test fire
Test fire sends a single signed request (no retries) with the body:
{ "event": "test.fire", "timestamp": "2026-06-10T12:34:56.789Z" }
The response reports the HTTP status, the error (if any), and the latency in milliseconds; the result is also persisted as Last Status / Last Fired.
Access control
Webhook routes are gated by access control policies on the webhook resource: read access covers listing, viewing, and the event catalog; update access covers create, edit, delete, test fire, and secret clearing.
REST API reference
| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/webhooks | List subscriptions (limit, offset) |
POST | /api/v1/webhooks | Create subscription |
GET | /api/v1/webhooks/{id} | Get subscription |
PUT | /api/v1/webhooks/{id} | Update subscription |
DELETE | /api/v1/webhooks/{id} | Delete subscription |
POST | /api/v1/webhooks/{id}/test-fire | Send a test delivery |
DELETE | /api/v1/webhooks/{id}/secret | Clear the signing secret |
GET | /api/v1/webhooks/event-catalog | List subscribable events |
Schemas are documented in the API reference.