Skip to content
Rotate a hook signing secret

Rotate a hook signing secret

Replace a hook's signing secret immediately and return the new value once.

POST/api/v1/tool-hooks/:id/rotate-secret

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-hooks/72b98ef7-4750-4521-b11d-82c114aa56f4/rotate-secret", {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();

Use your server-side apiKey. Replace the example IDs.

Path parameters#

idUUIDrequired

The hook ID returned during creation or listing.

Responses#

Returns only signingSecret. Update your endpoint immediately; there is no overlap period.

200 response
{
  "signingSecret": "whsec_new_secret"
}
More about this endpoint

A hook that fails signature verification is unavailable and denies the tool call.