Skip to main content
On this page

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:

  1. it is Enabled;
  2. its event-type list contains the event's event_type — exact string match, no wildcards;
  3. 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.

GroupEvent types
inventoryinventory.tenant.created, inventory.tenant.updated, inventory.tenant.deleted
connectionsconnection.session.created, connection.session.activated, connection.session.disconnected, connection.session.failed, connection.session.terminated
syncsync.mapping.created, sync.mapping.updated, sync.mapping.deleted

Session events originate from interactive sessions (see Active sessions); mapping events from inventory sync.

Subscription fields

FieldRules
Name1–200 characters
Target URLvalid http:// or https:// URL
Secretoptional, 8–512 characters; enables request signing
Event Typesat least one; each must match ^[a-z][a-z0-9.]*$
Enableddisabled subscriptions never fire
Conditionsoptional 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 }
      ]
    }
  ]
}
OperatorMatches when
eq / nevalue equals / does not equal the literal
gt, gte, lt, ltenumeric comparison
invalue is contained in the literal array
containsstring contains substring, or array contains the literal
regexstring value matches the regular expression
  • attr is 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 and or or with 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 POST per 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; 0 means 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:

HeaderValue
X-Piping-TimestampUnix seconds at send time
X-Piping-Nonceunique UUID per attempt
X-Piping-Signaturesha256=<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"
}
FieldMeaning
event_typedotted event name; matches the subscription
actor_id, actor_kindwho triggered the event (user, service_principal, …); actor_id may be null
target_type, target_idthe object the event concerns
metadataevent-specific JSON object
created_atRFC 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

MethodPathPurpose
GET/api/v1/webhooksList subscriptions (limit, offset)
POST/api/v1/webhooksCreate 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-fireSend a test delivery
DELETE/api/v1/webhooks/{id}/secretClear the signing secret
GET/api/v1/webhooks/event-catalogList subscribable events

Schemas are documented in the API reference.