Closes #21489: Correct webhook context variable names and event type values #203

Closed
opened 2026-04-05 16:22:58 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 3/6/2026

Fixes: #21489

The webhook documentation had a few inaccuracies that could trip up anyone trying to write Jinja2 templates against the webhook payload.

Specifically, the context variable reference listed model instead of the actual object_type field, and event type values were documented as create, update, and delete. NetBox actually emits created, updated, and deleted. Small difference, but it matters when you're pattern-matching against the event variable in a template.

The example JSON payload has also been refreshed to reflect what the REST API actually returns today, including newer fields such as display and display_url that were missing from the previous example.

*Originally created by @pheus on 3/6/2026* ### Fixes: #21489 The webhook documentation had a few inaccuracies that could trip up anyone trying to write Jinja2 templates against the webhook payload. Specifically, the context variable reference listed `model` instead of the actual `object_type` field, and event type values were documented as `create`, `update`, and `delete`. NetBox actually emits `created`, `updated`, and `deleted`. Small difference, but it matters when you're pattern-matching against the `event` variable in a template. The example JSON payload has also been refreshed to reflect what the REST API actually returns today, including newer fields such as `display` and `display_url` that were missing from the previous example.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#203