Issue a new signing secret
curl --request POST \
--url https://app.trustivan.com/api/v1/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/webhooks/{id}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/webhooks/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/webhooks/{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))
}{}Issue a new signing secret
The previous secret keeps working for an overlap window, and deliveries are signed with both until it closes. Receivers are told to accept a delivery if any signature in the header verifies, which is what makes rotation a change a customer can make on their own schedule rather than an outage.
POST
/
webhooks
/
{id}
/
rotate-secret
Issue a new signing secret
curl --request POST \
--url https://app.trustivan.com/api/v1/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/webhooks/{id}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/webhooks/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/webhooks/{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))
}{}Authorizations
Response
Rotated. The response carries the new secret (the only time it
is returned) and when the previous one stops being used.
The response is of type object.