Closes #21847: Correct webhook documentation for deprecated keys (#21848)

This commit is contained in:
Jeremy Stretch
2026-04-07 09:58:45 -04:00
committed by GitHub
parent bcc410d99f
commit 06c90cb86a
2 changed files with 20 additions and 8 deletions

View File

@@ -36,6 +36,7 @@ The resulting webhook payload will look like the following:
"url": "/api/dcim/sites/2/",
...
},
"request": {...},
"snapshots": {...},
"context": {
"foo": 123
@@ -43,10 +44,10 @@ The resulting webhook payload will look like the following:
}
```
!!! warning "Deprecation of legacy fields"
The "request_id" and "username" fields in the webhook payload above are deprecated and should no longer be used. Support for them will be removed in NetBox v4.7.0.
!!! warning "Deprecation of legacy keys"
The `request_id` and `username` keys in the webhook payload above are deprecated and should no longer be used. Support for them will be removed in NetBox v4.7.0.
Use `request.user.username` and `request.request_id` from the `request` object included in the callback context instead.
Use `request.user` and `request.id` from the `request` object included in the callback context instead.
!!! note "Consider namespacing webhook data"
The data returned from all webhook callbacks will be compiled into a single `context` dictionary. Any existing keys within this dictionary will be overwritten by subsequent callbacks which include those keys. To avoid collisions with webhook data provided by other plugins, consider namespacing your plugin's data within a nested dictionary as such: