# Create Conversation Item

`POST /v1/conversations/items`

Post a template, agent text, note or instruction into a conversation, or start one with a person.

Authenticate with `Authorization: Bearer $TALQING_API_KEY`. Errors use the shared envelope: https://docs.talqing.com/api-reference/errors.md

## OpenAPI

```json
{
 "openapi":"3.1.0",
 "servers":[
  {
   "description":"Talqing API",
   "url":"https://api.talqing.com"
  }
 ],
 "paths":{
  "/v1/conversations/items":{
   "post":{
    "description":"Post a template, agent text, note or instruction into a conversation, or start one with a person.",
    "operationId":"conversations.items.create",
    "requestBody":{
     "content":{
      "application/json":{
       "schema":{
        "$ref":"#/components/schemas/PostItemRequest"
       }
      }
     },
     "required":true
    },
    "responses":{
     "200":{
      "content":{
       "application/json":{
        "schema":{
         "$ref":"#/components/schemas/ConversationItemResponse"
        }
       }
      },
      "description":"Idempotent replay."
     },
     "201":{
      "content":{
       "application/json":{
        "schema":{
         "$ref":"#/components/schemas/ConversationItemResponse"
        }
       }
      },
      "description":"Successful Response"
     },
     "400":{
      "$ref":"#/components/responses/BadRequest"
     },
     "401":{
      "$ref":"#/components/responses/Unauthorized"
     },
     "403":{
      "$ref":"#/components/responses/Forbidden"
     },
     "409":{
      "$ref":"#/components/responses/Conflict"
     },
     "422":{
      "$ref":"#/components/responses/ValidationFailed"
     },
     "default":{
      "$ref":"#/components/responses/Error"
     }
    },
    "security":[
     {
      "BearerAuth":[]
     },
     {
      "SessionCookie":[]
     }
    ],
    "summary":"Create Conversation Item",
    "tags":[
     "conversations"
    ]
   }
  }
 },
 "components":{
  "responses":{
   "BadRequest":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Well-formed, but rejected by a rule; `detail.errors` lists each problem."
   },
   "Conflict":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"The resource's current state forbids this \u2014 a name already taken, a job already running."
   },
   "Error":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Unexpected error. Every error this API returns carries this body."
   },
   "Forbidden":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Authenticated, but this organization role may not perform the operation."
   },
   "Unauthorized":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"Missing credential, or one that is revoked or no longer a member of this organization."
   },
   "ValidationFailed":{
    "content":{
     "application/json":{
      "schema":{
       "$ref":"#/components/schemas/ErrorResponse"
      }
     }
    },
    "description":"The request did not match this operation's schema; `detail.errors` lists each field."
   }
  },
  "schemas":{
   "AddMessageConfig":{
    "additionalProperties":false,
    "properties":{
     "scope":{
      "default":"conversation",
      "enum":[
       "conversation",
       "turn"
      ],
      "title":"Scope",
      "type":"string"
     },
     "text":{
      "title":"Text",
      "type":"string"
     }
    },
    "required":[
     "text"
    ],
    "title":"AddMessageConfig",
    "type":"object"
   },
   "AddMessageOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/AddMessageConfig"
     },
     "kind":{
      "const":"add_message",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"AddMessageOperation",
    "type":"object"
   },
   "AgentConfig":{
    "additionalProperties":false,
    "description":"The whole agent: what it says, which models run it, and what it can do.\n\n``AgentBase`` plus the session this agent owns and the media stack that\nsession runs \u2014 which is what a task, running inside someone else's session,\nhas none of.\n\nA complete definition, not a patch \u2014 whatever it omits takes that field's\ndefault.",
    "properties":{
     "analysis":{
      "$ref":"#/components/schemas/AnalysisSpec"
     },
     "avatar":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AvatarSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "background_audio":{
      "$ref":"#/components/schemas/BackgroundAudioSpec"
     },
     "channel":{
      "default":"voice",
      "enum":[
       "voice",
       "video",
       "text"
      ],
      "title":"Channel",
      "type":"string"
     },
     "conversation":{
      "$ref":"#/components/schemas/ConversationSpec"
     },
     "elapsed_time":{
      "default":false,
      "description":"Start every user message the model reads with the time since the session began, e.g. [12:34]. Not available on realtime models.",
      "title":"Elapsed Time",
      "type":"boolean"
     },
     "faqs":{
      "description":"FAQs the agent answers from: questions go in the prompt, answers are fetched on demand.",
      "items":{
       "$ref":"#/components/schemas/FaqSelection"
      },
      "maxItems":10,
      "title":"Faqs",
      "type":"array"
     },
     "greeting":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/GreetingSpec"
       },
       {
        "type":"null"
       }
      ],
      "default":{
       "message":"Hello! How can I help you today?"
      },
      "description":"How the agent opens, on connect and on the way in from a handoff; null makes it wait for the caller to speak first. Voice and video only."
     },
     "greeting_interruptible":{
      "default":true,
      "description":"Whether the caller can cut the greeting off. A greeting speaking the recording notice never can. Cannot be false on a realtime model.",
      "title":"Greeting Interruptible",
      "type":"boolean"
     },
     "handoffs":{
      "description":"Where this agent may hand the conversation next. Each entry becomes one tool the model can call, so routing quality lives in its `description`. A target is a stored agent (`agent_id`) or a member of the team defined on the call.",
      "items":{
       "$ref":"#/components/schemas/HandoffTarget"
      },
      "title":"Handoffs",
      "type":"array"
     },
     "inbound_webhook":{
      "default":false,
      "description":"Before an inbound call or channel chat starts, ask the workspace's inbound webhook for its vars, secrets, overrides, metadata and userdata. Refused if it does not answer.",
      "title":"Inbound Webhook",
      "type":"boolean"
     },
     "keypad_input":{
      "$ref":"#/components/schemas/KeypadInputSpec"
     },
     "language":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The one language the caller and the agent speak, shared by every model in the pipeline. Use a code from the provider catalog's language lists; null means Auto. On a text agent, only with `stt` set.",
      "title":"Language"
     },
     "llm":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/LLMSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "max_duration_seconds":{
      "anyOf":[
       {
        "maximum":10800.0,
        "minimum":30.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "default":1800,
      "description":"The longest a call may last; the agent then says goodbye and hangs up. Null means the platform's 3-hour cap. Voice and video only; a handoff keeps the starting agent's limit.",
      "title":"Max Duration Seconds"
     },
     "max_steps":{
      "anyOf":[
       {
        "maximum":50.0,
        "minimum":1.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"How many LLM -> tools -> LLM rounds one turn may take before the agent must answer without tools. Null means 4 on voice and video, 25 on text. Not enforced on realtime models; a handoff keeps the starting agent's limit.",
      "title":"Max Steps"
     },
     "mcps":{
      "description":"MCP servers whose tools may be called \u2014 each named by the integration that holds its credential, or defined inline. Which of a named server's tools may be called is the integration's own `allowed_tools`, not this list.",
      "items":{
       "$ref":"#/components/schemas/McpSelection"
      },
      "title":"Mcps",
      "type":"array"
     },
     "name":{
      "description":"Unique in the workspace.",
      "minLength":1,
      "title":"Name",
      "type":"string"
     },
     "noise_cancellation":{
      "$ref":"#/components/schemas/NoiseCancellationSpec"
     },
     "on_enter":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_exit":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_user_turn_completed":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "prompt":{
      "default":"You are a helpful, concise voice assistant.",
      "description":"The system prompt. `{{userdata.field}}` is substituted from the session's userdata when the agent starts, so one definition can address the person it reached.",
      "title":"Prompt",
      "type":"string"
     },
     "realtime":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/RealtimeSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "recording":{
      "$ref":"#/components/schemas/RecordingSpec"
     },
     "silence":{
      "$ref":"#/components/schemas/SilenceSpec"
     },
     "stt":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/STTSpec"
       },
       {
        "type":"null"
       }
      ],
      "description":"Text agents: transcribes voice notes; null = the agent can't listen to them."
     },
     "tasks":{
      "description":"Jobs this agent can enter and come back from. Each becomes one tool the model can call; the task runs inside this call, on its voice and its ears, and returns its typed output as the tool's result.",
      "items":{
       "$ref":"#/components/schemas/TaskSelection"
      },
      "title":"Tasks",
      "type":"array"
     },
     "timezone":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The IANA timezone this clock runs on, e.g. 'Asia/Kolkata'. Set it and the prompt and tools can read {{system_vars.now}}, {{system_vars.date}} and {{system_vars.time}}. Required only if one of those is used.",
      "title":"Timezone"
     },
     "tools":{
      "description":"Tools the model may call. Publishing pins each one to the tool version live at that moment, so republishing a tool does not change this until it is published again.",
      "items":{
       "$ref":"#/components/schemas/ToolSelection"
      },
      "title":"Tools",
      "type":"array"
     },
     "tts":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TTSSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "turn_handling":{
      "$ref":"#/components/schemas/TurnHandlingSpec"
     },
     "vars":{
      "description":"The variables read as {{vars.name}} in the prompt, the greeting and the tools. Values from the request that starts a session override the defaults. They are visible to the model - keep credentials in a workspace secret.",
      "items":{
       "$ref":"#/components/schemas/VarDeclaration"
      },
      "title":"Vars",
      "type":"array"
     },
     "vision_input":{
      "$ref":"#/components/schemas/VisionInputSpec"
     },
     "voicemail_detection":{
      "$ref":"#/components/schemas/VoicemailDetectionSpec"
     }
    },
    "required":[
     "name"
    ],
    "title":"AgentConfig",
    "type":"object"
   },
   "AgentOverride":{
    "additionalProperties":false,
    "description":"A partial AgentConfig: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "analysis":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AnalysisSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "avatar":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AvatarSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "background_audio":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/BackgroundAudioSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "channel":{
      "anyOf":[
       {
        "enum":[
         "voice",
         "video",
         "text"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Channel"
     },
     "conversation":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ConversationSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "elapsed_time":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Start every user message the model reads with the time since the session began, e.g. [12:34]. Not available on realtime models.",
      "title":"Elapsed Time"
     },
     "faqs":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/FaqSelection"
        },
        "maxItems":10,
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"FAQs the agent answers from: questions go in the prompt, answers are fetched on demand.",
      "title":"Faqs"
     },
     "greeting":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/GreetingSpec"
       },
       {
        "type":"null"
       }
      ],
      "description":"How the agent opens, on connect and on the way in from a handoff; null makes it wait for the caller to speak first. Voice and video only."
     },
     "greeting_interruptible":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Whether the caller can cut the greeting off. A greeting speaking the recording notice never can. Cannot be false on a realtime model.",
      "title":"Greeting Interruptible"
     },
     "handoffs":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/HandoffTarget"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"Where this agent may hand the conversation next. Each entry becomes one tool the model can call, so routing quality lives in its `description`. A target is a stored agent (`agent_id`) or a member of the team defined on the call.",
      "title":"Handoffs"
     },
     "inbound_webhook":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Before an inbound call or channel chat starts, ask the workspace's inbound webhook for its vars, secrets, overrides, metadata and userdata. Refused if it does not answer.",
      "title":"Inbound Webhook"
     },
     "keypad_input":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/KeypadInputSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "language":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The one language the caller and the agent speak, shared by every model in the pipeline. Use a code from the provider catalog's language lists; null means Auto. On a text agent, only with `stt` set.",
      "title":"Language"
     },
     "llm":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/LLMSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "max_duration_seconds":{
      "anyOf":[
       {
        "maximum":10800.0,
        "minimum":30.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"The longest a call may last; the agent then says goodbye and hangs up. Null means the platform's 3-hour cap. Voice and video only; a handoff keeps the starting agent's limit.",
      "title":"Max Duration Seconds"
     },
     "max_steps":{
      "anyOf":[
       {
        "maximum":50.0,
        "minimum":1.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"How many LLM -> tools -> LLM rounds one turn may take before the agent must answer without tools. Null means 4 on voice and video, 25 on text. Not enforced on realtime models; a handoff keeps the starting agent's limit.",
      "title":"Max Steps"
     },
     "mcps":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/McpSelection"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"MCP servers whose tools may be called \u2014 each named by the integration that holds its credential, or defined inline. Which of a named server's tools may be called is the integration's own `allowed_tools`, not this list.",
      "title":"Mcps"
     },
     "name":{
      "anyOf":[
       {
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Unique in the workspace.",
      "title":"Name"
     },
     "noise_cancellation":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/NoiseCancellationSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_enter":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_exit":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_user_turn_completed":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "prompt":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The system prompt. `{{userdata.field}}` is substituted from the session's userdata when the agent starts, so one definition can address the person it reached.",
      "title":"Prompt"
     },
     "realtime":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/RealtimeSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "recording":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/RecordingSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "silence":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/SilenceSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "stt":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/STTSpecOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Text agents: transcribes voice notes; null = the agent can't listen to them."
     },
     "tasks":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/TaskSelection"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"Jobs this agent can enter and come back from. Each becomes one tool the model can call; the task runs inside this call, on its voice and its ears, and returns its typed output as the tool's result.",
      "title":"Tasks"
     },
     "timezone":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The IANA timezone this clock runs on, e.g. 'Asia/Kolkata'. Set it and the prompt and tools can read {{system_vars.now}}, {{system_vars.date}} and {{system_vars.time}}. Required only if one of those is used.",
      "title":"Timezone"
     },
     "tools":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/ToolSelection"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"Tools the model may call. Publishing pins each one to the tool version live at that moment, so republishing a tool does not change this until it is published again.",
      "title":"Tools"
     },
     "tts":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TTSSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "turn_handling":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TurnHandlingSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "vars":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/VarDeclaration"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"The variables read as {{vars.name}} in the prompt, the greeting and the tools. Values from the request that starts a session override the defaults. They are visible to the model - keep credentials in a workspace secret.",
      "title":"Vars"
     },
     "vision_input":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/VisionInputSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "voicemail_detection":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/VoicemailDetectionSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     }
    },
    "title":"AgentOverride",
    "type":"object"
   },
   "AgentTeam":{
    "description":"A cast of agents for one call, handing off to each other by name.\n\nAn object rather than a bare list so the schema has a name in the OpenAPI\ndocument and can be widened additively.",
    "properties":{
     "members":{
      "description":"**`members[0]` answers the call.** Order is semantics. Every member is in the roster under its `name`, the entry included, which is what lets a member hand the call back to whoever answered.",
      "items":{
       "$ref":"#/components/schemas/AgentTeamMember"
      },
      "maxItems":10,
      "minItems":1,
      "title":"Members",
      "type":"array"
     }
    },
    "required":[
     "members"
    ],
    "title":"AgentTeam",
    "type":"object"
   },
   "AgentTeamMember":{
    "description":"One agent on a multi-agent call, described exactly as a single-agent call is.",
    "properties":{
     "agent":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AgentConfig"
       },
       {
        "type":"null"
       }
      ],
      "description":"A complete agent definition, run for this call and stored nowhere. Mutually exclusive with `agent_id`."
     },
     "agent_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"An agent in this workspace. Mutually exclusive with `agent`.",
      "title":"Agent Id"
     },
     "agent_override":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AgentOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Changes layered on top of whichever base was named. Absent keys keep the base value, an explicit null clears the field, objects deep-merge and lists replace."
     },
     "agent_version":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "const":"draft",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Which version of `agent_id` to run. Omit for the published one. `\"draft\"` runs the unpublished working copy \u2014 validated and tool-pinned at request time, and refused with the publish errors if it does not hold together.",
      "title":"Agent Version"
     },
     "name":{
      "description":"This member's name for this call, winning over the stored agent's own. Handoff edges reference it and the transcript records it.",
      "minLength":1,
      "title":"Name",
      "type":"string"
     }
    },
    "required":[
     "name"
    ],
    "title":"AgentTeamMember",
    "type":"object"
   },
   "AnalysisField":{
    "additionalProperties":false,
    "description":"One value to pull out of the finished transcript.",
    "properties":{
     "description":{
      "description":"How to find this value in the transcript. Be explicit about the format you want and about what to do when the call never mentions it.",
      "minLength":1,
      "title":"Description",
      "type":"string"
     },
     "name":{
      "description":"Identifier for the extracted value, as it appears in the API and webhook. Lower-case letters, digits and underscores.",
      "pattern":"^[a-z][a-z0-9_]{0,39}$",
      "title":"Name",
      "type":"string"
     },
     "type":{
      "default":"string",
      "description":"The shape of the value. Anything that is not a number or a yes/no is a string.",
      "enum":[
       "string",
       "boolean",
       "integer",
       "number"
      ],
      "title":"Type",
      "type":"string"
     }
    },
    "required":[
     "name",
     "description"
    ],
    "title":"AnalysisField",
    "type":"object"
   },
   "AnalysisSpec":{
    "additionalProperties":false,
    "description":"What to work out about a call or a chat once it has ended.\n\nOne LLM call per session reads the finished transcript.",
    "properties":{
     "enabled":{
      "default":true,
      "description":"Analyse calls after they end. This runs one extra LLM call per call, billed like any other, and adds roughly 5% to the cost of a call.",
      "title":"Enabled",
      "type":"boolean"
     },
     "fields":{
      "description":"Values to extract from the transcript. These are what a reader inferred afterwards, and are kept apart from the data the agent itself collected during the call.",
      "items":{
       "$ref":"#/components/schemas/AnalysisField"
      },
      "maxItems":25,
      "title":"Fields",
      "type":"array"
     },
     "model":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/LLMModelSpec"
       },
       {
        "type":"null"
       }
      ],
      "description":"The model that reads the transcript. Leave unset to use the platform default, which is picked for accuracy rather than the low latency a live call needs."
     },
     "outcome":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/OutcomeSpec"
       },
       {
        "type":"null"
       }
      ],
      "description":"Judge whether each call achieved its purpose. Unset means calls are not judged and the outcome is left empty."
     },
     "summary":{
      "default":true,
      "description":"Write a short summary of each call, shown on the calls list.",
      "title":"Summary",
      "type":"boolean"
     }
    },
    "title":"AnalysisSpec",
    "type":"object"
   },
   "AnalysisSpecOverride":{
    "additionalProperties":false,
    "description":"A partial AnalysisSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Analyse calls after they end. This runs one extra LLM call per call, billed like any other, and adds roughly 5% to the cost of a call.",
      "title":"Enabled"
     },
     "fields":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/AnalysisField"
        },
        "maxItems":25,
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"Values to extract from the transcript. These are what a reader inferred afterwards, and are kept apart from the data the agent itself collected during the call.",
      "title":"Fields"
     },
     "model":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/LLMModelSpecOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"The model that reads the transcript. Leave unset to use the platform default, which is picked for accuracy rather than the low latency a live call needs."
     },
     "outcome":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/OutcomeSpecOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Judge whether each call achieved its purpose. Unset means calls are not judged and the outcome is left empty."
     },
     "summary":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Write a short summary of each call, shown on the calls list.",
      "title":"Summary"
     }
    },
    "title":"AnalysisSpecOverride",
    "type":"object"
   },
   "AttachmentNotKept":{
    "description":"A file the person sent that could not be stored.",
    "properties":{
     "reason":{
      "description":"Why, as a sentence for a person.",
      "title":"Reason",
      "type":"string"
     }
    },
    "required":[
     "reason"
    ],
    "title":"AttachmentNotKept",
    "type":"object"
   },
   "AvatarSpec":{
    "additionalProperties":false,
    "description":"The Anam video layer, active when `channel == \"video\"`.\n\n`avatar_id` is a face from GET /catalog/avatars.",
    "properties":{
     "avatar_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":"edf6fdcb-acab-44b8-b974-ded72665ee26",
      "title":"Avatar Id"
     },
     "model":{
      "default":"anam",
      "title":"Model",
      "type":"string"
     },
     "name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":"Mia",
      "title":"Name"
     },
     "provider":{
      "default":"anam",
      "title":"Provider",
      "type":"string"
     }
    },
    "title":"AvatarSpec",
    "type":"object"
   },
   "AvatarSpecOverride":{
    "additionalProperties":false,
    "description":"A partial AvatarSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "avatar_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Avatar Id"
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Name"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     }
    },
    "title":"AvatarSpecOverride",
    "type":"object"
   },
   "BackgroundAudioSpec":{
    "additionalProperties":false,
    "description":"Ambient + thinking sounds mixed into the agent's output (voice realism).",
    "properties":{
     "ambient":{
      "anyOf":[
       {
        "enum":[
         "office",
         "city",
         "forest",
         "crowd",
         "hold_music"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":"office",
      "title":"Ambient"
     },
     "ambient_volume":{
      "default":0.4,
      "title":"Ambient Volume",
      "type":"number"
     },
     "enabled":{
      "default":false,
      "title":"Enabled",
      "type":"boolean"
     },
     "thinking":{
      "anyOf":[
       {
        "enum":[
         "keyboard",
         "keyboard2"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":"keyboard",
      "title":"Thinking"
     },
     "thinking_volume":{
      "default":0.6,
      "title":"Thinking Volume",
      "type":"number"
     }
    },
    "title":"BackgroundAudioSpec",
    "type":"object"
   },
   "BackgroundAudioSpecOverride":{
    "additionalProperties":false,
    "description":"A partial BackgroundAudioSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "ambient":{
      "anyOf":[
       {
        "enum":[
         "office",
         "city",
         "forest",
         "crowd",
         "hold_music"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Ambient"
     },
     "ambient_volume":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Ambient Volume"
     },
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "title":"Enabled"
     },
     "thinking":{
      "anyOf":[
       {
        "enum":[
         "keyboard",
         "keyboard2"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Thinking"
     },
     "thinking_volume":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Thinking Volume"
     }
    },
    "title":"BackgroundAudioSpecOverride",
    "type":"object"
   },
   "BuiltinToolSpec":{
    "additionalProperties":false,
    "description":"A capability of the model itself, switched on for that model.\n\n`config` takes only the options that model's catalog entry declares.",
    "properties":{
     "config":{
      "additionalProperties":true,
      "title":"Config",
      "type":"object"
     },
     "type":{
      "title":"Type",
      "type":"string"
     }
    },
    "required":[
     "type"
    ],
    "title":"BuiltinToolSpec",
    "type":"object"
   },
   "ButtonTap":{
    "properties":{
     "payload":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Payload"
     },
     "text":{
      "title":"Text",
      "type":"string"
     }
    },
    "required":[
     "text"
    ],
    "title":"ButtonTap",
    "type":"object"
   },
   "CodeConfig":{
    "additionalProperties":false,
    "description":"TypeScript run on the code-exec service.",
    "properties":{
     "compiled_js":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Server-written build output. Do not send it; publishing compiles `source_ts`.",
      "title":"Compiled Js"
     },
     "source_ts":{
      "description":"Must `export default async function handler(input)` and return an object.",
      "title":"Source Ts",
      "type":"string"
     },
     "timeout":{
      "anyOf":[
       {
        "exclusiveMinimum":0.0,
        "maximum":30.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds, not milliseconds. Defaults to 10.",
      "title":"Timeout"
     }
    },
    "required":[
     "source_ts"
    ],
    "title":"CodeConfig",
    "type":"object"
   },
   "CodeOperation":{
    "additionalProperties":false,
    "description":"Run TypeScript to transform or shape data an `http` operation cannot.\n\nIts sandbox has `fetch`, but reaching an API with it instead of an `http`\noperation costs a V8 isolate per call and hides the request from the editor.",
    "properties":{
     "background_execution":{
      "default":false,
      "title":"Background Execution",
      "type":"boolean"
     },
     "config":{
      "$ref":"#/components/schemas/CodeConfig"
     },
     "kind":{
      "const":"code",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     },
     "publish_fields":{
      "items":{
       "$ref":"#/components/schemas/PublishFieldRequest"
      },
      "title":"Publish Fields",
      "type":"array"
     },
     "silent":{
      "default":false,
      "title":"Silent",
      "type":"boolean"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"CodeOperation",
    "type":"object"
   },
   "ContactCard":{
    "description":"One card in a shared contact file.",
    "properties":{
     "emails":{
      "items":{
       "type":"string"
      },
      "title":"Emails",
      "type":"array"
     },
     "name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Name"
     },
     "organization":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Organization"
     },
     "phones":{
      "items":{
       "type":"string"
      },
      "title":"Phones",
      "type":"array"
     }
    },
    "required":[
     "name",
     "phones",
     "emails",
     "organization"
    ],
    "title":"ContactCard",
    "type":"object"
   },
   "ConversationAudio":{
    "description":"A voice note or audio file the person sent, and what they said in it.",
    "properties":{
     "bytes":{
      "title":"Bytes",
      "type":"integer"
     },
     "duration_seconds":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Duration Seconds"
     },
     "extension":{
      "description":"The type read from its bytes, e.g. `ogg` or `m4a`.",
      "title":"Extension",
      "type":"string"
     },
     "failed_reason":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Why it could not be transcribed.",
      "title":"Failed Reason"
     },
     "filename":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Filename"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "kind":{
      "const":"audio",
      "default":"audio",
      "title":"Kind",
      "type":"string"
     },
     "mime_type":{
      "title":"Mime Type",
      "type":"string"
     },
     "playable":{
      "description":"Whether `url` plays in an `<audio>` element.",
      "title":"Playable",
      "type":"boolean"
     },
     "status":{
      "description":"`pending` until an agent with a speech-to-text model takes a turn.",
      "enum":[
       "pending",
       "transcribed",
       "failed"
      ],
      "title":"Status",
      "type":"string"
     },
     "transcript":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"What was said; empty when there was no speech.",
      "title":"Transcript"
     },
     "url":{
      "description":"Signed link; valid until `url_expires_at`.",
      "title":"Url",
      "type":"string"
     },
     "url_expires_at":{
      "format":"date-time",
      "title":"Url Expires At",
      "type":"string"
     }
    },
    "required":[
     "id",
     "mime_type",
     "extension",
     "playable",
     "bytes",
     "filename",
     "status",
     "duration_seconds",
     "transcript",
     "failed_reason",
     "url",
     "url_expires_at"
    ],
    "title":"ConversationAudio",
    "type":"object"
   },
   "ConversationContact":{
    "description":"A contact card the person shared, as read from the vCard.",
    "properties":{
     "bytes":{
      "title":"Bytes",
      "type":"integer"
     },
     "contacts":{
      "description":"One per card in the file.",
      "items":{
       "$ref":"#/components/schemas/ContactCard"
      },
      "title":"Contacts",
      "type":"array"
     },
     "filename":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Filename"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "kind":{
      "const":"contact",
      "default":"contact",
      "title":"Kind",
      "type":"string"
     },
     "mime_type":{
      "const":"text/vcard",
      "default":"text/vcard",
      "title":"Mime Type",
      "type":"string"
     },
     "url":{
      "description":"Signed download of the .vcf; valid until `url_expires_at`.",
      "title":"Url",
      "type":"string"
     },
     "url_expires_at":{
      "format":"date-time",
      "title":"Url Expires At",
      "type":"string"
     }
    },
    "required":[
     "id",
     "bytes",
     "filename",
     "contacts",
     "url",
     "url_expires_at"
    ],
    "title":"ConversationContact",
    "type":"object"
   },
   "ConversationDocument":{
    "description":"A PDF or Word file the person sent, and whether the agent could read it.",
    "properties":{
     "bytes":{
      "title":"Bytes",
      "type":"integer"
     },
     "filename":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Filename"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "kind":{
      "const":"document",
      "default":"document",
      "title":"Kind",
      "type":"string"
     },
     "mime_type":{
      "title":"Mime Type",
      "type":"string"
     },
     "pages":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"A PDF's page count; null for Word files.",
      "title":"Pages"
     },
     "status":{
      "description":"`pending` until the agent's next turn reads it.",
      "enum":[
       "pending",
       "read",
       "unreadable"
      ],
      "title":"Status",
      "type":"string"
     },
     "unreadable_reason":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Why the agent could not read it.",
      "title":"Unreadable Reason"
     },
     "url":{
      "description":"Signed download link; valid until `url_expires_at`.",
      "title":"Url",
      "type":"string"
     },
     "url_expires_at":{
      "format":"date-time",
      "title":"Url Expires At",
      "type":"string"
     }
    },
    "required":[
     "id",
     "mime_type",
     "bytes",
     "filename",
     "status",
     "pages",
     "unreadable_reason",
     "url",
     "url_expires_at"
    ],
    "title":"ConversationDocument",
    "type":"object"
   },
   "ConversationFile":{
    "description":"Any other file the person sent, stored for you; the agent cannot open it.",
    "properties":{
     "bytes":{
      "title":"Bytes",
      "type":"integer"
     },
     "extension":{
      "description":"The type read from its bytes, e.g. `xlsx`; `bin` if unknown.",
      "title":"Extension",
      "type":"string"
     },
     "filename":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Filename"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "kind":{
      "const":"file",
      "default":"file",
      "title":"Kind",
      "type":"string"
     },
     "mime_type":{
      "title":"Mime Type",
      "type":"string"
     },
     "playable":{
      "anyOf":[
       {
        "const":"video",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Set when `url` plays in a `<video>` element.",
      "title":"Playable"
     },
     "url":{
      "description":"Signed link; valid until `url_expires_at`.",
      "title":"Url",
      "type":"string"
     },
     "url_expires_at":{
      "format":"date-time",
      "title":"Url Expires At",
      "type":"string"
     }
    },
    "required":[
     "id",
     "mime_type",
     "extension",
     "playable",
     "bytes",
     "filename",
     "url",
     "url_expires_at"
    ],
    "title":"ConversationFile",
    "type":"object"
   },
   "ConversationImage":{
    "description":"A photo the person sent, with a short-lived link to it.",
    "properties":{
     "bytes":{
      "title":"Bytes",
      "type":"integer"
     },
     "filename":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Filename"
     },
     "height":{
      "title":"Height",
      "type":"integer"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "kind":{
      "const":"image",
      "default":"image",
      "title":"Kind",
      "type":"string"
     },
     "mime_type":{
      "title":"Mime Type",
      "type":"string"
     },
     "url":{
      "description":"Signed; valid until `url_expires_at`.",
      "title":"Url",
      "type":"string"
     },
     "url_expires_at":{
      "format":"date-time",
      "title":"Url Expires At",
      "type":"string"
     },
     "width":{
      "title":"Width",
      "type":"integer"
     }
    },
    "required":[
     "id",
     "mime_type",
     "bytes",
     "width",
     "height",
     "url",
     "url_expires_at"
    ],
    "title":"ConversationImage",
    "type":"object"
   },
   "ConversationItemResponse":{
    "properties":{
     "agent_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Agent Id"
     },
     "agent_version":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "const":"draft",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Agent Version"
     },
     "attachments":{
      "items":{
       "discriminator":{
        "mapping":{
         "audio":"#/components/schemas/ConversationAudio",
         "contact":"#/components/schemas/ConversationContact",
         "document":"#/components/schemas/ConversationDocument",
         "file":"#/components/schemas/ConversationFile",
         "image":"#/components/schemas/ConversationImage"
        },
        "propertyName":"kind"
       },
       "oneOf":[
        {
         "$ref":"#/components/schemas/ConversationImage"
        },
        {
         "$ref":"#/components/schemas/ConversationDocument"
        },
        {
         "$ref":"#/components/schemas/ConversationAudio"
        },
        {
         "$ref":"#/components/schemas/ConversationContact"
        },
        {
         "$ref":"#/components/schemas/ConversationFile"
        }
       ]
      },
      "title":"Attachments",
      "type":"array"
     },
     "attachments_not_kept":{
      "description":"Files the person sent that could not be stored.",
      "items":{
       "$ref":"#/components/schemas/AttachmentNotKept"
      },
      "title":"Attachments Not Kept",
      "type":"array"
     },
     "author":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ItemAuthor"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"Who at your business posted this."
     },
     "channel":{
      "anyOf":[
       {
        "enum":[
         "phone_call",
         "whatsapp_call",
         "whatsapp_message",
         "web_call",
         "chat",
         "telegram",
         "stream",
         "copilot"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"How this item reached us or the person; null for notes and instructions.",
      "title":"Channel"
     },
     "client_message_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Client Message Id"
     },
     "content":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/InboundContent"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"What the person sent besides text; null for plain text."
     },
     "conversation_id":{
      "format":"uuid",
      "title":"Conversation Id",
      "type":"string"
     },
     "created_at":{
      "format":"date-time",
      "title":"Created At",
      "type":"string"
     },
     "delivery_error":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/DeliveryError"
       },
       {
        "type":"null"
       }
      ],
      "default":null
     },
     "delivery_status":{
      "enum":[
       "not_applicable",
       "pending",
       "held",
       "sending",
       "queued",
       "sent",
       "delivered",
       "read",
       "undelivered",
       "failed",
       "skipped",
       "expired"
      ],
      "title":"Delivery Status",
      "type":"string"
     },
     "direction":{
      "enum":[
       "inbound",
       "outbound",
       "internal"
      ],
      "title":"Direction",
      "type":"string"
     },
     "elapsed":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Elapsed"
     },
     "id":{
      "format":"uuid",
      "title":"Id",
      "type":"string"
     },
     "idempotency_key":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Idempotency Key"
     },
     "latency":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ReplyLatency"
       },
       {
        "type":"null"
       }
      ],
      "default":null
     },
     "metadata":{
      "additionalProperties":true,
      "title":"Metadata",
      "type":"object"
     },
     "metrics":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TurnMetrics"
       },
       {
        "type":"null"
       }
      ],
      "default":null
     },
     "origin":{
      "anyOf":[
       {
        "enum":[
         "speech",
         "typed",
         "keypad"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Origin"
     },
     "post_type":{
      "anyOf":[
       {
        "enum":[
         "template",
         "agent_text",
         "note",
         "instruction"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"What was posted through the API; null for everything else.",
      "title":"Post Type"
     },
     "provider_message_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Provider Message Id"
     },
     "raw_payload":{
      "anyOf":[
       {
        "additionalProperties":true,
        "type":"object"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Raw Payload"
     },
     "role":{
      "anyOf":[
       {
        "enum":[
         "developer",
         "system",
         "user",
         "assistant",
         "tool"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Role"
     },
     "scope":{
      "enum":[
       "conversation",
       "turn"
      ],
      "title":"Scope",
      "type":"string"
     },
     "session_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Session Id"
     },
     "text":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Text"
     },
     "trigger_item_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Trigger Item Id"
     },
     "turn_error":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Turn Error"
     },
     "turn_status":{
      "anyOf":[
       {
        "enum":[
         "running",
         "done",
         "error",
         "canceled"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Turn Status"
     },
     "type":{
      "enum":[
       "message",
       "function_call",
       "function_call_output",
       "agent_handoff",
       "agent_config_update"
      ],
      "title":"Type",
      "type":"string"
     },
     "updated_at":{
      "format":"date-time",
      "title":"Updated At",
      "type":"string"
     },
     "visibility":{
      "enum":[
       "customer_visible",
       "internal"
      ],
      "title":"Visibility",
      "type":"string"
     }
    },
    "required":[
     "id",
     "conversation_id",
     "session_id",
     "trigger_item_id",
     "direction",
     "type",
     "role",
     "agent_id",
     "agent_version",
     "text",
     "attachments",
     "attachments_not_kept",
     "content",
     "provider_message_id",
     "client_message_id",
     "delivery_status",
     "delivery_error",
     "turn_status",
     "turn_error",
     "channel",
     "post_type",
     "author",
     "idempotency_key",
     "visibility",
     "scope",
     "metrics",
     "origin",
     "elapsed",
     "latency",
     "metadata",
     "raw_payload",
     "created_at",
     "updated_at"
    ],
    "title":"ConversationItemResponse",
    "type":"object"
   },
   "ConversationSpec":{
    "additionalProperties":false,
    "description":"What a new call knows about earlier ones with the same person.",
    "properties":{
     "context":{
      "default":"none",
      "description":"What a new session starts with from earlier ones with this person: 'none' starts clean, 'summary' adds background on recent conversations, 'transcript' carries the same conversation on. Read only from the agent that answers. A WhatsApp call always carries the chat on, whatever this says.",
      "enum":[
       "none",
       "summary",
       "transcript"
      ],
      "title":"Context",
      "type":"string"
     },
     "initialize_userdata":{
      "default":true,
      "description":"Start the call already knowing what the agent learned about this person on earlier ones. Used by 'summary' and 'transcript' only; a 'none' call always starts empty.",
      "title":"Initialize Userdata",
      "type":"boolean"
     },
     "summary_limit":{
      "anyOf":[
       {
        "minimum":1.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"How many recent calls to summarize. Leave empty for all of them. Used by 'summary' only.",
      "title":"Summary Limit"
     }
    },
    "title":"ConversationSpec",
    "type":"object"
   },
   "ConversationSpecOverride":{
    "additionalProperties":false,
    "description":"A partial ConversationSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "context":{
      "anyOf":[
       {
        "enum":[
         "none",
         "summary",
         "transcript"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"What a new session starts with from earlier ones with this person: 'none' starts clean, 'summary' adds background on recent conversations, 'transcript' carries the same conversation on. Read only from the agent that answers. A WhatsApp call always carries the chat on, whatever this says.",
      "title":"Context"
     },
     "initialize_userdata":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Start the call already knowing what the agent learned about this person on earlier ones. Used by 'summary' and 'transcript' only; a 'none' call always starts empty.",
      "title":"Initialize Userdata"
     },
     "summary_limit":{
      "anyOf":[
       {
        "minimum":1.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"How many recent calls to summarize. Leave empty for all of them. Used by 'summary' only.",
      "title":"Summary Limit"
     }
    },
    "title":"ConversationSpecOverride",
    "type":"object"
   },
   "DeliveryError":{
    "description":"Outbound delivery failure detail (provider HTTP / shadow-mode skips).\n\nWriters always store `{\"message\": ...}`, plus the provider's `code` when it\ngave one (see services.messaging.delivery).",
    "properties":{
     "code":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"The provider's error code, if any.",
      "title":"Code"
     },
     "message":{
      "title":"Message",
      "type":"string"
     }
    },
    "required":[
     "message",
     "code"
    ],
    "title":"DeliveryError",
    "type":"object"
   },
   "EndCallConfig":{
    "additionalProperties":false,
    "description":"No settings: an `end_call` ends the call.",
    "properties":{},
    "title":"EndCallConfig",
    "type":"object"
   },
   "EndCallOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/EndCallConfig"
     },
     "kind":{
      "const":"end_call",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind"
    ],
    "title":"EndCallOperation",
    "type":"object"
   },
   "EndpointingSpec":{
    "additionalProperties":false,
    "description":"How long a caller's silence must last before the agent takes the turn.",
    "properties":{
     "max_silence_duration":{
      "default":2.5,
      "description":"How long to wait instead when the turn detector judges the caller is mid-thought. Only a batch speech-to-text model in one of the turn detector's 14 languages gets that judgement; every other pipeline ends turns on silence and ignores this.",
      "minimum":0.0,
      "title":"Max Silence Duration",
      "type":"number"
     },
     "min_silence_duration":{
      "default":0.5,
      "description":"How long the caller must stay silent, in seconds, before the agent takes the turn. A streaming speech-to-text model may wait longer when it hears the caller is not finished.",
      "minimum":0.25,
      "title":"Min Silence Duration",
      "type":"number"
     }
    },
    "title":"EndpointingSpec",
    "type":"object"
   },
   "EndpointingSpecOverride":{
    "additionalProperties":false,
    "description":"A partial EndpointingSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "max_silence_duration":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"How long to wait instead when the turn detector judges the caller is mid-thought. Only a batch speech-to-text model in one of the turn detector's 14 languages gets that judgement; every other pipeline ends turns on silence and ignores this.",
      "title":"Max Silence Duration"
     },
     "min_silence_duration":{
      "anyOf":[
       {
        "minimum":0.25,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"How long the caller must stay silent, in seconds, before the agent takes the turn. A streaming speech-to-text model may wait longer when it hears the caller is not finished.",
      "title":"Min Silence Duration"
     }
    },
    "title":"EndpointingSpecOverride",
    "type":"object"
   },
   "ErrorBody":{
    "description":"The structured half of our error contract: a human `message` plus a list\nof individual `errors` (used wherever we surface many problems at once,\nincluding tool publish, op-tree checks, and request validation). The global\nexception handlers normalize every API error to\n`{detail: {message, errors, code}}`, so SDKs can parse one shape consistently.",
    "properties":{
     "code":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"A stable identifier for this error, when it has one.",
      "title":"Code"
     },
     "errors":{
      "items":{
       "type":"string"
      },
      "title":"Errors",
      "type":"array"
     },
     "message":{
      "title":"Message",
      "type":"string"
     }
    },
    "required":[
     "message",
     "errors"
    ],
    "title":"ErrorBody",
    "type":"object"
   },
   "ErrorResponse":{
    "description":"The body of every error response, at every status code.",
    "properties":{
     "detail":{
      "$ref":"#/components/schemas/ErrorBody"
     }
    },
    "required":[
     "detail"
    ],
    "title":"ErrorResponse",
    "type":"object"
   },
   "FaqEntryInput":{
    "additionalProperties":false,
    "properties":{
     "answer":{
      "maxLength":2000,
      "minLength":1,
      "title":"Answer",
      "type":"string"
     },
     "question":{
      "maxLength":300,
      "minLength":1,
      "title":"Question",
      "type":"string"
     }
    },
    "required":[
     "question",
     "answer"
    ],
    "title":"FaqEntryInput",
    "type":"object"
   },
   "FaqSelection":{
    "additionalProperties":false,
    "description":"An FAQ the agent answers from: name one with `faq_id`, or define one inline.",
    "properties":{
     "faq":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/InlineFaq"
       },
       {
        "type":"null"
       }
      ]
     },
     "faq_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Faq Id"
     }
    },
    "title":"FaqSelection",
    "type":"object"
   },
   "FrontendRpcConfig":{
    "additionalProperties":false,
    "properties":{
     "method":{
      "pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$",
      "title":"Method",
      "type":"string"
     },
     "payload":{
      "title":"Payload"
     },
     "timeout":{
      "anyOf":[
       {
        "exclusiveMinimum":0.0,
        "maximum":60.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds, not milliseconds. Defaults to 5.",
      "title":"Timeout"
     }
    },
    "required":[
     "method"
    ],
    "title":"FrontendRpcConfig",
    "type":"object"
   },
   "FrontendRpcOperation":{
    "additionalProperties":false,
    "properties":{
     "background_execution":{
      "default":false,
      "title":"Background Execution",
      "type":"boolean"
     },
     "config":{
      "$ref":"#/components/schemas/FrontendRpcConfig"
     },
     "kind":{
      "const":"frontend_rpc",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     },
     "publish_fields":{
      "items":{
       "$ref":"#/components/schemas/PublishFieldRequest"
      },
      "title":"Publish Fields",
      "type":"array"
     },
     "silent":{
      "default":false,
      "title":"Silent",
      "type":"boolean"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"FrontendRpcOperation",
    "type":"object"
   },
   "GenerateReplyConfig":{
    "additionalProperties":false,
    "properties":{
     "instructions":{
      "title":"Instructions",
      "type":"string"
     },
     "wait_for_playback":{
      "default":false,
      "title":"Wait For Playback",
      "type":"boolean"
     }
    },
    "required":[
     "instructions"
    ],
    "title":"GenerateReplyConfig",
    "type":"object"
   },
   "GenerateReplyOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/GenerateReplyConfig"
     },
     "kind":{
      "const":"generate_reply",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"GenerateReplyOperation",
    "type":"object"
   },
   "GreetingSpec":{
    "additionalProperties":false,
    "description":"How the agent opens: a fixed `message`, or `instructions` for the model to write one.",
    "properties":{
     "instructions":{
      "anyOf":[
       {
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"What the model is told to open with; it writes the line. Supports the prompt's substitutions. Adds a model reply's latency before the first word.",
      "title":"Instructions"
     },
     "message":{
      "anyOf":[
       {
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Spoken word for word. Supports the prompt's substitutions, plus `{{recording.notice}}`, the recording notice's place in the line.",
      "title":"Message"
     }
    },
    "title":"GreetingSpec",
    "type":"object"
   },
   "HandoffConfig":{
    "additionalProperties":false,
    "properties":{
     "agent_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"A member of the team this call runs, by name.",
      "title":"Agent Name"
     },
     "context":{
      "default":"transcript",
      "enum":[
       "none",
       "summary",
       "transcript"
      ],
      "title":"Context",
      "type":"string"
     },
     "instructions":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"What the target is told as it opens, when it has no greeting.",
      "title":"Instructions"
     },
     "message":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Spoken while connecting, before the target takes over.",
      "title":"Message"
     },
     "recent_turns":{
      "anyOf":[
       {
        "maximum":10.0,
        "minimum":1.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"Context 'summary' only: turns of this call that cross verbatim beside the summary. Defaults to 2.",
      "title":"Recent Turns"
     },
     "summary":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Required under context 'summary'. A template, not a request for one.",
      "title":"Summary"
     },
     "target_agent_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"A published agent in this workspace.",
      "title":"Target Agent Id"
     }
    },
    "title":"HandoffConfig",
    "type":"object"
   },
   "HandoffOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/HandoffConfig"
     },
     "kind":{
      "const":"handoff",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"HandoffOperation",
    "type":"object"
   },
   "HandoffTarget":{
    "additionalProperties":false,
    "description":"One destination this agent may hand the conversation to.\n\nEach becomes a `handoff_to_<slug>` tool, so `description` is what the model\nroutes on.",
    "properties":{
     "agent_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Agent Id"
     },
     "context":{
      "default":"transcript",
      "enum":[
       "none",
       "summary",
       "transcript"
      ],
      "title":"Context",
      "type":"string"
     },
     "description":{
      "minLength":1,
      "title":"Description",
      "type":"string"
     },
     "instructions":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Instructions"
     },
     "message":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Message"
     },
     "name":{
      "minLength":1,
      "title":"Name",
      "type":"string"
     },
     "recent_turns":{
      "anyOf":[
       {
        "maximum":10.0,
        "minimum":1.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "title":"Recent Turns"
     },
     "summary_prompt":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Summary Prompt"
     }
    },
    "required":[
     "name",
     "description"
    ],
    "title":"HandoffTarget",
    "type":"object"
   },
   "HttpConfig":{
    "additionalProperties":false,
    "properties":{
     "body":{
      "title":"Body"
     },
     "headers":{
      "additionalProperties":{
       "type":"string"
      },
      "title":"Headers",
      "type":"object"
     },
     "method":{
      "enum":[
       "GET",
       "POST",
       "PUT",
       "PATCH",
       "DELETE"
      ],
      "title":"Method",
      "type":"string"
     },
     "query":{
      "additionalProperties":{
       "type":"string"
      },
      "title":"Query",
      "type":"object"
     },
     "timeout":{
      "anyOf":[
       {
        "exclusiveMinimum":0.0,
        "maximum":120.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds, not milliseconds. Defaults to 20.",
      "title":"Timeout"
     },
     "url":{
      "title":"Url",
      "type":"string"
     }
    },
    "required":[
     "method",
     "url"
    ],
    "title":"HttpConfig",
    "type":"object"
   },
   "HttpOperation":{
    "additionalProperties":false,
    "description":"Call a REST API. The right operation for any plain request/response call.",
    "properties":{
     "background_execution":{
      "default":false,
      "title":"Background Execution",
      "type":"boolean"
     },
     "config":{
      "$ref":"#/components/schemas/HttpConfig"
     },
     "kind":{
      "const":"http",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     },
     "publish_fields":{
      "items":{
       "$ref":"#/components/schemas/PublishFieldRequest"
      },
      "title":"Publish Fields",
      "type":"array"
     },
     "silent":{
      "default":false,
      "title":"Silent",
      "type":"boolean"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"HttpOperation",
    "type":"object"
   },
   "IfConfig":{
    "additionalProperties":false,
    "properties":{
     "left":{
      "title":"Left"
     },
     "op":{
      "enum":[
       "eq",
       "neq",
       "gt",
       "lt",
       "exists",
       "in"
      ],
      "title":"Op",
      "type":"string"
     },
     "right":{
      "title":"Right"
     }
    },
    "required":[
     "left",
     "op"
    ],
    "title":"IfConfig",
    "type":"object"
   },
   "IfOperation":{
    "additionalProperties":false,
    "description":"The one branching operation, and the only one with children.\n\nBranches do not rejoin: an `if` is terminal in its chain, so work needed on\nboth paths is written once per path.",
    "properties":{
     "config":{
      "$ref":"#/components/schemas/IfConfig"
     },
     "else":{
      "anyOf":[
       {
        "items":{
         "discriminator":{
          "mapping":{
           "add_message":"#/components/schemas/AddMessageOperation",
           "code":"#/components/schemas/CodeOperation",
           "end_call":"#/components/schemas/EndCallOperation",
           "frontend_rpc":"#/components/schemas/FrontendRpcOperation",
           "generate_reply":"#/components/schemas/GenerateReplyOperation",
           "handoff":"#/components/schemas/HandoffOperation",
           "http":"#/components/schemas/HttpOperation",
           "if":"#/components/schemas/IfOperation",
           "say":"#/components/schemas/SayOperation",
           "send_dtmf":"#/components/schemas/SendDtmfOperation",
           "set_variable":"#/components/schemas/SetVariableOperation",
           "transfer":"#/components/schemas/TransferOperation"
          },
          "propertyName":"kind"
         },
         "oneOf":[
          {
           "$ref":"#/components/schemas/HttpOperation"
          },
          {
           "$ref":"#/components/schemas/CodeOperation"
          },
          {
           "$ref":"#/components/schemas/FrontendRpcOperation"
          },
          {
           "$ref":"#/components/schemas/IfOperation"
          },
          {
           "$ref":"#/components/schemas/SetVariableOperation"
          },
          {
           "$ref":"#/components/schemas/SayOperation"
          },
          {
           "$ref":"#/components/schemas/GenerateReplyOperation"
          },
          {
           "$ref":"#/components/schemas/AddMessageOperation"
          },
          {
           "$ref":"#/components/schemas/EndCallOperation"
          },
          {
           "$ref":"#/components/schemas/HandoffOperation"
          },
          {
           "$ref":"#/components/schemas/TransferOperation"
          },
          {
           "$ref":"#/components/schemas/SendDtmfOperation"
          }
         ]
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "title":"Else"
     },
     "kind":{
      "const":"if",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     },
     "then":{
      "anyOf":[
       {
        "items":{
         "discriminator":{
          "mapping":{
           "add_message":"#/components/schemas/AddMessageOperation",
           "code":"#/components/schemas/CodeOperation",
           "end_call":"#/components/schemas/EndCallOperation",
           "frontend_rpc":"#/components/schemas/FrontendRpcOperation",
           "generate_reply":"#/components/schemas/GenerateReplyOperation",
           "handoff":"#/components/schemas/HandoffOperation",
           "http":"#/components/schemas/HttpOperation",
           "if":"#/components/schemas/IfOperation",
           "say":"#/components/schemas/SayOperation",
           "send_dtmf":"#/components/schemas/SendDtmfOperation",
           "set_variable":"#/components/schemas/SetVariableOperation",
           "transfer":"#/components/schemas/TransferOperation"
          },
          "propertyName":"kind"
         },
         "oneOf":[
          {
           "$ref":"#/components/schemas/HttpOperation"
          },
          {
           "$ref":"#/components/schemas/CodeOperation"
          },
          {
           "$ref":"#/components/schemas/FrontendRpcOperation"
          },
          {
           "$ref":"#/components/schemas/IfOperation"
          },
          {
           "$ref":"#/components/schemas/SetVariableOperation"
          },
          {
           "$ref":"#/components/schemas/SayOperation"
          },
          {
           "$ref":"#/components/schemas/GenerateReplyOperation"
          },
          {
           "$ref":"#/components/schemas/AddMessageOperation"
          },
          {
           "$ref":"#/components/schemas/EndCallOperation"
          },
          {
           "$ref":"#/components/schemas/HandoffOperation"
          },
          {
           "$ref":"#/components/schemas/TransferOperation"
          },
          {
           "$ref":"#/components/schemas/SendDtmfOperation"
          }
         ]
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "title":"Then"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"IfOperation",
    "type":"object"
   },
   "InboundContent":{
    "description":"What the person sent besides text.",
    "properties":{
     "button":{
      "$ref":"#/components/schemas/ButtonTap"
     },
     "kind":{
      "const":"button",
      "title":"Kind",
      "type":"string"
     },
     "replied_to":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "description":"Provider id of the message this answers, e.g. the template.",
      "title":"Replied To"
     }
    },
    "required":[
     "kind",
     "button"
    ],
    "title":"InboundContent",
    "type":"object"
   },
   "InlineFaq":{
    "additionalProperties":false,
    "description":"An FAQ defined here rather than named.\n\nOn the call endpoints it is used for that call only; on the agent and task\nendpoints it is created as a real FAQ.",
    "properties":{
     "entries":{
      "items":{
       "$ref":"#/components/schemas/FaqEntryInput"
      },
      "maxItems":500,
      "minItems":1,
      "title":"Entries",
      "type":"array"
     },
     "name":{
      "maxLength":80,
      "minLength":1,
      "title":"Name",
      "type":"string"
     }
    },
    "required":[
     "name",
     "entries"
    ],
    "title":"InlineFaq",
    "type":"object"
   },
   "InlineMcpServer":{
    "additionalProperties":false,
    "description":"A remote MCP server defined here rather than named.\n\nAPI-key-shaped only \u2014 an OAuth server has to be an integration.\n`tools_namespace` prefixes every tool the model is shown: `crm` -> `crm_search`.",
    "properties":{
     "allowed_tools":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "title":"Allowed Tools"
     },
     "headers":{
      "additionalProperties":{
       "type":"string"
      },
      "title":"Headers",
      "type":"object"
     },
     "name":{
      "minLength":1,
      "title":"Name",
      "type":"string"
     },
     "tools_namespace":{
      "default":"",
      "pattern":"^$|^[a-z][a-z0-9_]{0,23}$",
      "title":"Tools Namespace",
      "type":"string"
     },
     "url":{
      "title":"Url",
      "type":"string"
     }
    },
    "required":[
     "name",
     "url"
    ],
    "title":"InlineMcpServer",
    "type":"object"
   },
   "InlineTool":{
    "additionalProperties":false,
    "description":"A tool defined here rather than named \u2014 the shape `create_tool` takes, with\nno id and no versions.\n\nOn the call endpoints it runs for that call only; on the agent endpoints it\nis created and published as a real tool.",
    "properties":{
     "description":{
      "default":"",
      "title":"Description",
      "type":"string"
     },
     "disable_interruptions":{
      "default":false,
      "title":"Disable Interruptions",
      "type":"boolean"
     },
     "json_schema":{
      "additionalProperties":true,
      "title":"Json Schema",
      "type":"object"
     },
     "long_running_task":{
      "default":false,
      "title":"Long Running Task",
      "type":"boolean"
     },
     "name":{
      "pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$",
      "title":"Name",
      "type":"string"
     },
     "operations":{
      "items":{
       "discriminator":{
        "mapping":{
         "add_message":"#/components/schemas/AddMessageOperation",
         "code":"#/components/schemas/CodeOperation",
         "end_call":"#/components/schemas/EndCallOperation",
         "frontend_rpc":"#/components/schemas/FrontendRpcOperation",
         "generate_reply":"#/components/schemas/GenerateReplyOperation",
         "handoff":"#/components/schemas/HandoffOperation",
         "http":"#/components/schemas/HttpOperation",
         "if":"#/components/schemas/IfOperation",
         "say":"#/components/schemas/SayOperation",
         "send_dtmf":"#/components/schemas/SendDtmfOperation",
         "set_variable":"#/components/schemas/SetVariableOperation",
         "transfer":"#/components/schemas/TransferOperation"
        },
        "propertyName":"kind"
       },
       "oneOf":[
        {
         "$ref":"#/components/schemas/HttpOperation"
        },
        {
         "$ref":"#/components/schemas/CodeOperation"
        },
        {
         "$ref":"#/components/schemas/FrontendRpcOperation"
        },
        {
         "$ref":"#/components/schemas/IfOperation"
        },
        {
         "$ref":"#/components/schemas/SetVariableOperation"
        },
        {
         "$ref":"#/components/schemas/SayOperation"
        },
        {
         "$ref":"#/components/schemas/GenerateReplyOperation"
        },
        {
         "$ref":"#/components/schemas/AddMessageOperation"
        },
        {
         "$ref":"#/components/schemas/EndCallOperation"
        },
        {
         "$ref":"#/components/schemas/HandoffOperation"
        },
        {
         "$ref":"#/components/schemas/TransferOperation"
        },
        {
         "$ref":"#/components/schemas/SendDtmfOperation"
        }
       ]
      },
      "title":"Operations",
      "type":"array"
     },
     "silent":{
      "default":false,
      "title":"Silent",
      "type":"boolean"
     }
    },
    "required":[
     "name"
    ],
    "title":"InlineTool",
    "type":"object"
   },
   "InterruptionSpec":{
    "additionalProperties":false,
    "description":"Whether the caller can cut the agent off mid-sentence, and how easily.",
    "properties":{
     "discard_audio_if_uninterruptible":{
      "default":true,
      "description":"Drop buffered audio while the agent speaks and cannot be interrupted.",
      "title":"Discard Audio If Uninterruptible",
      "type":"boolean"
     },
     "enabled":{
      "default":true,
      "description":"Whether interruptions are enabled.",
      "title":"Enabled",
      "type":"boolean"
     },
     "false_interruption_timeout":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":2.0,
      "description":"Seconds of silence after an interruption before it is classified as false. None disables false-interruption classification.",
      "title":"False Interruption Timeout"
     },
     "min_speech_duration":{
      "default":0.5,
      "description":"Minimum speech length in seconds to register as an interruption.",
      "minimum":0.0,
      "title":"Min Speech Duration",
      "type":"number"
     },
     "min_words":{
      "default":0,
      "description":"Minimum word count to consider an interruption. Applies to STT.",
      "minimum":0.0,
      "title":"Min Words",
      "type":"integer"
     },
     "resume_false_interruption":{
      "default":true,
      "description":"Resume the agent's speech after a false interruption.",
      "title":"Resume False Interruption",
      "type":"boolean"
     }
    },
    "title":"InterruptionSpec",
    "type":"object"
   },
   "InterruptionSpecOverride":{
    "additionalProperties":false,
    "description":"A partial InterruptionSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "discard_audio_if_uninterruptible":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Drop buffered audio while the agent speaks and cannot be interrupted.",
      "title":"Discard Audio If Uninterruptible"
     },
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Whether interruptions are enabled.",
      "title":"Enabled"
     },
     "false_interruption_timeout":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds of silence after an interruption before it is classified as false. None disables false-interruption classification.",
      "title":"False Interruption Timeout"
     },
     "min_speech_duration":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Minimum speech length in seconds to register as an interruption.",
      "title":"Min Speech Duration"
     },
     "min_words":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"Minimum word count to consider an interruption. Applies to STT.",
      "title":"Min Words"
     },
     "resume_false_interruption":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Resume the agent's speech after a false interruption.",
      "title":"Resume False Interruption"
     }
    },
    "title":"InterruptionSpecOverride",
    "type":"object"
   },
   "ItemAuthor":{
    "additionalProperties":false,
    "description":"Who at your business posted an item.",
    "properties":{
     "id":{
      "maxLength":128,
      "minLength":1,
      "title":"Id",
      "type":"string"
     },
     "name":{
      "maxLength":128,
      "minLength":1,
      "title":"Name",
      "type":"string"
     }
    },
    "required":[
     "id",
     "name"
    ],
    "title":"ItemAuthor",
    "type":"object"
   },
   "KeypadInputSpec":{
    "additionalProperties":false,
    "description":"Digits the caller types, delivered as a turn the agent can answer.\n\nPhone and stream calls only, and only where the platform sends DTMF as an\nevent \u2014 tones inside the audio are not detected. `voice` agents only:\nenabling it on `video` or `text` is refused.",
    "properties":{
     "enabled":{
      "default":false,
      "description":"Let the caller answer with the keypad. Each entry arrives as one labelled user turn, and the first keypress interrupts whatever the agent is saying.",
      "title":"Enabled",
      "type":"boolean"
     },
     "terminator":{
      "default":"#",
      "description":"The key that ends an entry. It is not part of the entry, and pressing it on nothing is ignored. Empty means only the quiet timer ends one.",
      "enum":[
       "#",
       "*",
       ""
      ],
      "title":"Terminator",
      "type":"string"
     },
     "timeout":{
      "default":2.0,
      "description":"Seconds of quiet before an entry is taken as finished. 0 waits for the terminator however long it takes.",
      "maximum":10.0,
      "minimum":0.0,
      "title":"Timeout",
      "type":"number"
     }
    },
    "title":"KeypadInputSpec",
    "type":"object"
   },
   "KeypadInputSpecOverride":{
    "additionalProperties":false,
    "description":"A partial KeypadInputSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Let the caller answer with the keypad. Each entry arrives as one labelled user turn, and the first keypress interrupts whatever the agent is saying.",
      "title":"Enabled"
     },
     "terminator":{
      "anyOf":[
       {
        "enum":[
         "#",
         "*",
         ""
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The key that ends an entry. It is not part of the entry, and pressing it on nothing is ignored. Empty means only the quiet timer ends one.",
      "title":"Terminator"
     },
     "timeout":{
      "anyOf":[
       {
        "maximum":10.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds of quiet before an entry is taken as finished. 0 waits for the terminator however long it takes.",
      "title":"Timeout"
     }
    },
    "title":"KeypadInputSpecOverride",
    "type":"object"
   },
   "LLMModelSpec":{
    "additionalProperties":false,
    "properties":{
     "builtin_tools":{
      "items":{
       "$ref":"#/components/schemas/BuiltinToolSpec"
      },
      "title":"Builtin Tools",
      "type":"array"
     },
     "hosts":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.",
      "title":"Hosts"
     },
     "model":{
      "default":"gpt-5.6-luna",
      "title":"Model",
      "type":"string"
     },
     "priority":{
      "default":false,
      "description":"Run this model in its provider's priority (low-latency) lane, where its catalog entry declares one; on OpenRouter, any model (standard where no host sells one). Steadies the worst case rather than the average, and costs more per token.",
      "title":"Priority",
      "type":"boolean"
     },
     "provider":{
      "default":"openai",
      "title":"Provider",
      "type":"string"
     },
     "reasoning_effort":{
      "anyOf":[
       {
        "enum":[
         "none",
         "minimal",
         "low",
         "medium",
         "high"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"How long this model may think before it answers. Must be one of the values the model's catalog entry offers; unset means its fastest. On a voice call the caller hears every second of thinking as silence.",
      "title":"Reasoning Effort"
     }
    },
    "title":"LLMModelSpec",
    "type":"object"
   },
   "LLMModelSpecOverride":{
    "additionalProperties":false,
    "description":"A partial LLMModelSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "builtin_tools":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/BuiltinToolSpec"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "title":"Builtin Tools"
     },
     "hosts":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.",
      "title":"Hosts"
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "priority":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Run this model in its provider's priority (low-latency) lane, where its catalog entry declares one; on OpenRouter, any model (standard where no host sells one). Steadies the worst case rather than the average, and costs more per token.",
      "title":"Priority"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     },
     "reasoning_effort":{
      "anyOf":[
       {
        "enum":[
         "none",
         "minimal",
         "low",
         "medium",
         "high"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"How long this model may think before it answers. Must be one of the values the model's catalog entry offers; unset means its fastest. On a voice call the caller hears every second of thinking as silence.",
      "title":"Reasoning Effort"
     }
    },
    "title":"LLMModelSpecOverride",
    "type":"object"
   },
   "LLMSpec":{
    "additionalProperties":false,
    "properties":{
     "builtin_tools":{
      "items":{
       "$ref":"#/components/schemas/BuiltinToolSpec"
      },
      "title":"Builtin Tools",
      "type":"array"
     },
     "fallback":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/LLMModelSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "hosts":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.",
      "title":"Hosts"
     },
     "model":{
      "default":"gpt-5.6-luna",
      "title":"Model",
      "type":"string"
     },
     "priority":{
      "default":false,
      "description":"Run this model in its provider's priority (low-latency) lane, where its catalog entry declares one; on OpenRouter, any model (standard where no host sells one). Steadies the worst case rather than the average, and costs more per token.",
      "title":"Priority",
      "type":"boolean"
     },
     "provider":{
      "default":"openai",
      "title":"Provider",
      "type":"string"
     },
     "reasoning_effort":{
      "anyOf":[
       {
        "enum":[
         "none",
         "minimal",
         "low",
         "medium",
         "high"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"How long this model may think before it answers. Must be one of the values the model's catalog entry offers; unset means its fastest. On a voice call the caller hears every second of thinking as silence.",
      "title":"Reasoning Effort"
     }
    },
    "title":"LLMSpec",
    "type":"object"
   },
   "LLMSpecOverride":{
    "additionalProperties":false,
    "description":"A partial LLMSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "builtin_tools":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/BuiltinToolSpec"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "title":"Builtin Tools"
     },
     "fallback":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/LLMModelSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "hosts":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"OpenRouter only: the hosts allowed to serve this model, from list_model_hosts; the fastest of them answers. Unset lets OpenRouter use any host.",
      "title":"Hosts"
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "priority":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Run this model in its provider's priority (low-latency) lane, where its catalog entry declares one; on OpenRouter, any model (standard where no host sells one). Steadies the worst case rather than the average, and costs more per token.",
      "title":"Priority"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     },
     "reasoning_effort":{
      "anyOf":[
       {
        "enum":[
         "none",
         "minimal",
         "low",
         "medium",
         "high"
        ],
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"How long this model may think before it answers. Must be one of the values the model's catalog entry offers; unset means its fastest. On a voice call the caller hears every second of thinking as silence.",
      "title":"Reasoning Effort"
     }
    },
    "title":"LLMSpecOverride",
    "type":"object"
   },
   "LatencyStage":{
    "description":"One leg of a wait: what the time went on.",
    "properties":{
     "kind":{
      "enum":[
       "stt",
       "endpoint",
       "hook",
       "llm_step",
       "tool",
       "llm",
       "first_sentence",
       "tts",
       "other"
      ],
      "title":"Kind",
      "type":"string"
     },
     "label":{
      "title":"Label",
      "type":"string"
     },
     "ms":{
      "title":"Ms",
      "type":"number"
     }
    },
    "required":[
     "kind",
     "ms",
     "label"
    ],
    "title":"LatencyStage",
    "type":"object"
   },
   "McpSelection":{
    "additionalProperties":false,
    "description":"An MCP server this agent may call tools on: name an integration, or define\none inline.",
    "properties":{
     "integration_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Integration Id"
     },
     "mcp":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/InlineMcpServer"
       },
       {
        "type":"null"
       }
      ]
     }
    },
    "title":"McpSelection",
    "type":"object"
   },
   "ModelMetadata":{
    "additionalProperties":true,
    "description":"Which model a metrics sample came from.",
    "properties":{
     "model_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Model Name"
     },
     "model_provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Model Provider"
     }
    },
    "title":"ModelMetadata",
    "type":"object"
   },
   "NoiseCancellationSpec":{
    "additionalProperties":false,
    "description":"Speech enhancement on the caller's inbound audio (voice and video).\n\nOff by default. `provider`/`model` name a `noise_cancellation` catalog entry.",
    "properties":{
     "enabled":{
      "default":false,
      "description":"Clean up the caller's audio before the agent hears it. Voice and video only.",
      "title":"Enabled",
      "type":"boolean"
     },
     "enhancement_level":{
      "default":0.8,
      "description":"How hard to suppress everything that is not the caller. 0.5 is conservative and always preserves the foreground speech, 0.8 gives the best word error rate on difficult audio, 1.0 suppresses interfering speech most aggressively.",
      "maximum":1.0,
      "minimum":0.0,
      "title":"Enhancement Level",
      "type":"number"
     },
     "model":{
      "default":"quail_vf_s",
      "title":"Model",
      "type":"string"
     },
     "provider":{
      "default":"aicoustics",
      "title":"Provider",
      "type":"string"
     }
    },
    "title":"NoiseCancellationSpec",
    "type":"object"
   },
   "NoiseCancellationSpecOverride":{
    "additionalProperties":false,
    "description":"A partial NoiseCancellationSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Clean up the caller's audio before the agent hears it. Voice and video only.",
      "title":"Enabled"
     },
     "enhancement_level":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"How hard to suppress everything that is not the caller. 0.5 is conservative and always preserves the foreground speech, 0.8 gives the best word error rate on difficult audio, 1.0 suppresses interfering speech most aggressively.",
      "title":"Enhancement Level"
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     }
    },
    "title":"NoiseCancellationSpecOverride",
    "type":"object"
   },
   "OpenerPolicy":{
    "additionalProperties":false,
    "properties":{
     "opener":{
      "$ref":"#/components/schemas/TemplateSend"
     }
    },
    "required":[
     "opener"
    ],
    "title":"OpenerPolicy",
    "type":"object"
   },
   "OutcomeSpec":{
    "additionalProperties":false,
    "description":"What counts as this call having achieved its purpose.",
    "properties":{
     "prompt":{
      "description":"What a successful call looks like for this agent. Each call is judged against this and comes back as success, failure, or unknown, with the reasoning.",
      "minLength":1,
      "title":"Prompt",
      "type":"string"
     }
    },
    "required":[
     "prompt"
    ],
    "title":"OutcomeSpec",
    "type":"object"
   },
   "OutcomeSpecOverride":{
    "additionalProperties":false,
    "description":"A partial OutcomeSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "prompt":{
      "anyOf":[
       {
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"What a successful call looks like for this agent. Each call is judged against this and comes back as success, failure, or unknown, with the reasoning.",
      "title":"Prompt"
     }
    },
    "title":"OutcomeSpecOverride",
    "type":"object"
   },
   "PostItemRequest":{
    "additionalProperties":false,
    "description":"The agent fields make that agent answer this person; omit them to continue whatever runs.",
    "properties":{
     "agent":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AgentConfig"
       },
       {
        "type":"null"
       }
      ],
      "description":"A complete agent definition, run for this call and stored nowhere. Mutually exclusive with `agent_id`."
     },
     "agent_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"An agent in this workspace. Mutually exclusive with `agent`.",
      "title":"Agent Id"
     },
     "agent_override":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AgentOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Changes layered on top of whichever base was named. Absent keys keep the base value, an explicit null clears the field, objects deep-merge and lists replace."
     },
     "agent_team":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/AgentTeam"
       },
       {
        "type":"null"
       }
      ],
      "description":"Run several agents on this call, defined here. Mutually exclusive with `agent_id` / `agent` / `agent_version` / `agent_override`."
     },
     "agent_version":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "const":"draft",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Which version of `agent_id` to run. Omit for the published one. `\"draft\"` runs the unpublished working copy \u2014 validated and tool-pinned at request time, and refused with the publish errors if it does not hold together.",
      "title":"Agent Version"
     },
     "author":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ItemAuthor"
       },
       {
        "type":"null"
       }
      ],
      "description":"Who at your business posted this; shown in transcripts, never sent to the person or shown to the agent."
     },
     "idempotency_key":{
      "anyOf":[
       {
        "maxLength":255,
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Idempotency Key"
     },
     "on_window_closed":{
      "anyOf":[
       {
        "const":"fail",
        "type":"string"
       },
       {
        "$ref":"#/components/schemas/OpenerPolicy"
       }
      ],
      "default":"fail",
      "description":"fail refuses free text outside WhatsApp's 24h window; an opener sends that template and holds the message until they reply.",
      "title":"On Window Closed"
     },
     "secrets":{
      "anyOf":[
       {
        "additionalProperties":{
         "maxLength":16384,
         "minLength":1,
         "type":"string"
        },
        "maxProperties":20,
        "propertyNames":{
         "pattern":"^[A-Za-z_][A-Za-z0-9_]*$"
        },
        "type":"object"
       },
       {
        "type":"null"
       }
      ],
      "description":"Secrets for this session only, read by tools as {{secrets.NAME}}; a name here overrides the workspace secret. Never shown to the model or returned.",
      "title":"Secrets"
     },
     "template":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TemplateSend"
       },
       {
        "type":"null"
       }
      ],
      "description":"For `template` only."
     },
     "text":{
      "anyOf":[
       {
        "maxLength":4096,
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"For the other three types.",
      "title":"Text"
     },
     "to":{
      "$ref":"#/components/schemas/PostTarget",
      "description":"The conversation, or your number and theirs to reach a person with no conversation yet."
     },
     "type":{
      "description":"template and agent_text are delivered; note is never delivered; instruct has the agent write and send a message.",
      "enum":[
       "template",
       "agent_text",
       "note",
       "instruct"
      ],
      "title":"Type",
      "type":"string"
     },
     "userdata":{
      "anyOf":[
       {
        "additionalProperties":true,
        "type":"object"
       },
       {
        "type":"null"
       }
      ],
      "description":"Merged into the person's userdata and given to the agent that answers their reply.",
      "title":"Userdata"
     },
     "vars":{
      "anyOf":[
       {
        "additionalProperties":{
         "type":"string"
        },
        "type":"object"
       },
       {
        "type":"null"
       }
      ],
      "description":"Values for the variables the agents on this session declare, read as {{vars.name}} in a prompt, a greeting and a tool. They override each agent's declared default and reach every agent the session runs, including a handoff target. Unlike `userdata`, which describes the PERSON and is kept on their contact record, these describe THIS session and are gone with it. Strings only; an empty string is a deliberate blank, not a request for the default. The model can see them, so credentials go in `secrets` (this session's own, where the request takes them) or a workspace secret, read as {{secrets.NAME}} by a tool.",
      "title":"Vars"
     }
    },
    "required":[
     "to",
     "type"
    ],
    "title":"PostItemRequest",
    "type":"object"
   },
   "PostTarget":{
    "additionalProperties":false,
    "description":"`conversation_id`, or `number` and `peer`.",
    "properties":{
     "conversation_id":{
      "anyOf":[
       {
        "format":"uuid",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Conversation Id"
     },
     "number":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Your business number, E.164.",
      "title":"Number"
     },
     "peer":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The person's number.",
      "title":"Peer"
     }
    },
    "title":"PostTarget",
    "type":"object"
   },
   "PreemptiveGenerationSpec":{
    "additionalProperties":false,
    "description":"Start drafting a reply before the caller has certainly finished, to cut\nthe pause before the agent speaks.",
    "properties":{
     "enabled":{
      "default":true,
      "description":"Whether preemptive generation is enabled.",
      "title":"Enabled",
      "type":"boolean"
     },
     "max_retries":{
      "default":3,
      "description":"Maximum number of preemptive generation attempts per user turn.",
      "minimum":0.0,
      "title":"Max Retries",
      "type":"integer"
     },
     "max_speech_duration":{
      "default":10.0,
      "description":"Maximum user speech duration in seconds for which preemptive generation is attempted.",
      "minimum":0.0,
      "title":"Max Speech Duration",
      "type":"number"
     },
     "preemptive_tts":{
      "default":false,
      "description":"Whether to also run TTS preemptively before the turn is confirmed.",
      "title":"Preemptive Tts",
      "type":"boolean"
     }
    },
    "title":"PreemptiveGenerationSpec",
    "type":"object"
   },
   "PreemptiveGenerationSpecOverride":{
    "additionalProperties":false,
    "description":"A partial PreemptiveGenerationSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Whether preemptive generation is enabled.",
      "title":"Enabled"
     },
     "max_retries":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"Maximum number of preemptive generation attempts per user turn.",
      "title":"Max Retries"
     },
     "max_speech_duration":{
      "anyOf":[
       {
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Maximum user speech duration in seconds for which preemptive generation is attempted.",
      "title":"Max Speech Duration"
     },
     "preemptive_tts":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Whether to also run TTS preemptively before the turn is confirmed.",
      "title":"Preemptive Tts"
     }
    },
    "title":"PreemptiveGenerationSpecOverride",
    "type":"object"
   },
   "PublishFieldRequest":{
    "additionalProperties":false,
    "properties":{
     "key":{
      "anyOf":[
       {
        "pattern":"^[A-Za-z_][A-Za-z0-9_]*$",
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Key"
     },
     "path":{
      "minLength":1,
      "title":"Path",
      "type":"string"
     },
     "store":{
      "enum":[
       "tooldata",
       "userdata"
      ],
      "title":"Store",
      "type":"string"
     }
    },
    "required":[
     "path",
     "store"
    ],
    "title":"PublishFieldRequest",
    "type":"object"
   },
   "RealtimeSpec":{
    "additionalProperties":false,
    "description":"A speech-to-speech model, which replaces stt + llm + tts together.",
    "properties":{
     "model":{
      "default":"gpt-realtime-2.1",
      "title":"Model",
      "type":"string"
     },
     "provider":{
      "default":"openai",
      "title":"Provider",
      "type":"string"
     },
     "speed":{
      "default":1.0,
      "maximum":2.0,
      "minimum":0.5,
      "title":"Speed",
      "type":"number"
     },
     "voice":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice"
     },
     "voice_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice Name"
     }
    },
    "title":"RealtimeSpec",
    "type":"object"
   },
   "RealtimeSpecOverride":{
    "additionalProperties":false,
    "description":"A partial RealtimeSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     },
     "speed":{
      "anyOf":[
       {
        "maximum":2.0,
        "minimum":0.5,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Speed"
     },
     "voice":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice"
     },
     "voice_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice Name"
     }
    },
    "title":"RealtimeSpecOverride",
    "type":"object"
   },
   "RecordingSpec":{
    "additionalProperties":false,
    "description":"Whether calls with this agent are recorded, and whether the caller is told.\n\nOn by default: one stereo file per call, kept until the workspace's\nretention policy deletes it.",
    "properties":{
     "enabled":{
      "default":true,
      "description":"Record the call audio. Voice and video agents only.",
      "title":"Enabled",
      "type":"boolean"
     },
     "notice":{
      "anyOf":[
       {
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Spoken where the greeting places {{recording.notice}}, uninterruptibly. Null: no notice.",
      "title":"Notice"
     }
    },
    "title":"RecordingSpec",
    "type":"object"
   },
   "RecordingSpecOverride":{
    "additionalProperties":false,
    "description":"A partial RecordingSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Record the call audio. Voice and video agents only.",
      "title":"Enabled"
     },
     "notice":{
      "anyOf":[
       {
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Spoken where the greeting places {{recording.notice}}, uninterruptibly. Null: no notice.",
      "title":"Notice"
     }
    },
    "title":"RecordingSpecOverride",
    "type":"object"
   },
   "ReplyLatency":{
    "description":"How long the caller waited for this reply, in the order it was spent.",
    "properties":{
     "kind":{
      "enum":[
       "response",
       "reply",
       "after_filler"
      ],
      "title":"Kind",
      "type":"string"
     },
     "stages":{
      "items":{
       "$ref":"#/components/schemas/LatencyStage"
      },
      "title":"Stages",
      "type":"array"
     },
     "total_ms":{
      "title":"Total Ms",
      "type":"number"
     }
    },
    "required":[
     "kind",
     "total_ms",
     "stages"
    ],
    "title":"ReplyLatency",
    "type":"object"
   },
   "STTModelSpec":{
    "additionalProperties":false,
    "properties":{
     "model":{
      "default":"saaras:v4",
      "title":"Model",
      "type":"string"
     },
     "provider":{
      "default":"sarvam",
      "title":"Provider",
      "type":"string"
     }
    },
    "title":"STTModelSpec",
    "type":"object"
   },
   "STTModelSpecOverride":{
    "additionalProperties":false,
    "description":"A partial STTModelSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     }
    },
    "title":"STTModelSpecOverride",
    "type":"object"
   },
   "STTSpec":{
    "additionalProperties":false,
    "properties":{
     "fallback":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/STTModelSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "model":{
      "default":"saaras:v4",
      "title":"Model",
      "type":"string"
     },
     "provider":{
      "default":"sarvam",
      "title":"Provider",
      "type":"string"
     }
    },
    "title":"STTSpec",
    "type":"object"
   },
   "STTSpecOverride":{
    "additionalProperties":false,
    "description":"A partial STTSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "fallback":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/STTModelSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     }
    },
    "title":"STTSpecOverride",
    "type":"object"
   },
   "SayConfig":{
    "additionalProperties":false,
    "properties":{
     "text":{
      "title":"Text",
      "type":"string"
     },
     "wait_for_playback":{
      "default":false,
      "title":"Wait For Playback",
      "type":"boolean"
     }
    },
    "required":[
     "text"
    ],
    "title":"SayConfig",
    "type":"object"
   },
   "SayOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/SayConfig"
     },
     "kind":{
      "const":"say",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"SayOperation",
    "type":"object"
   },
   "SendDtmfConfig":{
    "additionalProperties":false,
    "properties":{
     "digits":{
      "description":"Keys to press: 0-9, *, #, A-D. 'w' waits half a second and 'W' one second, for menus that need a pause. Supports {{args.*}} and {{userdata.*}}.",
      "maxLength":64,
      "minLength":1,
      "title":"Digits",
      "type":"string"
     }
    },
    "required":[
     "digits"
    ],
    "title":"SendDtmfConfig",
    "type":"object"
   },
   "SendDtmfOperation":{
    "additionalProperties":false,
    "description":"Press keys on the call's keypad, for an IVR on the other end.\n\nNot terminal, unlike `end_call` and `transfer`: sending digits and then\nsaying something is the normal case, so a chain carries on afterwards.",
    "properties":{
     "config":{
      "$ref":"#/components/schemas/SendDtmfConfig"
     },
     "kind":{
      "const":"send_dtmf",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"SendDtmfOperation",
    "type":"object"
   },
   "SetVariableConfig":{
    "additionalProperties":false,
    "properties":{
     "key":{
      "title":"Key",
      "type":"string"
     },
     "store":{
      "enum":[
       "tooldata",
       "userdata"
      ],
      "title":"Store",
      "type":"string"
     },
     "value":{
      "title":"Value"
     }
    },
    "required":[
     "key",
     "value",
     "store"
    ],
    "title":"SetVariableConfig",
    "type":"object"
   },
   "SetVariableOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/SetVariableConfig"
     },
     "kind":{
      "const":"set_variable",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"SetVariableOperation",
    "type":"object"
   },
   "SilenceSpec":{
    "additionalProperties":false,
    "description":"What the agent does when the caller goes quiet (voice and video).",
    "properties":{
     "enabled":{
      "default":true,
      "description":"Check in on a caller who goes quiet, and hang up if they never answer. Voice and video only.",
      "title":"Enabled",
      "type":"boolean"
     },
     "max_check_ins":{
      "default":2,
      "description":"Check-ins before the agent says goodbye and hangs up. 0 hangs up at the first silence.",
      "maximum":5.0,
      "minimum":0.0,
      "title":"Max Check Ins",
      "type":"integer"
     },
     "timeout":{
      "default":10.0,
      "description":"Seconds of silence after the agent stops talking before it checks in.",
      "maximum":600.0,
      "minimum":5.0,
      "title":"Timeout",
      "type":"number"
     }
    },
    "title":"SilenceSpec",
    "type":"object"
   },
   "SilenceSpecOverride":{
    "additionalProperties":false,
    "description":"A partial SilenceSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Check in on a caller who goes quiet, and hang up if they never answer. Voice and video only.",
      "title":"Enabled"
     },
     "max_check_ins":{
      "anyOf":[
       {
        "maximum":5.0,
        "minimum":0.0,
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "description":"Check-ins before the agent says goodbye and hangs up. 0 hangs up at the first silence.",
      "title":"Max Check Ins"
     },
     "timeout":{
      "anyOf":[
       {
        "maximum":600.0,
        "minimum":5.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds of silence after the agent stops talking before it checks in.",
      "title":"Timeout"
     }
    },
    "title":"SilenceSpecOverride",
    "type":"object"
   },
   "TTSModelSpec":{
    "additionalProperties":false,
    "properties":{
     "expressive":{
      "default":false,
      "description":"Let the model write delivery tags - a laugh, a whisper, a pause before the key detail - into what this voice speaks. Only for models whose catalog entry declares an `expressive` dialect; GET /catalog reports it per model.",
      "title":"Expressive",
      "type":"boolean"
     },
     "model":{
      "default":"bulbul:v3",
      "title":"Model",
      "type":"string"
     },
     "provider":{
      "default":"sarvam",
      "title":"Provider",
      "type":"string"
     },
     "similarity_boost":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Similarity Boost"
     },
     "speed":{
      "default":1.0,
      "maximum":2.0,
      "minimum":0.5,
      "title":"Speed",
      "type":"number"
     },
     "stability":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Stability"
     },
     "voice":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice"
     },
     "voice_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice Name"
     }
    },
    "title":"TTSModelSpec",
    "type":"object"
   },
   "TTSModelSpecOverride":{
    "additionalProperties":false,
    "description":"A partial TTSModelSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "expressive":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Let the model write delivery tags - a laugh, a whisper, a pause before the key detail - into what this voice speaks. Only for models whose catalog entry declares an `expressive` dialect; GET /catalog reports it per model.",
      "title":"Expressive"
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     },
     "similarity_boost":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Similarity Boost"
     },
     "speed":{
      "anyOf":[
       {
        "maximum":2.0,
        "minimum":0.5,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Speed"
     },
     "stability":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Stability"
     },
     "voice":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice"
     },
     "voice_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice Name"
     }
    },
    "title":"TTSModelSpecOverride",
    "type":"object"
   },
   "TTSSpec":{
    "additionalProperties":false,
    "properties":{
     "expressive":{
      "default":false,
      "description":"Let the model write delivery tags - a laugh, a whisper, a pause before the key detail - into what this voice speaks. Only for models whose catalog entry declares an `expressive` dialect; GET /catalog reports it per model.",
      "title":"Expressive",
      "type":"boolean"
     },
     "fallback":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TTSModelSpec"
       },
       {
        "type":"null"
       }
      ]
     },
     "model":{
      "default":"bulbul:v3",
      "title":"Model",
      "type":"string"
     },
     "provider":{
      "default":"sarvam",
      "title":"Provider",
      "type":"string"
     },
     "similarity_boost":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Similarity Boost"
     },
     "speed":{
      "default":1.0,
      "maximum":2.0,
      "minimum":0.5,
      "title":"Speed",
      "type":"number"
     },
     "stability":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Stability"
     },
     "voice":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice"
     },
     "voice_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice Name"
     }
    },
    "title":"TTSSpec",
    "type":"object"
   },
   "TTSSpecOverride":{
    "additionalProperties":false,
    "description":"A partial TTSSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "expressive":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Let the model write delivery tags - a laugh, a whisper, a pause before the key detail - into what this voice speaks. Only for models whose catalog entry declares an `expressive` dialect; GET /catalog reports it per model.",
      "title":"Expressive"
     },
     "fallback":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TTSModelSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     },
     "model":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Model"
     },
     "provider":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Provider"
     },
     "similarity_boost":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Similarity Boost"
     },
     "speed":{
      "anyOf":[
       {
        "maximum":2.0,
        "minimum":0.5,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Speed"
     },
     "stability":{
      "anyOf":[
       {
        "maximum":1.0,
        "minimum":0.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "title":"Stability"
     },
     "voice":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice"
     },
     "voice_name":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Voice Name"
     }
    },
    "title":"TTSSpecOverride",
    "type":"object"
   },
   "TaskConfig":{
    "additionalProperties":false,
    "description":"LiveKit's `AgentTask`: an agent with a typed result, on someone else's stack.\n\nIt declares no channel, no media and no greeting. Entered by an agent it\nspeaks with that call's voice and hears with its ears; run on its own from\n`POST /task-runs` it is an LLM with tools and nobody to talk to. Which\nof the two happens is the caller's, never the task's.",
    "properties":{
     "faqs":{
      "description":"FAQs the agent answers from: questions go in the prompt, answers are fetched on demand.",
      "items":{
       "$ref":"#/components/schemas/FaqSelection"
      },
      "maxItems":10,
      "title":"Faqs",
      "type":"array"
     },
     "finish_without_result_description":{
      "default":"Finish without result only if you have failed to achieve the goal of this task and would like to give up rather than continue.",
      "description":"Description of `finish_without_result`, the tool that abandons a task an agent entered. Narrow it if the task gives up too readily. Unused by a standalone run.",
      "minLength":1,
      "title":"Finish Without Result Description",
      "type":"string"
     },
     "llm":{
      "$ref":"#/components/schemas/LLMSpec"
     },
     "max_steps":{
      "default":25,
      "description":"How many LLM -> tools -> LLM rounds a standalone run may take. A round, not a tool call: four tools in one reply cost one step. Entered by an agent, the calling call's own limit applies instead.",
      "maximum":50.0,
      "minimum":1.0,
      "title":"Max Steps",
      "type":"integer"
     },
     "mcps":{
      "description":"MCP servers whose tools may be called \u2014 each named by the integration that holds its credential, or defined inline. Which of a named server's tools may be called is the integration's own `allowed_tools`, not this list.",
      "items":{
       "$ref":"#/components/schemas/McpSelection"
      },
      "title":"Mcps",
      "type":"array"
     },
     "name":{
      "description":"Unique in the workspace.",
      "minLength":1,
      "title":"Name",
      "type":"string"
     },
     "on_enter":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_exit":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "on_user_turn_completed":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ToolSelection"
       },
       {
        "type":"null"
       }
      ]
     },
     "output":{
      "description":"The typed value this task produces: up to 25 top-level fields, nesting up to 4 levels and 100 fields in all. The model finishes by calling a `submit_result` tool built from them. Publishing needs at least one.",
      "items":{
       "$ref":"#/components/schemas/TaskOutputField"
      },
      "maxItems":25,
      "title":"Output",
      "type":"array"
     },
     "prompt":{
      "default":"",
      "description":"The system prompt. `{{vars.name}}` is substituted from the values the run was started with \u2014 or, entered by an agent, from the call's own values and the arguments the model supplied.",
      "title":"Prompt",
      "type":"string"
     },
     "submit_result_description":{
      "default":"Submit results if you are sure that you have achieved the goal of this task",
      "description":"Description of the generated `submit_result` tool - what the call is, where the output fields describe the values.",
      "minLength":1,
      "title":"Submit Result Description",
      "type":"string"
     },
     "timeout_seconds":{
      "default":300,
      "description":"How long this may take before it is abandoned. Entered by an agent it is the only bound on how long the caller is held, so keep it short on a voice agent.",
      "maximum":600.0,
      "minimum":10.0,
      "title":"Timeout Seconds",
      "type":"integer"
     },
     "timezone":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"The IANA timezone this clock runs on, e.g. 'Asia/Kolkata'. Set it and the prompt and tools can read {{system_vars.now}}, {{system_vars.date}} and {{system_vars.time}}. Required only if one of those is used.",
      "title":"Timezone"
     },
     "tools":{
      "description":"Tools the model may call. Publishing pins each one to the tool version live at that moment, so republishing a tool does not change this until it is published again.",
      "items":{
       "$ref":"#/components/schemas/ToolSelection"
      },
      "title":"Tools",
      "type":"array"
     },
     "vars":{
      "description":"The inputs this task takes, read as {{vars.name}} in the prompt and in its tools. Declare only what the caller or the model must supply: anything the task can read for itself ({{userdata.*}}, {{system_vars.*}}) it should read in its prompt instead.",
      "items":{
       "$ref":"#/components/schemas/VarDeclaration"
      },
      "title":"Vars",
      "type":"array"
     }
    },
    "required":[
     "name"
    ],
    "title":"TaskConfig",
    "type":"object"
   },
   "TaskOutputField":{
    "additionalProperties":false,
    "description":"One value the model must produce: a scalar, an object of named fields, or an array.",
    "properties":{
     "description":{
      "description":"What the model should put here, and what to send when it cannot find out. This is the field's description in the tool schema, so it is literally the prompt for this value.",
      "minLength":1,
      "title":"Description",
      "type":"string"
     },
     "enum":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"Allowed values. Strings only.",
      "title":"Enum"
     },
     "fields":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/TaskOutputField"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"An object's fields.",
      "title":"Fields"
     },
     "items":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TaskOutputItem"
       },
       {
        "type":"null"
       }
      ],
      "description":"An array's element."
     },
     "name":{
      "description":"Identifier for this value, as it appears in the run's `output` and anywhere the run is consumed. Lower-case letters, digits and underscores.",
      "pattern":"^[a-z][a-z0-9_]{0,39}$",
      "title":"Name",
      "type":"string"
     },
     "required":{
      "default":true,
      "description":"Refuse a null for this field. Turn it off for a value the model may legitimately fail to find, and say in the description when to send null.",
      "title":"Required",
      "type":"boolean"
     },
     "type":{
      "default":"string",
      "description":"The shape of the value. `object` takes `fields`; `array` takes `items`.",
      "enum":[
       "string",
       "boolean",
       "integer",
       "number",
       "object",
       "array"
      ],
      "title":"Type",
      "type":"string"
     }
    },
    "required":[
     "name",
     "description"
    ],
    "title":"TaskOutputField",
    "type":"object"
   },
   "TaskOutputItem":{
    "additionalProperties":false,
    "description":"What an array holds: one element's shape. Unnamed, and never null.",
    "properties":{
     "description":{
      "default":"",
      "description":"What one element is.",
      "title":"Description",
      "type":"string"
     },
     "enum":{
      "anyOf":[
       {
        "items":{
         "type":"string"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"Allowed values. Strings only.",
      "title":"Enum"
     },
     "fields":{
      "anyOf":[
       {
        "items":{
         "$ref":"#/components/schemas/TaskOutputField"
        },
        "type":"array"
       },
       {
        "type":"null"
       }
      ],
      "description":"An object element's fields.",
      "title":"Fields"
     },
     "items":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TaskOutputItem"
       },
       {
        "type":"null"
       }
      ],
      "description":"A nested array's element."
     },
     "type":{
      "default":"string",
      "enum":[
       "string",
       "boolean",
       "integer",
       "number",
       "object",
       "array"
      ],
      "title":"Type",
      "type":"string"
     }
    },
    "title":"TaskOutputItem",
    "type":"object"
   },
   "TaskSelection":{
    "additionalProperties":false,
    "description":"One job this agent can enter and come back from: name a stored task, or\ndefine one inline.",
    "properties":{
     "description":{
      "description":"Start with \"Handoff to an agent task responsible for ...\", then say when to enter it and when to skip it.",
      "minLength":1,
      "title":"Description",
      "type":"string"
     },
     "message":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Message"
     },
     "name":{
      "pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$",
      "title":"Name",
      "type":"string"
     },
     "task":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/TaskConfig"
       },
       {
        "type":"null"
       }
      ]
     },
     "task_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Task Id"
     },
     "task_version":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "title":"Task Version"
     }
    },
    "required":[
     "name",
     "description"
    ],
    "title":"TaskSelection",
    "type":"object"
   },
   "TemplateSend":{
    "additionalProperties":false,
    "properties":{
     "id":{
      "description":"Twilio Content SID (HX\u2026) or Gupshup template id.",
      "maxLength":64,
      "minLength":1,
      "title":"Id",
      "type":"string"
     },
     "variables":{
      "additionalProperties":{
       "type":"string"
      },
      "description":"Every placeholder, button variables included.",
      "title":"Variables",
      "type":"object"
     }
    },
    "required":[
     "id"
    ],
    "title":"TemplateSend",
    "type":"object"
   },
   "ToolSelection":{
    "additionalProperties":false,
    "description":"A tool the agent may run: name one with `tool_id`, or define one inline.",
    "properties":{
     "tool":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/InlineTool"
       },
       {
        "type":"null"
       }
      ]
     },
     "tool_id":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Tool Id"
     },
     "tool_version":{
      "anyOf":[
       {
        "type":"integer"
       },
       {
        "type":"null"
       }
      ],
      "title":"Tool Version"
     }
    },
    "title":"ToolSelection",
    "type":"object"
   },
   "TransferConfig":{
    "additionalProperties":false,
    "properties":{
     "destination":{
      "description":"A literal phone number in full international format, e.g. +14155550101.",
      "title":"Destination",
      "type":"string"
     },
     "mode":{
      "default":"cold",
      "enum":[
       "cold",
       "warm"
      ],
      "title":"Mode",
      "type":"string"
     },
     "on_failure":{
      "default":"continue",
      "enum":[
       "continue",
       "end_call"
      ],
      "title":"On Failure",
      "type":"string"
     },
     "ringing_timeout":{
      "anyOf":[
       {
        "maximum":120.0,
        "minimum":5.0,
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "description":"Seconds the destination may ring. Defaults to 30.",
      "title":"Ringing Timeout"
     }
    },
    "required":[
     "destination"
    ],
    "title":"TransferConfig",
    "type":"object"
   },
   "TransferOperation":{
    "additionalProperties":false,
    "properties":{
     "config":{
      "$ref":"#/components/schemas/TransferConfig"
     },
     "kind":{
      "const":"transfer",
      "title":"Kind",
      "type":"string"
     },
     "on_error":{
      "default":"abort",
      "enum":[
       "abort",
       "continue"
      ],
      "title":"On Error",
      "type":"string"
     }
    },
    "required":[
     "kind",
     "config"
    ],
    "title":"TransferOperation",
    "type":"object"
   },
   "TurnHandlingSpec":{
    "additionalProperties":false,
    "description":"How the agent decides the caller has finished, and what it does about it.",
    "properties":{
     "endpointing":{
      "$ref":"#/components/schemas/EndpointingSpec",
      "description":"Endpointing configuration."
     },
     "interruption":{
      "$ref":"#/components/schemas/InterruptionSpec",
      "description":"Interruption handling configuration."
     },
     "preemptive_generation":{
      "$ref":"#/components/schemas/PreemptiveGenerationSpec",
      "description":"Preemptive generation configuration."
     }
    },
    "title":"TurnHandlingSpec",
    "type":"object"
   },
   "TurnHandlingSpecOverride":{
    "additionalProperties":false,
    "description":"A partial TurnHandlingSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "endpointing":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/EndpointingSpecOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Endpointing configuration."
     },
     "interruption":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/InterruptionSpecOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Interruption handling configuration."
     },
     "preemptive_generation":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/PreemptiveGenerationSpecOverride"
       },
       {
        "type":"null"
       }
      ],
      "description":"Preemptive generation configuration."
     }
    },
    "title":"TurnHandlingSpecOverride",
    "type":"object"
   },
   "TurnMetrics":{
    "additionalProperties":true,
    "description":"LiveKit MetricsReport samples for one transcript row, in seconds.\n\nEvery field is optional and unknown keys are kept: LiveKit owns this bag,\nso a version of it that reports something new must not fail a transcript\nwrite. What is named here is what the platform reads \u2014 the rest rides along\nverbatim.\n\nWhich fields are present depends on the row: `transcription_delay` and\n`end_of_turn_delay` are measured on the caller's message, the rest on the\nreply that closed the turn.",
    "properties":{
     "e2e_latency":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"E2E Latency"
     },
     "end_of_turn_delay":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"End Of Turn Delay"
     },
     "llm_metadata":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ModelMetadata"
       },
       {
        "type":"null"
       }
      ],
      "default":null
     },
     "llm_node_ttft":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Llm Node Ttft"
     },
     "llm_tokens_per_second":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Llm Tokens Per Second"
     },
     "on_user_turn_completed_delay":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"On User Turn Completed Delay"
     },
     "started_speaking_at":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Started Speaking At"
     },
     "stopped_speaking_at":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Stopped Speaking At"
     },
     "stt_metadata":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ModelMetadata"
       },
       {
        "type":"null"
       }
      ],
      "default":null
     },
     "transcription_delay":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Transcription Delay"
     },
     "tts_metadata":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/ModelMetadata"
       },
       {
        "type":"null"
       }
      ],
      "default":null
     },
     "tts_node_ttfb":{
      "anyOf":[
       {
        "type":"number"
       },
       {
        "type":"null"
       }
      ],
      "default":null,
      "title":"Tts Node Ttfb"
     }
    },
    "title":"TurnMetrics",
    "type":"object"
   },
   "VarDeclaration":{
    "additionalProperties":false,
    "description":"One `{{vars.*}}` variable this agent reads, and what it falls back to.\n\nThe request that starts the session supplies values that override `default`;\nan inbound phone call or message has none, so `default` is what resolves.",
    "properties":{
     "default":{
      "anyOf":[
       {
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "title":"Default"
     },
     "description":{
      "default":"",
      "title":"Description",
      "type":"string"
     },
     "name":{
      "minLength":1,
      "title":"Name",
      "type":"string"
     },
     "required":{
      "default":false,
      "description":"Refuse the session rather than resolve this to nothing; a `default` satisfies it. An inbound phone call carries no request to supply values, so a voice agent requiring a variable with no default cannot be assigned to a phone number.",
      "title":"Required",
      "type":"boolean"
     },
     "type":{
      "default":"text",
      "description":"'file' takes a PDF on a task run. Tasks only.",
      "enum":[
       "text",
       "file"
      ],
      "title":"Type",
      "type":"string"
     },
     "untrusted":{
      "default":false,
      "description":"Third-party content: given to the model as data, never templated. Tasks only.",
      "title":"Untrusted",
      "type":"boolean"
     }
    },
    "required":[
     "name"
    ],
    "title":"VarDeclaration",
    "type":"object"
   },
   "VisionInputSpec":{
    "additionalProperties":false,
    "description":"What the agent watches live during a call, as opposed to images people send it.\n\nWeb voice and video calls only, on a cascade pipeline, and only on a model\nwhose catalog entry says `vision`. Enabling it on `text` is refused.",
    "properties":{
     "screenshare":{
      "$ref":"#/components/schemas/VisionSourceSpec"
     }
    },
    "title":"VisionInputSpec",
    "type":"object"
   },
   "VisionInputSpecOverride":{
    "additionalProperties":false,
    "description":"A partial VisionInputSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "screenshare":{
      "anyOf":[
       {
        "$ref":"#/components/schemas/VisionSourceSpecOverride"
       },
       {
        "type":"null"
       }
      ]
     }
    },
    "title":"VisionInputSpecOverride",
    "type":"object"
   },
   "VisionSourceSpec":{
    "additionalProperties":false,
    "description":"One live video source the agent watches while a call is running.",
    "properties":{
     "enabled":{
      "default":false,
      "description":"Let the agent see this. On each turn it is shown the most recent frame, and only that one, so a long call does not get slower or more expensive over time. Each frame is charged as image input on your language model.",
      "title":"Enabled",
      "type":"boolean"
     },
     "record":{
      "default":false,
      "description":"Record what was shared as a 1 fps video, so the call can be replayed with the screen in sync with the audio. Stored and purged exactly like the call recording, under this workspace's retention policy.",
      "title":"Record",
      "type":"boolean"
     }
    },
    "title":"VisionSourceSpec",
    "type":"object"
   },
   "VisionSourceSpecOverride":{
    "additionalProperties":false,
    "description":"A partial VisionSourceSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Let the agent see this. On each turn it is shown the most recent frame, and only that one, so a long call does not get slower or more expensive over time. Each frame is charged as image input on your language model.",
      "title":"Enabled"
     },
     "record":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"Record what was shared as a 1 fps video, so the call can be replayed with the screen in sync with the audio. Stored and purged exactly like the call recording, under this workspace's retention policy.",
      "title":"Record"
     }
    },
    "title":"VisionSourceSpecOverride",
    "type":"object"
   },
   "VoicemailDetectionSpec":{
    "additionalProperties":false,
    "description":"Hang up on, or leave a message for, an outbound call that reaches voicemail.",
    "properties":{
     "enabled":{
      "default":false,
      "description":"On calls the agent places, let it recognise a voicemail greeting and hang up. The call ends as `voicemail`.",
      "title":"Enabled",
      "type":"boolean"
     },
     "message":{
      "anyOf":[
       {
        "maxLength":2000,
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Spoken word for word after the greeting, then the agent hangs up. Null hangs up without one. Supports the same substitutions as the greeting.",
      "title":"Message"
     }
    },
    "title":"VoicemailDetectionSpec",
    "type":"object"
   },
   "VoicemailDetectionSpecOverride":{
    "additionalProperties":false,
    "description":"A partial VoicemailDetectionSpec: only the fields this call changes. Absent keeps the base value, an explicit null clears it, objects deep-merge and lists replace.",
    "properties":{
     "enabled":{
      "anyOf":[
       {
        "type":"boolean"
       },
       {
        "type":"null"
       }
      ],
      "description":"On calls the agent places, let it recognise a voicemail greeting and hang up. The call ends as `voicemail`.",
      "title":"Enabled"
     },
     "message":{
      "anyOf":[
       {
        "maxLength":2000,
        "minLength":1,
        "type":"string"
       },
       {
        "type":"null"
       }
      ],
      "description":"Spoken word for word after the greeting, then the agent hangs up. Null hangs up without one. Supports the same substitutions as the greeting.",
      "title":"Message"
     }
    },
    "title":"VoicemailDetectionSpecOverride",
    "type":"object"
   }
  }
 }
}
```
