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>",
  "body_format": "<string>",
  "timeout": 123,
  "headers": [
    {
      "name": "<string>",
      "value": "<string>"
    }
  ],
  "static_fields": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "schema": [
    {
      "name": "<string>",
      "type": "<string>",
      "description": "<string>",
      "required": true
    }
  ]
}
'
{
  "message": "Tool created successfully",
  "data": {
    "id": 1,
    "name": "check_order_status",
    "description": "Use this tool to check the status of a customer's order.",
    "type": "http",
    "endpoint": "https://api.yourstore.com/orders/{order_id}/status",
    "method": "GET",
    "body_format": "json",
    "timeout": 10,
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer {{crm_key}}"
      }
    ],
    "static_fields": [
      {
        "key": "source",
        "value": "autocalls"
      },
      {
        "key": "caller",
        "value": "{{customer_phone}}"
      }
    ],
    "schema": [
      {
        "name": "order_id",
        "type": "string",
        "description": "The customer's order ID",
        "required": true
      },
      {
        "name": "amount",
        "type": "float",
        "description": "Order total as a decimal, e.g. 19.99",
        "required": false
      },
      {
        "name": "priority_order",
        "type": "boolean",
        "description": "Whether this is a priority order",
        "required": false
      }
    ],
    "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

The public API creates HTTP request tools. Automation Platform tools (which generate a linked flow) are created from the dashboard. Tool values support dynamic variables — use {param} for AI-extracted parameters in the URL, and {{variable}} (e.g. {{customer_phone}}) in the URL, header values, and static field values.
name
string
required
Tool name — letters, numbers and underscores, starting with a letter or underscore (max 64 characters, 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 (max 2048 characters)
method
string
required
HTTP method: GET, POST, PUT, PATCH, or DELETE
body_format
string
How the request body is encoded for write methods (POST/PUT/PATCH): json (default) or form (application/x-www-form-urlencoded)
timeout
integer
Request timeout in seconds (1-30, default: 10)
headers
array
HTTP headers to send with the request
static_fields
array
Fixed key/value pairs always sent with the request (the AI never changes them)
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.",
    "type": "http",
    "endpoint": "https://api.yourstore.com/orders/{order_id}/status",
    "method": "GET",
    "body_format": "json",
    "timeout": 10,
    "headers": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "Authorization",
        "value": "Bearer {{crm_key}}"
      }
    ],
    "static_fields": [
      {
        "key": "source",
        "value": "autocalls"
      },
      {
        "key": "caller",
        "value": "{{customer_phone}}"
      }
    ],
    "schema": [
      {
        "name": "order_id",
        "type": "string",
        "description": "The customer's order ID",
        "required": true
      },
      {
        "name": "amount",
        "type": "float",
        "description": "Order total as a decimal, e.g. 19.99",
        "required": false
      },
      {
        "name": "priority_order",
        "type": "boolean",
        "description": "Whether this is a priority order",
        "required": false
      }
    ],
    "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