Option to exclude api from triggering webhooks #6685

Closed
opened 2025-12-29 19:43:56 +01:00 by adam · 7 comments
Owner

Originally created by @rizlas on GitHub (Jul 19, 2022).

NetBox version

v3.2.5

Feature type

New functionality

Proposed functionality

Add an option to webhooks to enable/disable triggering from api. Currently if you make CRUD operations either via GUI or APIs webhooks are triggered.

Use case

Currently I have a CI/CD connected to a webhook but I want it to be triggered only for operations made via GUI.

Database changes

Can't say

External dependencies

None

Originally created by @rizlas on GitHub (Jul 19, 2022). ### NetBox version v3.2.5 ### Feature type New functionality ### Proposed functionality Add an option to webhooks to enable/disable triggering from api. Currently if you make CRUD operations either via GUI or APIs webhooks are triggered. ### Use case Currently I have a CI/CD connected to a webhook but I want it to be triggered only for operations made via GUI. ### Database changes Can't say ### External dependencies None
adam added the type: featurepending closurestatus: under review labels 2025-12-29 19:43:56 +01:00
adam closed this issue 2025-12-29 19:43:57 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 19, 2022):

I'm not sure it would make sense to differentiate between GUI- and API-driven changes, especially if you assume that future releases of NetBox may have an entirely API-driven UI. It also might not be feasible without radically altering the current webhooks implementation that relies on signals, which don't include any context indicating how a change was made.

@jeremystretch commented on GitHub (Jul 19, 2022): I'm not sure it would make sense to differentiate between GUI- and API-driven changes, especially if you assume that future releases of NetBox may have an entirely API-driven UI. It also might not be feasible without radically altering the current webhooks implementation that relies on signals, which don't include any context indicating how a change was made.
Author
Owner

@romanstech commented on GitHub (Jul 21, 2022):

Just my 5 cents.
I use a separate Netbox user for REST API requests and by checking the payload.username I separate REST API and GUI calls to the same webhook in my backend app.
GUI uses usual usernames (in my case, AD) so I easily recognize REST API calls.

@romanstech commented on GitHub (Jul 21, 2022): Just my 5 cents. I use a separate Netbox user for REST API requests and by checking the payload.username I separate REST API and GUI calls to the same webhook in my backend app. GUI uses usual usernames (in my case, AD) so I easily recognize REST API calls.
Author
Owner

@rizlas commented on GitHub (Jul 21, 2022):

That can be a solution. In my case that doesn't work because users (LDAP) are enabled to use API token.
Anyway, I will further investigate your solution.

Thank you

@rizlas commented on GitHub (Jul 21, 2022): That can be a solution. In my case that doesn't work because users (LDAP) are enabled to use API token. Anyway, I will further investigate your solution. Thank you
Author
Owner

@DanSheps commented on GitHub (Jul 21, 2022):

Maybe it would make more sense to have a "webhooks=false" option in both the API and GUI. With the ability to toggle it on and off in the gui

@DanSheps commented on GitHub (Jul 21, 2022): Maybe it would make more sense to have a "webhooks=false" option in both the API and GUI. With the ability to toggle it on and off in the gui
Author
Owner

@rizlas commented on GitHub (Jul 26, 2022):

What about a simple custom header that will discriminate between GUI and API? Further actions are delegated to the webhook receiver.

@rizlas commented on GitHub (Jul 26, 2022): What about a simple custom header that will discriminate between GUI and API? Further actions are delegated to the webhook receiver.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 25, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Sep 25, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Oct 25, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Oct 25, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6685