Give an endpoint a new signing secret
curl --request POST \
--url http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "live",
"url": "<string>",
"description": "<string>",
"status": "active",
"secret_prefix": "<string>",
"previous_secret_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}API Reference
Give an endpoint a new signing secret
Needs the crypto:webhooks:manage scope. The new secret is in the answer once. The old secret keeps working for 24 hours, and during that time each webhook carries two signatures, so you can switch over without missing one.
POST
/
v1
/
webhooks
/
endpoints
/
{id}
/
rotate-secret
Give an endpoint a new signing secret
curl --request POST \
--url http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:44010/v1/webhooks/endpoints/{id}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "live",
"url": "<string>",
"description": "<string>",
"status": "active",
"secret_prefix": "<string>",
"previous_secret_expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Response
The endpoint, with its new secret.

