Create an API tool

Create a reusable HTTP tool. Attach it to assistants afterwards through their api_tools field.

Endpoint

POST
/api-tools

Body

NameTypeRequiredDescription
organization_idintegerYesYour API key's organization ID.
namestringYesTool name shown to the AI.
endpointstringYesFull URL, with path placeholders such as {order_id}.
methodstringYesGET or POST.
parameters_schemaobjectYesJSON Schema of the arguments the AI provides. Use { "type": "object", "properties": {} } when there are none.
descriptionstringNoWhat the tool does.
url_parametersarrayNoPath and query parameters.
body_parametersarrayNoJSON body parameters for POST tools.
headersobjectNoHeaders sent with every request.
response_exampleobjectNoExample response, for reference.

Request

A

POST
tool with an AI value and a fixed value:

Response

The created API tool object, including id, created_at, updated_at and deleted_at: null.

Errors

StatusWhen
400A required field is missing, method is not GET or POST, or a field has the wrong type.
403organization_id is missing or is not your API key's organization.

Report an issue with this documentation

Please log in to report issues with our documentation.