Create an API tool
Create a reusable HTTP tool. Attach it to assistants afterwards through their api_tools field.
Endpoint
POST/api-tools
Body
| Name | Type | Required | Description |
|---|---|---|---|
organization_id | integer | Yes | Your API key's organization ID. |
name | string | Yes | Tool name shown to the AI. |
endpoint | string | Yes | Full URL, with path placeholders such as {order_id}. |
method | string | Yes | GET or POST. |
parameters_schema | object | Yes | JSON Schema of the arguments the AI provides. Use { "type": "object", "properties": {} } when there are none. |
description | string | No | What the tool does. |
url_parameters | array | No | Path and query parameters. |
body_parameters | array | No | JSON body parameters for POST tools. |
headers | object | No | Headers sent with every request. |
response_example | object | No | Example response, for reference. |
Request
A POSTtool 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
| Status | When |
|---|---|
400 | A required field is missing, method is not GET or POST, or a field has the wrong type. |
403 | organization_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.