Skip to main content

Start an AI tool run from the widget

POST 

/api/widget/tools/runs

PUBLIC endpoint (anonymous visitors, NO staff auth) — doc 97 §13. Starts a run of a tool profile the workspace offers in the widget (the profiles in the session config's ai_tools). The run belongs to the contact in the verified session token, never to anything the client names; the visitor must hold a live session (the check that stands in for a captcha).

Consent comes BEFORE the upload: when the profile requires it, send back the consent.version the config gave you (the sha256 of the exact text shown). A missing or stale version is refused with 409 consent_required and the current text and version; nothing is stored.

The run goes through the same gates as one from a conversation (plan, workspace switch, the profile offered in the widget and on this page's host, kill switch, per-person/day and per-workspace limits, wallet). A gate refusal is still 201 — the run exists, in state refused, with the profile's own message. Starting is throttled per session, per IP and per widget key (429).

Request​

Responses​

The run (pending, or refused by a gate).