Skip to main content
POST
/
user
/
tools
Създаване на инструмент за време на повикване
curl --request POST \
  --url https://call.aiployees.com/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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.aiployees.com/llms.txt

Use this file to discover all available pages before exploring further.

Този endpoint ви позволява да създадете нов инструмент за време на повикване, който може да бъде използван от вашите AI асистенти за взаимодействие с външни API по време на повиквания.

Параметри в тялото на заявката

name
string
required
Име на инструмента - трябва да съдържа само малки букви и долни черти, и да започва с буква (например, get_weather, book_appointment)
description
string
required
Подробно обяснение кога и как AI трябва да използва този инструмент (максимум 255 символа)
endpoint
string
required
Валиден URL на API endpoint за извикване
method
string
required
HTTP метод: GET, POST, PUT, PATCH, или DELETE
timeout
integer
Timeout на заявката в секунди (1-30, по подразбиране: 10)
headers
array
HTTP headers за изпращане с заявката
schema
array
Параметри, които AI ще извлече от разговора и ще изпрати до endpoint

Полета в отговора

message
string
Съобщение за успех
data
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"
  }
}

Прикачване на инструменти към асистенти

След създаването на инструмент, трябва да го прикачите към асистент за да го използвате по време на повиквания. Инструментите се управляват чрез Assistant API:
  • Създаване на асистент - Използвайте параметъра tool_ids за да прикачите инструменти при създаване на асистент
  • Актуализиране на асистент - Използвайте параметъра tool_ids за да добавите, премахнете или заместите инструменти на съществуващ асистент