Respond to a provider approval
Submit the person's choice for the provider prompt currently attached to a pending tool call.
/api/v1/tool-approvals/:id/provider/:approvalIdconst response = await fetch("https://api.smallworld.sh/api/v1/tool-approvals/b5212df0-ea8b-4eb8-a7b1-057ff45b3044/provider/69b8aa84-bcbd-4f8b-833c-f414760d9449", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"choice": "ALLOW_ONCE"
}),
});
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#
idUUIDrequiredThe pending tool-call ID from toolCalls or the tool-approvals list.
approvalIdUUIDrequiredThe current providerApproval.id, URL-encoded. Read it again whenever the pending call changes.
Request body#
choicestringrequiredThe exact value of the providerApproval.choices entry selected by the person.
Responses#
The choice was accepted. Continue reading the execution for the provider's result or another prompt.
{
"id": "b5212df0-ea8b-4eb8-a7b1-057ff45b3044",
"sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
"executionId": "01995e57-3027-7557-a233-009ea3dcd8fc",
"userId": "customer_123",
"worldId": "01995e56-e2d4-7f19-b691-7bf9af6abdc8",
"integration": "gmail",
"integrationName": "Gmail",
"account": "support@example.com",
"connectionSource": "group",
"group": {
"id": "team_42",
"name": "Support team"
},
"toolName": "trash_thread",
"toolDescription": "Move a conversation to Trash.",
"toolLabel": "destructive",
"arguments": {
"threadId": "thread_456"
},
"status": "approved",
"result": null,
"error": null,
"errorCode": null,
"reason": null,
"providerApproval": null,
"hooks": [],
"createdAt": "2026-10-10T12:00:00.000Z",
"expiresAt": "2026-10-10T12:15:00.000Z",
"completedAt": null,
"decidedAt": "2026-10-10T12:00:01.000Z"
}
More about this endpoint
Authorize the acting user for this tool call and identify its account, connectionSource, and group before showing the provider's message, question, and choices.
Render every offered choice label and submit its value after the person selects it. Choices and their meanings belong to the provider and can change between prompts.
Bind the decision to both the tool-call ID and providerApproval.id. The same call may pause again with a new providerApproval.id; refresh the execution and render that new prompt.
The body accepts only choice. A provider choice never changes Smallworld's tool policy. Any offered persistent permission applies at the provider.
Repeating the same choice for the same providerApproval.id returns the current tool call without another dispatch. A stale prompt or a different choice returns a conflict. After a lost response, read the execution before retrying.
The response is a tool call. Continue polling its execution for the provider result or another approval prompt.