Rotate an endpoint's signing secret
/v1/webhooks/endpoints/{endpointId}/actions/rotate-secret Gives the endpoint a new signing secret, answered this once. The new secret signs every call from now on; for 24 hours each call's Rabbitflare-Signature header also carries a second v1= made with the old secret, so your receiver can switch over without missing an event.
Rotating again within the 24 hours ends the old secret at once.
Only for an endpoint added with this token: whoever holds a secret can sign calls its receiver takes for ours, so the secret of an endpoint added in the panel, or with another token, is rolled in the panel (403 panel_only here).
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
webhooks:write - Manage webhooks. Add, change and remove webhook endpoints.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key | string 1 to 255 characters A key of your own for this request, like a UUID: letters, digits and |
Path parameters
| Field | Type and description |
|---|---|
endpointId Required | string The endpoint's id. |
Example request
curl -X POST "https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
const data = await rf.webhooks.endpoints.rotateSecret({
endpointId: "3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
});
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import os
import requests
response = requests.post(
"https://api.rabbitflare.com/v1/webhooks/endpoints/3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b/actions/rotate-secret",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the WebhookEndpointWithSecret object in data.
The WebhookEndpointWithSecret object's fields 14 fields
| Field | Type and description |
|---|---|
id | string The endpoint's id. |
url | string Where events are sent: an https URL on port 443 or 8443. |
description | string or null Your own note about the endpoint, or |
events | array of strings The event types sent to it (see |
allServers | boolean Whether it gets events of every server (and of account-wide things). False: only those in |
serverIds | array of strings The servers whose events it gets, when |
status | string
Known values: |
disabledReason | string or null Why it's off: Known values: |
failingSince | string or null An ISO 8601 time, in UTC Since when its deliveries have failed with no success in between. |
lastSuccessAt | string or null An ISO 8601 time, in UTC When a delivery to it last succeeded, or |
lastFailureAt | string or null An ISO 8601 time, in UTC When a delivery attempt to it last failed, or |
createdAt | string An ISO 8601 time, in UTC When it was added. |
updatedAt | string An ISO 8601 time, in UTC When its settings last changed. |
secret | string The endpoint's signing secret ( |
Example response
{
"data": {
"id": "3c6f9a1e-2b4d-4e8f-9a0b-1c2d3e4f5a6b",
"url": "https://hooks.example.com/rabbitflare",
"description": "Deploy notifications",
"events": [
"server.ready",
"site.ready",
"site.install_failed"
],
"allServers": true,
"serverIds": [],
"status": "enabled",
"disabledReason": null,
"failingSince": null,
"lastSuccessAt": "2026-11-18T09:12:03.000Z",
"lastFailureAt": null,
"createdAt": "2026-11-18T08:46:49.000Z",
"updatedAt": "2026-11-18T08:46:49.000Z",
"secret": "rfwhsec_7Kq2mPq4Xc7Lw9Tn0Bv3YsA1b2C3d4E5"
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
403 panel_ | This can only be done in the control panel: for example, rotating the signing secret of a webhook endpoint added in the panel or with another API token. Do it in the control panel, signed in as the account's owner (for a signing secret: API, then Webhooks, then the endpoint). |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |