Skip to content
Update a hook

Update a hook

Edit a saved hook's endpoint URL or timeout while retaining its scope and secret.

PATCH/api/v1/tool-hooks/:id

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/tool-hooks/72b98ef7-4750-4521-b11d-82c114aa56f4", {
  method: "PATCH",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "timeoutSeconds": 10
}),
});
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.

Request body#

urlstring

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.

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.

200 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": 10,
  "createdAt": "2026-10-22T10:00:00.000Z",
  "updatedAt": "2026-10-22T10:00:00.000Z"
}
More about this endpoint

Omitted fields retain their current values. Existing saved-hook edits keep their existing behavior and do not require a new draft verification token.