Operations
Operations

Set tool response template

Set a declarative response template on an HTTP tool, a map from HTTP status → a compact result the model can't misread, so a verbose or ambiguous upstream body (a booking POST that returns a fat 201 JSON blob) can't be read as a failure. Identify the tool by toolName (its snake_case name) or toolId. `responseTemplate` is a JSON string keyed by status pattern ("201", "2xx", "default"); a string value is the success result (with {{jmespath}} fields resolved against the body, e.g. {{data.starts_at}}), an object value is returned verbatim as an {error,message} envelope. The reserved "match" key holds ordered {when,then} branches that test the BODY with a bare JMESPath condition and run before any status key, that is how an endpoint reporting failure inside a 200 (a lookup that resolved nothing) returns a real error envelope instead of a false success. No matching key = today's raw body. Pass null to clear it. This is symmetric with the request-side {{variable}} templating on the URL/headers.

POST
/operations/set_tool_response_template

Authorization

bearerAuth
AuthorizationBearer <token>

A personal access token from Settings > API tokens.

In: header

Header Parameters

Idempotency-Key?string

A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.

Length1 <= length <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/operations/set_tool_response_template" \  -H "Content-Type: application/json" \  -d '{    "responseTemplate": "string",    "agent": "string"  }'
{}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "errors": [
    {
      "path": "string",
      "message": "string"
    }
  ],
  "estimate": {},
  "retryAfterSeconds": 0
}

Set tool requires POST

Set the tools that must have fired earlier in the same call before this tool is available. Identify the tool by toolName (its snake_case name) or toolId. This is V1's **only** ordering primitive, don't write 'first call verify_caller, then book_meeting' in the system prompt; set `book_meeting.requires = ["verify_caller"]` here instead. The runtime gates invocation deterministically and returns a `precondition_unmet` envelope when the LLM tries a tool too early; the LLM self-corrects on the next turn. Each entry is either a bare tool name (unconditional prerequisite) or a conditional `{tool, when: {arg, equals}}` object that only applies when THIS tool is dispatched with that argument value, e.g. `end_call.requires = [{tool: "take_a_message", when: {arg: "reason", equals: "abuse"}}]` means: if `end_call` is about to hang up on an abusive caller, a message must have been captured first, but ending the call for any other reason needs no such prerequisite. Conditions read only the CALLING tool's own arguments, never another tool's output. The Python runtime compares `equals` case/whitespace-insensitively, so `"Abuse"` and `"abuse "` both match. **Don't write requires that reference a tool that doesn't exist**, the validator will reject the agent at publish time. Pass `[]` to clear preconditions.

Update turn-taking POST

Update the turn-taking knobs, startStrategy (minwords | transcription | transcription+vad, which signals open a caller turn), incompleteTurnFilter (smart interruption filter: don't respond to a turn judged incomplete), protectGreeting (a caller cannot cut off the greeting; the agent answers them after it; turn-native speech recognition models only), ignoreGreetingSpeech (what the caller says during the agent's first line is ignored, never answered), eotThreshold (0-1 end-of-turn confidence; higher = waits longer / holds quiet speech), eagerEotThreshold (0-0.9; higher = replies sooner in quick exchanges = lower latency), shortTurnTimeout (0.5-5 seconds of silence after a short turn before replying), longTurnTimeout (15-30 seconds before nudging a silent caller; floored at 15s). Send only what changes. Use this for 'register quiet / trailing openers' (startStrategy transcription), 'don't cut off callers reading a code in fragments' (incompleteTurnFilter on), 'let the greeting finish' / 'don't let callers interrupt the greeting' (protectGreeting on), 'don't answer the hello they say while the greeting plays' / 'stop the double greeting on outbound calls' (ignoreGreetingSpeech on), 'less likely to interrupt' / 'wait longer before replying' (eotThreshold up), 'reply faster' / 'lower latency' (eagerEotThreshold up), 'wait longer after a pause' (shortTurnTimeout up), 'give slow callers more time' (longTurnTimeout up). eotThreshold and eagerEotThreshold mean the same thing on every engine but land differently: on standard models they drive the voice activity and end-of-turn detection in our pipeline, and on the two turn-native speech recognition models they map onto that model's own turn thresholds. On the one with named turn profiles also set turnPreset for the two knobs the sliders don't reach. incompleteTurnFilter and shortTurnTimeout apply to standard models only, because both turn-native engines decide those on the speech engine itself. Pass null for a field to unset it, back to the default.