Rotacionar secret do webhook
curl --request POST \
--url https://api.notifique.dev/v1/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.notifique.dev/v1/webhooks/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/webhooks/{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 := "https://api.notifique.dev/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))
}{
"success": true,
"data": {
"id": "clwh_01HABC...",
"secret": "whsec_new_shown_once_xyz789..."
}
}{
"success": false,
"error": "Unauthorized",
"message": "Invalid API key",
"code": "UNAUTHORIZED"
}{
"success": false,
"error": "Forbidden",
"message": "Missing scope webhooks:manage",
"code": "FORBIDDEN"
}{
"success": false,
"error": "Not Found",
"message": "Webhook not found",
"code": "NOT_FOUND"
}Webhooks
Rotacionar secret do webhook
Gera novo secret de assinatura HMAC. O valor anterior invalida imediatamente. O novo secret é retornado uma vez. Escopo webhooks:manage.
POST
/
v1
/
webhooks
/
{id}
/
rotate-secret
Rotacionar secret do webhook
curl --request POST \
--url https://api.notifique.dev/v1/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.notifique.dev/v1/webhooks/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/webhooks/{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 := "https://api.notifique.dev/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))
}{
"success": true,
"data": {
"id": "clwh_01HABC...",
"secret": "whsec_new_shown_once_xyz789..."
}
}{
"success": false,
"error": "Unauthorized",
"message": "Invalid API key",
"code": "UNAUTHORIZED"
}{
"success": false,
"error": "Forbidden",
"message": "Missing scope webhooks:manage",
"code": "FORBIDDEN"
}{
"success": false,
"error": "Not Found",
"message": "Webhook not found",
"code": "NOT_FOUND"
}Esta página foi útil?

