Skip to main content
POST
/
ai
/
tools
Create AI tool
curl --request POST \
  --url https://api.wacht.dev/ai/tools \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Get User Info",
  "tool_type": "api",
  "configuration": {
    "type": "api",
    "endpoint": "https://api.example.com/users",
    "method": "GET",
    "authorization": {
      "authorize_as_user": true,
      "jwt_template_id": 123,
      "custom_headers": [
        {
          "name": "user_id",
          "field_type": "string",
          "required": true,
          "description": "User ID",
          "items_type": "string"
        }
      ]
    },
    "request_body_schema": [
      {
        "name": "user_id",
        "field_type": "string",
        "required": true,
        "description": "User ID",
        "items_type": "string"
      }
    ],
    "url_params_schema": [
      {
        "name": "user_id",
        "field_type": "string",
        "required": true,
        "description": "User ID",
        "items_type": "string"
      }
    ],
    "timeout_seconds": 30
  },
  "description": "Retrieves user information from the database"
}
'
{
  "id": "1234567890123456789",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "name": "Get User Info",
  "description": "Retrieves user information",
  "tool_type": "api",
  "deployment_id": "9876543210987654321",
  "configuration": {
    "type": "api",
    "endpoint": "https://api.example.com/users",
    "method": "GET",
    "authorization": {
      "authorize_as_user": true,
      "jwt_template_id": 123,
      "custom_headers": [
        {
          "name": "user_id",
          "field_type": "string",
          "required": true,
          "description": "User ID",
          "items_type": "string"
        }
      ]
    },
    "request_body_schema": [
      {
        "name": "user_id",
        "field_type": "string",
        "required": true,
        "description": "User ID",
        "items_type": "string"
      }
    ],
    "url_params_schema": [
      {
        "name": "user_id",
        "field_type": "string",
        "required": true,
        "description": "User ID",
        "items_type": "string"
      }
    ],
    "timeout_seconds": 30
  }
}

Authorizations

Authorization
string
header
required

API key authentication (format: Bearer {api_key})

Body

application/json
name
string
required

Tool name

Example:

"Get User Info"

tool_type
enum<string>
required

Type of AI tool

Available options:
api,
platform_event,
platform_function,
internal,
use_external_service
Example:

"api"

configuration
object
required
description
string

Tool description

Example:

"Retrieves user information from the database"

Response

200 - application/json

AI tool created

id
string
Example:

"1234567890123456789"

created_at
string<date-time>
Example:

"2024-01-15T10:30:00Z"

updated_at
string<date-time>
Example:

"2024-01-15T10:30:00Z"

name
string
Example:

"Get User Info"

description
string | null
Example:

"Retrieves user information"

tool_type
enum<string>

Type of AI tool

Available options:
api,
platform_event,
platform_function,
internal,
use_external_service
deployment_id
string
Example:

"9876543210987654321"

configuration
object