Skills, MCP and apps / Apps and webhooks
Rotate, change or delete a webhook
A secret leaked, your service moved, or the requests must stop for a time. Rotate the secret, change the webhook, turn it off, or delete it.
2 min read
You need:
- Admin access to the repository.
- A webhook on the repository.
src webhook listshows the id of each webhook.
Rotate the secret
If the secret leaked, or a person who knew it left the team, give the webhook a new secret.
- On the web, click Rotate secret on the row of the webhook, then Rotate secret in the dialog. Copy the new secret from the box at the top of the page.
- In a terminal, run
src webhook rotate-secret <id>. It prints the new secret once.
Important
The old secret stops at once. Source signs every next request with the new secret, also the retries and the redeliveries. So give the new secret to your receiver immediately.
Change the URL or the events
Click Edit on the row of the webhook. In a terminal, --event replaces all the events:
src webhook edit <id> --url https://bot.example.com/v2 --event push --event ci_run
Turn a webhook off
To stop the requests for a time, turn off Active on the row, or run src webhook edit <id> --inactive.
- A webhook that is off gets no events, and its pending deliveries are dropped.
- It keeps its secret and its log.
Turn it on again with the switch, or with src webhook edit <id> --active.
Delete a webhook
Click Delete on the row, then Delete webhook. In a terminal:
src webhook delete <id> --yes
Source deletes the webhook with its pending deliveries and its log.
Caution
You cannot undo the delete of a webhook.
Done
- A rotated webhook signs each request with its new secret.
- An edited webhook sends the events that you picked to the URL that you set.
- A webhook that is off sends nothing until you turn it on again.