Set a World override
Set one tool's policy for every user in a World.
/api/v1/worlds/:worldId/tool-policies/:integration/:toolNameconst response = await fetch("https://api.smallworld.sh/api/v1/worlds/01995e56-e2d4-7f19-b691-7bf9af6abdc8/tool-policies/acme/get_order", {
method: "PUT",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"policy": "ask"
}),
});
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#
worldIdUUIDrequiredThe World ID shown in the dashboard.
integrationstringrequiredAn integration key from GET /integrations, such as github or notion.
toolNamestringrequiredThe integration's own tool name, as toolName in GET /tool-policies and in tool calls. URL-encode it.
Request body#
policystringrequiredallow runs the tool without asking, ask waits for an approval, and deny hides the tool from agents. To remove the override, use DELETE.
Responses#
Returns integration, toolName, policy (the setting at this level: allow, ask, deny, or inherit when there is no override), effectivePolicy (allow, ask, or deny), and source: integration_default, world_override, group_override, user_override, workspace_hidden, group_hidden, or disabled.
{
"integration": "acme",
"toolName": "get_order",
"policy": "ask",
"effectivePolicy": "ask",
"source": "world_override"
}
More about this endpoint
The override applies to the next tool call. deny hides the tool in this World, also for users with their own override.
A tool the workspace hides stays hidden: the override is saved, and the response shows effectivePolicy deny with source workspace_hidden.
A call already waiting for approval keeps waiting. If the tool is now hidden, approving it returns approval_policy_denied.