Skip to main content
POST
Create or Update API Tool
An API tool lets a goal bot call your endpoint mid-conversation — check stock, look up an order, fetch a balance — and use the answer in its reply. Attach a tool to a bot by putting its _id in that bot’s allowedToolIds.
One endpoint does both jobs. Omit id to create; pass id to update that tool in place.

Authentication

Pass your workspace API key as a Bearer token, or use a Clerk session token.

Request body

string
Omit to create a new tool. Pass an existing tool _id to update it — every other field is overwritten with what you send, so send the complete tool.
string
required
Tool name. Also derives variableKey (the variable a bot reads the result from), so keep it short and snake_case — check_stock becomes api_check_stock. A blank name returns 400 Tool name is required.
string
required
The endpoint Tuco calls. Must be a reachable public URL — private, local and blocked hosts return 400 Tool URL is invalid or blocked.
string
required
Dot path into your response that becomes the tool’s value, e.g. data.quantity. Blank returns 400 Response mapping is required.
string
default:"GET"
One of GET, POST, PUT, PATCH, DELETE. Any other value silently falls back to GET — read method back from the response to confirm.
string
What the tool does. The model reads this when deciding whether to call it, so write it for the model, not for a human changelog.
object
Flat object of header name → value, e.g. { "Authorization": "Bearer abc123" }. Non-string values and blank names are dropped.
string
Request body template sent with POST/PUT/PATCH. A string, not an object. Lead fields can be interpolated into it.

Example — create

Example — update

Success (200 OK)

Run it once with POST /api/campaign-tools/test before you attach it to a bot — that returns the live response and the mapped value.

Errors