Skip to content
Create a verified hook

Create a verified hook

Activate the exact hook configuration that returned a valid signed setup response.

POST/api/v1/tool-hooks

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-hooks", {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "providerKey": null,
  "url": "https://hooks.example.com/check",
  "timeoutSeconds": 30,
  "draftToken": "draft_token_from_previous_step",
  "verificationToken": "configuration_bound_verification_token"
}),
});
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.

Request body#

providerKeystring | nullrequired

An enabled integration key, mounts for agents' changes to mounts, or null for a global hook. Multiple hooks per scope are allowed.

mountIdstring | null

With providerKey mounts: the one mount the hook checks. Leave it out or send null to check every mount.

urlstringrequired

Public HTTPS URL without credentials or a fragment. Loopback HTTP is accepted only in development/test.

timeoutSecondsinteger

Timeout from 1 to 60 seconds; defaults to 30.

draftTokenstringrequired

Owner-bound draft token returned by POST /tool-hooks/draft. Expires after 24 hours.

verificationTokenstringrequired

Non-null verificationToken returned by the successful draft test.

Responses#

Returns hook ID, global/integration scope, nullable provider key/name/enablement, mountId and mountPath for a hook scoped to one mount, endpoint URL, timeoutSeconds, and timestamps. The saved signing secret is never returned by listing or editing. Creation returns signingSecret once, preserving the secret already configured and tested.

201 response
{
  "id": "72b98ef7-4750-4521-b11d-82c114aa56f4",
  "scope": "global",
  "providerKey": null,
  "mountId": null,
  "mountPath": null,
  "integrationName": null,
  "integrationEnabled": null,
  "url": "https://hooks.example.com/check",
  "timeoutSeconds": 30,
  "createdAt": "2026-10-22T10:00:00.000Z",
  "updatedAt": "2026-10-22T10:00:00.000Z",
  "signingSecret": "whsec_same_secret_as_draft"
}
More about this endpoint

Changing scope, URL, timeout, or draft requires another successful draft test. Creation itself does not send another request.