Skip to content
Create hook draft credentials

Create hook draft credentials

Generate credentials for configuring a hook endpoint before activation.

POST/api/v1/tool-hooks/draft

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-hooks/draft", {
  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.

Responses#

Returns draftToken and signingSecret without persisting or activating a hook. Configure your endpoint with the secret before testing.

200 response
{
  "draftToken": "owner_bound_draft_token",
  "signingSecret": "whsec_save_this_secret"
}
More about this endpoint

The draft expires after 24 hours and is bound to the workspace. Reuse it for the test and create steps.