Get a tool
curl --request GET \
--url https://api.pyai.com/v1/tools/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/tools/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pyai.com/v1/tools/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pyai.com/v1/tools/{id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "tool",
"id": "<string>",
"org_id": "<string>",
"name": "<string>",
"kind": "prebuilt",
"description": "<string>",
"input_schema": {},
"config_schema": {
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "string",
"required": false,
"secret": false,
"help": "<string>",
"placeholder": "<string>",
"options": [
"<string>"
]
}
]
},
"webhook_url": "<string>",
"execution": "hosted",
"auth_header": "<string>",
"has_auth": true,
"side_effect": "read",
"timeout_ms": 123,
"status": "active",
"created_at": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Agents
Get a tool
GET
/
v1
/
tools
/
{id}
Get a tool
curl --request GET \
--url https://api.pyai.com/v1/tools/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/tools/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pyai.com/v1/tools/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pyai.com/v1/tools/{id}")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "tool",
"id": "<string>",
"org_id": "<string>",
"name": "<string>",
"kind": "prebuilt",
"description": "<string>",
"input_schema": {},
"config_schema": {
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "string",
"required": false,
"secret": false,
"help": "<string>",
"placeholder": "<string>",
"options": [
"<string>"
]
}
]
},
"webhook_url": "<string>",
"execution": "hosted",
"auth_header": "<string>",
"has_auth": true,
"side_effect": "read",
"timeout_ms": 123,
"status": "active",
"created_at": 123
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Authorizations
apiKeyxApiKey
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Path Parameters
Response
Tool
Example:
"tool"
Available options:
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.
Available options:
hosted, server, engine, client Whether a webhook auth secret is configured (the secret itself is never returned).
Available options:
read, action Available options:
active, disabled