Create or update a custom tool
Register a custom tool. Idempotent upsert on (org, name): if your org already has a tool with this name, it is updated in place (HTTP 200, no duplicate, hmac_secret preserved) — so re-syncing the same tool from a multi-tenant deploy is safe; otherwise a new tool is created (HTTP 201, hmac_secret returned once). A prebuilt/global tool of the same name never blocks creating your org’s tool. In server mode PyAI calls your webhook_url (signed, network-isolated) — works on phone calls; client mode runs on the WebSocket. Requires the omni:session scope.
Authorizations
Use Authorization: Bearer pyai_live_... (or pyai_test_...).
Body
Optional. Declare customer settings this tool needs (captured per agent on the binding config).
HTTPS endpoint for the tool. Validated against an SSRF allow-list at registration (public HTTPS only; private/loopback/metadata rejected).
How the tool runs. server = the Platform tool-executor calls webhook_url directly (default for endpoint tools; works on telephony). client = your connected app executes it (legacy client-loop). Defaults to server when webhook_url is set.
server, client Header name the executor injects the webhook auth value into (e.g. Authorization). Pair with auth_secret.
Auth value for your webhook (e.g. 'Bearer ...'). Stored encrypted at rest, injected by the executor, never echoed back.
read, action 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.
100 <= x <= 15000Response
Updated existing tool (idempotent upsert by name)
"tool"
prebuilt, custom Customer settings this tool needs to run. Render as a form in your builder; save answers on the agent binding config.
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