Rotate a Webhook Secret
curl --request POST \
--url https://api.example.com/v1/webhooks/:id/rotate-secretimport requests
url = "https://api.example.com/v1/webhooks/:id/rotate-secret"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/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://api.example.com/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",
]);
$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://api.example.com/v1/webhooks/: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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/webhooks/:id/rotate-secret")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks/:id/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyWebhook
Rotate a Webhook Secret
Generates a new signing secret for a webhook.
POST
/
v1
/
webhooks
/
:id
/
rotate-secret
Rotate a Webhook Secret
curl --request POST \
--url https://api.example.com/v1/webhooks/:id/rotate-secretimport requests
url = "https://api.example.com/v1/webhooks/:id/rotate-secret"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/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://api.example.com/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",
]);
$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://api.example.com/v1/webhooks/: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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/webhooks/:id/rotate-secret")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks/:id/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyRotate a Webhook Secret
Generates a new signing secret and returns it once. The previous secret stops working immediately.Request
POST /v1/webhooks/:id/rotate-secret
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | uuid | Yes | The unique identifier of the webhook |
Example
curl -X POST \
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/webhooks/wh-uuid-1/rotate-secret" \
-H "Authorization: Bearer rchd_live_xxxxxxxxxxxx"
const response = await fetch(
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/webhooks/wh-uuid-1/rotate-secret",
{
method: "POST",
headers: {
"Authorization": "Bearer rchd_live_xxxxxxxxxxxx"
}
}
);
const { data } = await response.json();
// Store data.secret securely — the old secret is now invalid
Response
{
"data": {
"id": "wh-uuid-1",
"name": "Data pipeline",
"url": "https://api.yourcompany.com/reached/webhook",
"events": ["call.completed", "transcript.ready"],
"is_active": true,
"secret": "whsec_new_secret_xxxxxxxxxxxx"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | uuid | Webhook unique identifier |
name | string | Human-readable label |
url | string | HTTPS endpoint URL |
events | array | Subscribed event types |
is_active | boolean | Whether the webhook is active |
secret | string | New signing secret (returned only once — store it securely) |
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=967f00940a17d1d8cc11bd8995dc98d0)
.png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=5072033d90dfd5e7cc9349712ea4e145)