curl --request POST \
--url https://api.pyai.com/v1/tools/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"input_schema": {},
"config_schema": {
"fields": [
{
"key": "<string>",
"label": "<string>",
"required": false,
"secret": false,
"help": "<string>",
"placeholder": "<string>",
"options": [
"<string>"
]
}
]
},
"webhook_url": "<string>",
"auth_header": "<string>",
"auth_secret": "<string>",
"timeout_ms": 7550,
"rotate_secret": true
}
'import requests
url = "https://api.pyai.com/v1/tools/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"input_schema": {},
"config_schema": { "fields": [
{
"key": "<string>",
"label": "<string>",
"required": False,
"secret": False,
"help": "<string>",
"placeholder": "<string>",
"options": ["<string>"]
}
] },
"webhook_url": "<string>",
"auth_header": "<string>",
"auth_secret": "<string>",
"timeout_ms": 7550,
"rotate_secret": 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: '<string>',
description: '<string>',
input_schema: {},
config_schema: {
fields: [
{
key: '<string>',
label: '<string>',
required: false,
secret: false,
help: '<string>',
placeholder: '<string>',
options: ['<string>']
}
]
},
webhook_url: '<string>',
auth_header: '<string>',
auth_secret: '<string>',
timeout_ms: 7550,
rotate_secret: true
})
};
fetch('https://api.pyai.com/v1/tools/{id}', 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.pyai.com/v1/tools/{id}",
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' => '<string>',
'description' => '<string>',
'input_schema' => [
],
'config_schema' => [
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'required' => false,
'secret' => false,
'help' => '<string>',
'placeholder' => '<string>',
'options' => [
'<string>'
]
]
]
],
'webhook_url' => '<string>',
'auth_header' => '<string>',
'auth_secret' => '<string>',
'timeout_ms' => 7550,
'rotate_secret' => 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.pyai.com/v1/tools/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"input_schema\": {},\n \"config_schema\": {\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": false,\n \"secret\": false,\n \"help\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"webhook_url\": \"<string>\",\n \"auth_header\": \"<string>\",\n \"auth_secret\": \"<string>\",\n \"timeout_ms\": 7550,\n \"rotate_secret\": 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.pyai.com/v1/tools/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"input_schema\": {},\n \"config_schema\": {\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": false,\n \"secret\": false,\n \"help\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"webhook_url\": \"<string>\",\n \"auth_header\": \"<string>\",\n \"auth_secret\": \"<string>\",\n \"timeout_ms\": 7550,\n \"rotate_secret\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/tools/{id}")
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\": \"<string>\",\n \"description\": \"<string>\",\n \"input_schema\": {},\n \"config_schema\": {\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": false,\n \"secret\": false,\n \"help\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"webhook_url\": \"<string>\",\n \"auth_header\": \"<string>\",\n \"auth_secret\": \"<string>\",\n \"timeout_ms\": 7550,\n \"rotate_secret\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "tool",
"id": "<string>",
"org_id": "<string>",
"name": "<string>",
"description": "<string>",
"input_schema": {},
"config_schema": {
"fields": [
{
"key": "<string>",
"label": "<string>",
"required": false,
"secret": false,
"help": "<string>",
"placeholder": "<string>",
"options": [
"<string>"
]
}
]
},
"webhook_url": "<string>",
"auth_header": "<string>",
"has_auth": true,
"timeout_ms": 123,
"created_at": 123,
"hmac_secret": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}Update a tool
Update a tool by id. Pass rotate_secret: true to mint a new webhook signing secret, returned once as hmac_secret. Requires the omni:session scope.
curl --request POST \
--url https://api.pyai.com/v1/tools/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"input_schema": {},
"config_schema": {
"fields": [
{
"key": "<string>",
"label": "<string>",
"required": false,
"secret": false,
"help": "<string>",
"placeholder": "<string>",
"options": [
"<string>"
]
}
]
},
"webhook_url": "<string>",
"auth_header": "<string>",
"auth_secret": "<string>",
"timeout_ms": 7550,
"rotate_secret": true
}
'import requests
url = "https://api.pyai.com/v1/tools/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"input_schema": {},
"config_schema": { "fields": [
{
"key": "<string>",
"label": "<string>",
"required": False,
"secret": False,
"help": "<string>",
"placeholder": "<string>",
"options": ["<string>"]
}
] },
"webhook_url": "<string>",
"auth_header": "<string>",
"auth_secret": "<string>",
"timeout_ms": 7550,
"rotate_secret": 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: '<string>',
description: '<string>',
input_schema: {},
config_schema: {
fields: [
{
key: '<string>',
label: '<string>',
required: false,
secret: false,
help: '<string>',
placeholder: '<string>',
options: ['<string>']
}
]
},
webhook_url: '<string>',
auth_header: '<string>',
auth_secret: '<string>',
timeout_ms: 7550,
rotate_secret: true
})
};
fetch('https://api.pyai.com/v1/tools/{id}', 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.pyai.com/v1/tools/{id}",
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' => '<string>',
'description' => '<string>',
'input_schema' => [
],
'config_schema' => [
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'required' => false,
'secret' => false,
'help' => '<string>',
'placeholder' => '<string>',
'options' => [
'<string>'
]
]
]
],
'webhook_url' => '<string>',
'auth_header' => '<string>',
'auth_secret' => '<string>',
'timeout_ms' => 7550,
'rotate_secret' => 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.pyai.com/v1/tools/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"input_schema\": {},\n \"config_schema\": {\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": false,\n \"secret\": false,\n \"help\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"webhook_url\": \"<string>\",\n \"auth_header\": \"<string>\",\n \"auth_secret\": \"<string>\",\n \"timeout_ms\": 7550,\n \"rotate_secret\": 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.pyai.com/v1/tools/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"input_schema\": {},\n \"config_schema\": {\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": false,\n \"secret\": false,\n \"help\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"webhook_url\": \"<string>\",\n \"auth_header\": \"<string>\",\n \"auth_secret\": \"<string>\",\n \"timeout_ms\": 7550,\n \"rotate_secret\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/tools/{id}")
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\": \"<string>\",\n \"description\": \"<string>\",\n \"input_schema\": {},\n \"config_schema\": {\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"required\": false,\n \"secret\": false,\n \"help\": \"<string>\",\n \"placeholder\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"webhook_url\": \"<string>\",\n \"auth_header\": \"<string>\",\n \"auth_secret\": \"<string>\",\n \"timeout_ms\": 7550,\n \"rotate_secret\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "tool",
"id": "<string>",
"org_id": "<string>",
"name": "<string>",
"description": "<string>",
"input_schema": {},
"config_schema": {
"fields": [
{
"key": "<string>",
"label": "<string>",
"required": false,
"secret": false,
"help": "<string>",
"placeholder": "<string>",
"options": [
"<string>"
]
}
]
},
"webhook_url": "<string>",
"auth_header": "<string>",
"has_auth": true,
"timeout_ms": 123,
"created_at": 123,
"hmac_secret": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>"
}
}Authorizations
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Path Parameters
Body
Declares the settings a tool needs. Render these as a form in your agent builder; capture answers on the agent's tool binding config.
Show child attributes
Show child attributes
server, client Replace the stored webhook auth value, or null to clear it.
read, action 100 <= x <= 15000active, disabled When true, mint a NEW webhook signing secret and return it once as hmac_secret. Zero-drop rotation: deploy verification that accepts both the old and new secret, call this, then drop the old one.
Response
Updated tool (includes hmac_secret only when rotate_secret was set)
"tool"
prebuilt, custom Customer settings this tool needs to run. Render as a form in your builder; save answers on the agent binding config.
Show child attributes
Show child attributes
How the tool runs. hosted = PyAI runs it (prebuilt read catalog). server = the tool-executor calls your webhook. engine = the Omni call engine runs it natively (call control: transfer_to_human, send_dtmf, play_hold, collect, end_call), not routed to the executor. client = your connected app.
hosted, server, engine, client Whether a webhook auth secret is configured (the secret itself is never returned).
read, action active, disabled Returned once at creation for webhook signature verification.