curl --request POST \
--url https://api.iwy.ai/v1/tool \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "get_weather",
"description": "Fetches the current weather for a given city",
"server_url": "https://webhook.example.com/weather",
"parameters_schema": {
"type": "object",
"required": [
"city"
],
"properties": {
"city": {
"type": "string",
"description": "The name of the city (e.g., 'Paris' or 'New York')"
}
},
"additionalProperties": false
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"x-api-key": "your-webhook-api-key"
},
"timeout_seconds": 15,
"is_async": false,
"strict_params": true
}
EOFimport requests
url = "https://api.iwy.ai/v1/tool"
payload = {
"name": "get_weather",
"description": "Fetches the current weather for a given city",
"server_url": "https://webhook.example.com/weather",
"parameters_schema": {
"type": "object",
"required": ["city"],
"properties": { "city": {
"type": "string",
"description": "The name of the city (e.g., 'Paris' or 'New York')"
} },
"additionalProperties": False
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"x-api-key": "your-webhook-api-key"
},
"timeout_seconds": 15,
"is_async": False,
"strict_params": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'get_weather',
description: 'Fetches the current weather for a given city',
server_url: 'https://webhook.example.com/weather',
parameters_schema: {
type: 'object',
required: ['city'],
properties: {
city: {
type: 'string',
description: 'The name of the city (e.g., \'Paris\' or \'New York\')'
}
},
additionalProperties: false
},
method: 'POST',
headers: {'Content-Type': 'application/json', 'x-api-key': 'your-webhook-api-key'},
timeout_seconds: 15,
is_async: false,
strict_params: true
})
};
fetch('https://api.iwy.ai/v1/tool', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.iwy.ai/v1/tool",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'get_weather',
'description' => 'Fetches the current weather for a given city',
'server_url' => 'https://webhook.example.com/weather',
'parameters_schema' => [
'type' => 'object',
'required' => [
'city'
],
'properties' => [
'city' => [
'type' => 'string',
'description' => 'The name of the city (e.g., \'Paris\' or \'New York\')'
]
],
'additionalProperties' => false
],
'method' => 'POST',
'headers' => [
'Content-Type' => 'application/json',
'x-api-key' => 'your-webhook-api-key'
],
'timeout_seconds' => 15,
'is_async' => false,
'strict_params' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.iwy.ai/v1/tool"
payload := strings.NewReader("{\n \"name\": \"get_weather\",\n \"description\": \"Fetches the current weather for a given city\",\n \"server_url\": \"https://webhook.example.com/weather\",\n \"parameters_schema\": {\n \"type\": \"object\",\n \"required\": [\n \"city\"\n ],\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"The name of the city (e.g., 'Paris' or 'New York')\"\n }\n },\n \"additionalProperties\": false\n },\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": \"your-webhook-api-key\"\n },\n \"timeout_seconds\": 15,\n \"is_async\": false,\n \"strict_params\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.iwy.ai/v1/tool")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"get_weather\",\n \"description\": \"Fetches the current weather for a given city\",\n \"server_url\": \"https://webhook.example.com/weather\",\n \"parameters_schema\": {\n \"type\": \"object\",\n \"required\": [\n \"city\"\n ],\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"The name of the city (e.g., 'Paris' or 'New York')\"\n }\n },\n \"additionalProperties\": false\n },\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": \"your-webhook-api-key\"\n },\n \"timeout_seconds\": 15,\n \"is_async\": false,\n \"strict_params\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iwy.ai/v1/tool")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"get_weather\",\n \"description\": \"Fetches the current weather for a given city\",\n \"server_url\": \"https://webhook.example.com/weather\",\n \"parameters_schema\": {\n \"type\": \"object\",\n \"required\": [\n \"city\"\n ],\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"The name of the city (e.g., 'Paris' or 'New York')\"\n }\n },\n \"additionalProperties\": false\n },\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": \"your-webhook-api-key\"\n },\n \"timeout_seconds\": 15,\n \"is_async\": false,\n \"strict_params\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "get_weather",
"description": "Fetches the current weather for a given city",
"server_url": "https://webhook.example.com/weather",
"parameters_schema": {
"type": "object",
"required": [
"city"
],
"properties": {
"city": {
"type": "string",
"description": "The name of the city"
}
},
"additionalProperties": false
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"x-api-key": "your-key"
},
"timeout_seconds": 20,
"is_async": false,
"strict_params": true,
"auth_config": {},
"tags": [
"<string>"
]
}{
"success": false,
"error": "Bad request",
"details": "Missing required field: name"
}{
"success": false,
"error": "Unauthorized",
"details": "Invalid or missing API key"
}{
"success": false,
"error": "Internal server error",
"details": "An unexpected error occurred"
}Create a new tool
Creates a new custom tool that agents can use. Tools are defined by their parameters schema (JSON Schema format) and the webhook endpoint they call.
curl --request POST \
--url https://api.iwy.ai/v1/tool \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"name": "get_weather",
"description": "Fetches the current weather for a given city",
"server_url": "https://webhook.example.com/weather",
"parameters_schema": {
"type": "object",
"required": [
"city"
],
"properties": {
"city": {
"type": "string",
"description": "The name of the city (e.g., 'Paris' or 'New York')"
}
},
"additionalProperties": false
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"x-api-key": "your-webhook-api-key"
},
"timeout_seconds": 15,
"is_async": false,
"strict_params": true
}
EOFimport requests
url = "https://api.iwy.ai/v1/tool"
payload = {
"name": "get_weather",
"description": "Fetches the current weather for a given city",
"server_url": "https://webhook.example.com/weather",
"parameters_schema": {
"type": "object",
"required": ["city"],
"properties": { "city": {
"type": "string",
"description": "The name of the city (e.g., 'Paris' or 'New York')"
} },
"additionalProperties": False
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"x-api-key": "your-webhook-api-key"
},
"timeout_seconds": 15,
"is_async": False,
"strict_params": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'get_weather',
description: 'Fetches the current weather for a given city',
server_url: 'https://webhook.example.com/weather',
parameters_schema: {
type: 'object',
required: ['city'],
properties: {
city: {
type: 'string',
description: 'The name of the city (e.g., \'Paris\' or \'New York\')'
}
},
additionalProperties: false
},
method: 'POST',
headers: {'Content-Type': 'application/json', 'x-api-key': 'your-webhook-api-key'},
timeout_seconds: 15,
is_async: false,
strict_params: true
})
};
fetch('https://api.iwy.ai/v1/tool', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.iwy.ai/v1/tool",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'get_weather',
'description' => 'Fetches the current weather for a given city',
'server_url' => 'https://webhook.example.com/weather',
'parameters_schema' => [
'type' => 'object',
'required' => [
'city'
],
'properties' => [
'city' => [
'type' => 'string',
'description' => 'The name of the city (e.g., \'Paris\' or \'New York\')'
]
],
'additionalProperties' => false
],
'method' => 'POST',
'headers' => [
'Content-Type' => 'application/json',
'x-api-key' => 'your-webhook-api-key'
],
'timeout_seconds' => 15,
'is_async' => false,
'strict_params' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.iwy.ai/v1/tool"
payload := strings.NewReader("{\n \"name\": \"get_weather\",\n \"description\": \"Fetches the current weather for a given city\",\n \"server_url\": \"https://webhook.example.com/weather\",\n \"parameters_schema\": {\n \"type\": \"object\",\n \"required\": [\n \"city\"\n ],\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"The name of the city (e.g., 'Paris' or 'New York')\"\n }\n },\n \"additionalProperties\": false\n },\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": \"your-webhook-api-key\"\n },\n \"timeout_seconds\": 15,\n \"is_async\": false,\n \"strict_params\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.iwy.ai/v1/tool")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"get_weather\",\n \"description\": \"Fetches the current weather for a given city\",\n \"server_url\": \"https://webhook.example.com/weather\",\n \"parameters_schema\": {\n \"type\": \"object\",\n \"required\": [\n \"city\"\n ],\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"The name of the city (e.g., 'Paris' or 'New York')\"\n }\n },\n \"additionalProperties\": false\n },\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": \"your-webhook-api-key\"\n },\n \"timeout_seconds\": 15,\n \"is_async\": false,\n \"strict_params\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iwy.ai/v1/tool")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"get_weather\",\n \"description\": \"Fetches the current weather for a given city\",\n \"server_url\": \"https://webhook.example.com/weather\",\n \"parameters_schema\": {\n \"type\": \"object\",\n \"required\": [\n \"city\"\n ],\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"The name of the city (e.g., 'Paris' or 'New York')\"\n }\n },\n \"additionalProperties\": false\n },\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": \"your-webhook-api-key\"\n },\n \"timeout_seconds\": 15,\n \"is_async\": false,\n \"strict_params\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "get_weather",
"description": "Fetches the current weather for a given city",
"server_url": "https://webhook.example.com/weather",
"parameters_schema": {
"type": "object",
"required": [
"city"
],
"properties": {
"city": {
"type": "string",
"description": "The name of the city"
}
},
"additionalProperties": false
},
"method": "POST",
"headers": {
"Content-Type": "application/json",
"x-api-key": "your-key"
},
"timeout_seconds": 20,
"is_async": false,
"strict_params": true,
"auth_config": {},
"tags": [
"<string>"
]
}{
"success": false,
"error": "Bad request",
"details": "Missing required field: name"
}{
"success": false,
"error": "Unauthorized",
"details": "Invalid or missing API key"
}{
"success": false,
"error": "Internal server error",
"details": "An unexpected error occurred"
}Authorizations
Your iwy Service API Key. Find it at app.iwy.ai/settings.
Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Body
Function name (snake_case)
"get_weather"
Clear explanation of what the tool does
"Fetches the current weather for a given city"
Webhook endpoint URL
JSON Schema defining the tool's parameters
POST, GET, PUT, PATCH, DELETE 1 <= x <= 300Response
Tool created successfully
Complete tool configuration
Unique identifier for the tool
ID of the user who owns this tool
Function name (snake_case)
"get_weather"
Clear explanation of what the tool does
"Fetches the current weather for a given city"
Webhook endpoint URL
"https://webhook.example.com/weather"
JSON Schema defining the tool's parameters
{
"type": "object",
"required": ["city"],
"properties": {
"city": {
"type": "string",
"description": "The name of the city"
}
},
"additionalProperties": false
}
HTTP method
POST, GET, PUT, PATCH, DELETE Custom HTTP headers
{
"Content-Type": "application/json",
"x-api-key": "your-key"
}
Request timeout in seconds
1 <= x <= 300Whether the tool runs asynchronously
Whether to strictly validate parameters
Authentication configuration
Tags for organization