Skip to main content
POST
/
user
/
tools
Create mid call tool
curl --request POST \
  --url https://app.autocalls.ai/api/user/tools \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "endpoint": "<string>",
  "method": "<string>",
  "timeout": 123,
  "headers": [
    {
      "name": "<string>",
      "value": "<string>"
    }
  ],
  "schema": [
    {
      "name": "<string>",
      "type": "<string>",
      "description": "<string>"
    }
  ]
}'
{
  "message": "Tool created successfully",
  "data": {
    "id": 1,
    "name": "check_order_status",
    "description": "Use this tool to check the status of a customer's order.",
    "endpoint": "https://api.yourstore.com/orders/status",
    "method": "GET",
    "timeout": 10,
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer sk_..."
      }
    ],
    "schema": [
      {
        "name": "order_id",
        "type": "string",
        "description": "The customer's order ID"
      },
      {
        "name": "order_number",
        "type": "number",
        "description": "The numeric order number"
      },
      {
        "name": "priority_order",
        "type": "boolean",
        "description": "Whether this is a priority order"
      }
    ],
    "created_at": "2025-10-10T12:00:00.000000Z",
    "updated_at": "2025-10-10T12:00:00.000000Z"
  }
}
This endpoint allows you to create a new mid call tool that can be used by your AI assistants to interact with external APIs during calls.

Body Parameters

name
string
required
Tool name - must contain only lowercase letters and underscores, and start with a letter (e.g., get_weather, book_appointment)
description
string
required
Detailed explanation of when and how the AI should use this tool (max 255 characters)
endpoint
string
required
Valid URL of the API endpoint to call
method
string
required
HTTP method: GET, POST, PUT, PATCH, or DELETE
timeout
integer
Request timeout in seconds (1-30, default: 10)
headers
array
HTTP headers to send with the request
schema
array
Parameters that the AI will extract from conversation and send to the endpoint

Response fields

message
string
Success message
data
object
The created tool object
{
  "message": "Tool created successfully",
  "data": {
    "id": 1,
    "name": "check_order_status",
    "description": "Use this tool to check the status of a customer's order.",
    "endpoint": "https://api.yourstore.com/orders/status",
    "method": "GET",
    "timeout": 10,
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer sk_..."
      }
    ],
    "schema": [
      {
        "name": "order_id",
        "type": "string",
        "description": "The customer's order ID"
      },
      {
        "name": "order_number",
        "type": "number",
        "description": "The numeric order number"
      },
      {
        "name": "priority_order",
        "type": "boolean",
        "description": "Whether this is a priority order"
      }
    ],
    "created_at": "2025-10-10T12:00:00.000000Z",
    "updated_at": "2025-10-10T12:00:00.000000Z"
  }
}

Attaching Tools to Assistants

After creating a tool, you need to attach it to an assistant to use it during calls. Tools are managed through the Assistant API:
  • Create Assistant - Use the tool_ids parameter to attach tools when creating an assistant
  • Update Assistant - Use the tool_ids parameter to add, remove, or replace tools on an existing assistant
I