Skip to main content
POST
Create or update a custom tool

Authorizations

Authorization
string
header
required

Use Authorization: Bearer pyai_live_... (or pyai_test_...).

Body

application/json
name
string
required
description
string
input_schema
object
config_schema
object

Optional. Declare customer settings this tool needs (captured per agent on the binding config).

webhook_url
string<uri>

HTTPS URL PyAI calls when this server tool runs. Public HTTPS only; private, loopback, and metadata addresses are rejected at registration.

execution
enum<string>

How the tool runs. server = PyAI calls webhook_url (default when webhook_url is set; works on phone calls). client = your connected app executes it over the Omni socket. Register server tools here; do not put webhook_url on the Omni configure frame.

Available options:
server,
client
auth_header
string

Header name the executor injects the webhook auth value into (e.g. Authorization). Pair with auth_secret.

auth_secret
string

Auth value for your webhook (e.g. 'Bearer ...'). Stored encrypted at rest, injected by the executor, never echoed back.

side_effect
enum<string>
Available options:
read,
action
timeout_ms
integer
default:5000

Per-call budget (ms). Note the executor also enforces a platform hard ceiling (5000 ms by default); the effective budget is min(timeout_ms, ceiling). On timeout the model receives a synthetic soft { "error": "tool timed out" } and the turn continues.

Required range: 100 <= x <= 15000

Callbacks

POST
{$request.body#/webhook_url}toolInvocation

Body

application/json

Signed server-tool delivery. Verify X-PyAI-Signature over the raw body and enforce timestamp freshness. Operation identity is deduplication metadata, not caller consent or conversation identity.

call_id
string
required

Tool invocation ID; may change across provider retries.

tool
string
required
org_id
string
required
agent_id
string | null
required
arguments
any
required
operation_id
string

Optional engine operation key stable across provider retries. Scope durable deduplication to the verified tenant and tool, reject changed arguments, and reconcile uncertain results before retrying. Legacy deliveries may omit it.

Pattern: ^[a-f0-9]{64}$

Response

200

Tool result; successful HTTP transport alone does not establish a completed action.

Response

Updated existing tool (idempotent upsert by name)

object
string
Example:

"tool"

id
string
org_id
string | null
name
string
kind
enum<string>
Available options:
prebuilt,
custom
description
string
input_schema
object
config_schema
object

Customer settings this tool needs to run. Render as a form in your builder; save answers on the agent binding config.

webhook_url
string | null
execution
enum<string>

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
auth_header
string | null
has_auth
boolean

Whether a webhook auth secret is configured (the secret itself is never returned).

side_effect
enum<string>
Available options:
read,
action
timeout_ms
integer
status
enum<string>
Available options:
active,
disabled
created_at
integer