Define a webhook tool
Send this body toPOST /v1/agents/tools. Replace the example URL and credentials with your own.
POST /v1/agents/tools
config.tools. See Tools for the shared execution settings.
Request schema
api_schema.url must use HTTPS, and requests to private and internal network ranges are blocked. Supported methods are GET, POST, PUT, PATCH, and DELETE.
path_params_schemafills placeholders such as{order_id}. Each path parameter is required and may be a string, integer, or number.query_params_schemadescribes query parameters withpropertiesand an optionalrequiredlist.request_body_schemadescribes a JSON object forPOST,PUT, orPATCH. Body properties may be nested.
Parameter descriptions tell the model what value to provide. Use
constant_value for a value the model should not choose, such as an API version. Use dynamic_variable values for per-customer context or values fetched at runtime.
For example, this tool sends the current customer_id with each request:
POST /v1/agents/tools
Last known status: {{order_status}} to the tool description so the model can see the value too.
Headers and authentication
api_schema.request_headers accepts strings, secrets, and dynamic variables. Add headers with PATCH /v1/agents/tools/{tool_id}, using your tool ID and API credential:
PATCH /v1/agents/tools/{tool_id}
authentication adds credentials to the Authorization header at request time. bearer sends Authorization: Bearer <token>, and basic_auth sends Authorization: Basic <base64(username:password)>. Do not also set Authorization in request_headers.
The API never returns saved secret values. When updating a tool, omitted headers and authentication stay unchanged. If you include an existing secret field, use { "type": "secret" } without secret_value to keep its value.
To remove a header, set that header to null inside api_schema.request_headers. To remove authentication, set api_schema.authentication to null.
Cartesia reserves transport headers that it manages itself. Header names must be unique, regardless of capitalization.
Responses and timeouts
The response body becomes the tool result. Keep it focused on the data the model needs. Useassignments to save response fields as dynamic variables. For a response such as {"order": {"id": "A-1001", "status": "shipped"}}, the assignments below save the order ID and status. Configure them in the tool’s side panel in the Playground or with PATCH /v1/agents/tools/{tool_id}:
PATCH /v1/agents/tools/{tool_id}
null value leaves the previous variable value unchanged. Objects and lists are saved as JSON text.
The request times out after response_timeout_secs, which defaults to 20 seconds. Use execution_mode: "async" for requests that do not need to block the current turn.