Rotar el secreto del webhook
⚠️ Efecto real. Genera un NUEVO secreto de firma para el webhook y lo devuelve en claro, una sola vez: { "id", "hasSecret": true, "secret" } (64 caracteres hexadecimales). El secreto anterior deja de verificar de inmediato, sin ventana de superposición; las entregas ya en curso firman con el valor que cargó su despacho. También es la forma en que un webhook creado antes del 2026-09-15 (hasSecret: false, entregas sin firma) empieza a firmarse, y la única manera de recuperar un secreto perdido. Sin cuerpo de solicitud.
Por OAuth/MCP la rotación se registra en la auditoría ANTES de ocurrir; si ese registro no se puede escribir, la rotación se rechaza con 500 OAUTH_SECRET_AUDIT_UNAVAILABLE y el secreto anterior sigue siendo válido.
Permisos: webhooks:manage (Owner o Admin con una clave de cuenta o un token OAuth/MCP). Mismo alcance de número que GET /v1/webhooks/{id}: un webhook que el llamador no ve → 404 WEBHOOK_NOT_FOUND.
curl --request POST \
--url https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "wh_01HZX...",
"hasSecret": true,
"secret": "9f2c4e6a8b0d1f3a5c7e9b1d3f5a7c9e2b4d6f8a0c1e3b5d7f9a1c3e5b7d9f1a"
}Encabezados
Respuesta
Nuevo secreto, en claro, una sola vez
¿Esta página le ayudó?
curl --request POST \
--url https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/webhooks/{id}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "wh_01HZX...",
"hasSecret": true,
"secret": "9f2c4e6a8b0d1f3a5c7e9b1d3f5a7c9e2b4d6f8a0c1e3b5d7f9a1c3e5b7d9f1a"
}