Developer Docs Logo
API RequestsAPI SchemaBots

Create a new API tool for a bot

POST/v1/bots/{bot_id}/api-tools

Creates a new API-type chatbot tool that can make HTTP requests to external endpoints. Tools created here will share the same prefix as the normally created tools, therefore it is recommended to use a unique name for the tool created here to prevent conflicts. Requires bot:write scope.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

bot_id*string

The unique identifier (UUID) of the bot.

Formatuuid

Request Body

application/json

Payload describing the API tool to create.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/bots/d1c6a7f3-0e2b-494c-87f9-94a7a6f9e9cf/api-tools" \  -H "Content-Type: application/json" \  -d '{    "name": "Get User Info",    "description": "Fetches user information from the API",    "needs_confirmation": true,    "confirmation_expiry_minutes": 60,    "is_hidden": false,    "parameters": {      "properties": {        "api_config": {          "method": "GET",          "url": "https://api.example.com/users",          "headers": {            "Authorization": "Bearer token"          },          "additional_payload": {            "source": "chatbot"          }        },        "llm_response_prompt": "Parse the user data and provide a summary",        "payload": {          "properties": {            "user_id": {              "type": "string",              "description": "The ID of the user to fetch",              "required": true            },            "include_details": {              "type": "boolean",              "description": "Whether to include detailed information",              "required": false            }          }        },        "human_assistance_config": {          "is_active": true,          "status_codes": [            "5XX",            "401-403"          ]        }      }    }  }'
Empty