curl --request POST \
--url https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secretconst options = {method: 'POST'};
fetch('https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secret"
response = requests.post(url)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"endpoint_id": "whe_a1e823c073ab743ce5969ceef2db4d42",
"name": "Production events",
"url": "https://api.example.com/webhooks/bachs",
"enabled": true,
"event_types": [
"checkout.completed",
"collection.succeeded",
"payout.paid",
"refund.paid"
],
"event_source": "account",
"created_at": "2026-03-09T10:00:00.000Z",
"updated_at": "2026-03-12T14:05:33.000Z"
}{
"detail": "Invalid API key",
"error_code": "UNAUTHORIZED"
}{
"detail": "API key does not have permission for this operation",
"error_code": "FORBIDDEN"
}{
"detail": "Resource not found",
"error_code": "NOT_FOUND"
}{
"detail": "Rate limit exceeded. Please retry after a few seconds.",
"error_code": "TOO_MANY_REQUESTS"
}Rotate an endpoint's signing secret
Generate a new signing secret for an endpoint. The old secret stops working immediately, so update your verification before rotating. Requires the webhooks:write scope.
curl --request POST \
--url https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secretconst options = {method: 'POST'};
fetch('https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secret"
response = requests.post(url)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/webhooks/endpoints/{endpoint_id}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"endpoint_id": "whe_a1e823c073ab743ce5969ceef2db4d42",
"name": "Production events",
"url": "https://api.example.com/webhooks/bachs",
"enabled": true,
"event_types": [
"checkout.completed",
"collection.succeeded",
"payout.paid",
"refund.paid"
],
"event_source": "account",
"created_at": "2026-03-09T10:00:00.000Z",
"updated_at": "2026-03-12T14:05:33.000Z"
}{
"detail": "Invalid API key",
"error_code": "UNAUTHORIZED"
}{
"detail": "API key does not have permission for this operation",
"error_code": "FORBIDDEN"
}{
"detail": "Resource not found",
"error_code": "NOT_FOUND"
}{
"detail": "Rate limit exceeded. Please retry after a few seconds.",
"error_code": "TOO_MANY_REQUESTS"
}Path Parameters
The webhook endpoint's ID.
Response
The endpoint with its secret rotated.
A webhook endpoint: a URL Bachs delivers events to, and the events it is subscribed to.
Use this identifier to fetch, update, delete, or rotate the secret on this endpoint, and to scope event listings to it.
"whe_a1e823c073ab743ce5969ceef2db4d42"
The label you gave the endpoint. It is never sent to the endpoint itself.
"Production events"
When true, matching events are delivered here. When false, nothing is sent to this URL, not even retries that were already queued, and events from while it was off are not sent later. We set it to false ourselves when deliveries keep failing; see disabled_reason and When an endpoint keeps failing.
true
The event types this endpoint receives, stored lowercase. Anything not listed is never delivered here, so add a type before you rely on it.
collection.succeeded, collection.failed, collection.underpaid, checkout.completed, checkout.expired, payout.created, payout.paid, payout.failed, refund.created, refund.paid, refund.failed, conversion.completed, conversion.failed, customer.created, customer.updated, dispute.created, dispute.updated, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted, invoice.created, invoice.paid, invoice.payment_failed ["collection.succeeded", "collection.failed"]
When the endpoint was created, as an ISO 8601 timestamp in UTC.
"2026-03-09T10:00:00.000Z"
When the endpoint was last changed, as an ISO 8601 timestamp in UTC. Rotating the signing secret updates this.
"2026-03-09T10:00:00.000Z"
When we turned this endpoint off because its deliveries kept failing, as an ISO 8601 timestamp in UTC. null while the endpoint is enabled, and when you turned it off yourself. See When an endpoint keeps failing.
"2026-03-12T14:05:00.000Z"
Why we turned this endpoint off. consecutive_failures: every delivery to it failed for at least 72 hours, with no success in between, and we emailed a warning at least 48 hours earlier. null while the endpoint is enabled, and when you turned it off yourself.
consecutive_failures, null "consecutive_failures"
Which account's events reach this endpoint. account: only events that happened on your own account. connect: only events that happened on accounts you own. all: both.
account, connect, all "account"

