{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/skysay-ai/json-schema/skysay-ai-agent-voice-stack-update-schema.json",
  "title": "AgentVoiceStackUpdate",
  "description": "Selection/update payload. It carries only selectors, existing credential IDs, tools, and tuning -- never provider secret material. Supplying languages replaces the selected set; supplying language_profiles replaces sparse overrides, while omission preserves them. After language opt-in, shared prompt, stack, or credential saves explicitly republish inherited effective profiles.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/skysay-ai-openapi.json#/components/schemas/AgentVoiceStackUpdate",
  "properties": {
    "answer_detection": {
      "$ref": "#/$defs/AgentAnswerDetection"
    },
    "audio_environment": {
      "$ref": "#/$defs/AudioEnvironmentSelection"
    },
    "begin_message": {
      "description": "Legacy alias for first_message.",
      "type": "string"
    },
    "component_credential_bindings": {
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "Optional stt/llm/tts map to existing hosted-AI credential IDs (or null to use platform-managed selection). References are validated; secret upload is a separate write-only API.",
      "type": "object"
    },
    "expected_publication_version": {
      "description": "The publication version on screen. The save is refused with 409 (reason publication_version_conflict) when the AI agent was published again since.",
      "minimum": 0,
      "type": "integer"
    },
    "expected_system_prompt": {
      "description": "Optional previously read prompt. When system_prompt is supplied, a mismatch returns 409 prompt_publication_conflict without publishing or writing any configuration.",
      "type": "string"
    },
    "expected_tools": {
      "description": "Optional previously read complete tools array, including read-only refs. With a tools replacement, a mismatch returns 409 with error AgentToolsChangedError and writes nothing. Workspace editors and calendar attachment send it to avoid lost changes.",
      "items": {
        "$ref": "#/$defs/AgentTool"
      },
      "type": "array"
    },
    "expected_voice_setup_revision": {
      "description": "Required when voice_setup is supplied; stale revisions return 409.",
      "minimum": 0,
      "type": "integer"
    },
    "first_message": {
      "type": "string"
    },
    "follow_caller": {
      "$ref": "#/$defs/AgentFollowCaller"
    },
    "follow_caller_where_supported": {
      "description": "Apply the language rule to this save: follow the other person in every language the saved setup supports where it can, otherwise answer in the opening language only, switching back on when a later save with the rule can follow. When another save changed the setup so that this decision no longer holds (following the other person, or the opening language only), the save is refused with 409 (reason voice_setup_changed): send it again. A change that leaves the decision as it was does not refuse the save. Omit follow_caller, languages, language_profiles and voice_setup beside it.",
      "enum": [
        true
      ],
      "type": "boolean"
    },
    "language": {
      "type": "string"
    },
    "language_profile_revision": {
      "description": "Optional optimistic-concurrency revision returned by GET. A stale value returns conflict; reload before retrying.",
      "minimum": 0,
      "type": "integer"
    },
    "language_profiles": {
      "description": "When supplied this replaces the sparse override set; omit it to preserve overrides. An engine without a language axis (see voice_frontend and the agent-catalog conversation_engines block) REFUSES this field with 400 rather than accepting and dropping it.",
      "items": {
        "$ref": "#/$defs/AgentLanguageProfileOverride"
      },
      "maxItems": 256,
      "type": "array"
    },
    "languages": {
      "description": "When supplied this replaces the selected language set. An engine without a language axis (see voice_frontend and the agent-catalog conversation_engines block) REFUSES this field with 400 rather than accepting and dropping it.",
      "items": {
        "maxLength": 35,
        "minLength": 2,
        "type": "string"
      },
      "maxItems": 256,
      "minItems": 1,
      "type": "array"
    },
    "listening": {
      "$ref": "#/$defs/AgentListening"
    },
    "model": {
      "$ref": "#/$defs/VoiceComponentSelection"
    },
    "navigation": {
      "$ref": "#/$defs/AgentNavigation"
    },
    "opening": {
      "$ref": "#/$defs/AgentOpening"
    },
    "system_prompt": {
      "type": "string"
    },
    "tools": {
      "items": {
        "$ref": "#/$defs/AgentTool"
      },
      "type": "array"
    },
    "transcriber": {
      "$ref": "#/$defs/VoiceComponentSelection"
    },
    "turn_taking": {
      "$ref": "#/$defs/AgentTurnTaking"
    },
    "voice": {
      "oneOf": [
        {
          "$ref": "#/$defs/VoiceComponentSelection"
        },
        {
          "description": "Legacy voice label.",
          "type": "string"
        }
      ]
    },
    "voice_confirmation": {
      "description": "Confirm the voice: clears metadata.voice_confirmation in the same save. Needs expected_publication_version.",
      "enum": [
        "confirmed"
      ],
      "type": "string"
    },
    "voice_frontend": {
      "description": "Optional conversation engine. Omitted or cascade is STT/LLM/TTS. gpt_live selects GPT-Live 1.1. GET still returns transcriber, model, and voice as an OpenAI compatibility projection. Each engine declares whether it has a language axis; a voice-to-voice engine does not, and this route then refuses languages, language_profiles and follow_caller with a 400 naming the field and the engine. Read has_language_axis from the agent-catalog conversation_engines block rather than assuming it from the id.",
      "enum": [
        "cascade",
        "gpt_live",
        "gemini_live",
        "eleven_realtime"
      ],
      "type": "string"
    },
    "voice_polish": {
      "$ref": "#/$defs/AgentVoicePolish"
    },
    "voice_setup": {
      "$ref": "#/$defs/AgentVoiceSetupEdit"
    }
  },
  "type": "object",
  "$defs": {
    "AgentAcknowledgements": {
      "additionalProperties": false,
      "description": "Optional short acknowledgement while a slow reply is still being prepared: at most one per caller turn, spoken in the agent's own voice, model and current language on a separate outgoing track, cancelled the moment the real reply starts. Off unless enabled. Without phrases the platform's reviewed list for the call language is used; a language without one stays silent rather than switching to English.",
      "properties": {
        "delay_ms": {
          "default": 1200,
          "description": "How long the reply may take before an acknowledgement is worth speaking.",
          "maximum": 3000,
          "minimum": 600,
          "type": "integer"
        },
        "enabled": {
          "type": "boolean"
        },
        "phrases": {
          "description": "Bounded neutral phrases; digits and currency marks are rejected so a phrase cannot carry a factual, payment, legal or consent claim.",
          "items": {
            "maxLength": 40,
            "minLength": 1,
            "type": "string"
          },
          "maxItems": 6,
          "type": "array"
        }
      },
      "type": "object"
    },
    "AgentAnswerDetection": {
      "additionalProperties": false,
      "description": "What the platform does when a call the carrier reported answered turns out not to be a person: non-human audio such as a caller tune, or a voicemail box. Unlike the other tuning sections, a value you send here is STORED even when it equals the current default, and only an ABSENT `answer_detection` key means \"follow the platform default\". That is deliberate: the platform default for this setting is expected to change once the detector has been measured, and an agent that explicitly chose a value keeps it when that happens. Applied when a call starts; saving never changes an in-progress call.",
      "properties": {
        "non_human_audio": {
          "description": "`shadow` records what was heard on every answered call and changes nothing the caller experiences: the classification and its detail appear on the call, and no call is ever ended by it. `end_call` acts on the verdict: the agent stops speaking and the call is ended with `ended_reason: no_human_after_answer`, and the classification and its detail appear on the call as they do under `shadow`. `off` collects nothing, so such a call carries no classification at all. `shadow` is the platform default, so it is what an agent with no stored value gets; sending it explicitly stores it, which is how you keep it if that default later moves. This property carries no JSON Schema `default` on purpose, unlike the other tuning properties: a generated client that pre-filled one would send `shadow` on every save and pin a choice the customer never made, which is the one outcome the storage rule above exists to prevent.",
          "enum": [
            "shadow",
            "end_call",
            "off"
          ],
          "type": "string"
        },
        "voicemail": {
          "description": "What the AI agent does when a voicemail box answers an outbound call. Voicemail is judged from the first seconds of audio after the answer; the phone network does not report it. Only one kind of evidence counts as proof, the same in every language: a record beep that follows a spoken greeting. The greeting before it must reach three recognised words, counted by the spaces and punctuation between them, so in Chinese, Japanese, Thai and other scripts written without spaces a short greeting is undercounted. The platform's language model also reads the far end's words, in any language, and a short greeting it reads as a voicemail greeting counts instead, when that reading arrives before the beep is judged (a few seconds after the beep); a reading in a language the call's transcription is known to handle unreliably is ignored. A mailbox instruction such as \"leave a message\", the model's reading on its own, a fast answer, a long greeting or music only raise suspicion, and a call the platform is unsure about is treated as a person. `shadow` (watch only) records the verdict and what the platform would have done on the call in Calls, and changes nothing the caller experiences. `hang_up` ends the call without a message on proof of a mailbox, with `ended_reason: no_human_after_answer`, `reason_detail: recorded_message_only` and `answer_classification: unknown`, once the beep is confirmed as a single beep and the line has then stayed quiet, about 6.5 seconds after the beep; a person heard before the proof, any sound on the line after the beep (a quiet reply included), audio after the beep that did not arrive, a call waiting in a phone menu or queue, or an answer the carrier did not confirm keeps the call going. `leave_message` plays the `voicemail_messages` entry for the call's language after the beep, once per contact, and hangs up without a message when there is none for that language. `off` detects nothing. `leave_message` is accepted and stored now but currently runs as `shadow`: it starts acting only after the detector has passed its accuracy check. Each call's evidence shows both the chosen and the effective mode. `shadow` is the platform default; like `non_human_audio`, an explicitly sent value is stored even when it equals the default, and this property carries no JSON Schema `default`. The `answer_detection` object is replaced as a whole on save, so send every key you want to keep.",
          "enum": [
            "shadow",
            "hang_up",
            "leave_message",
            "off"
          ],
          "type": "string"
        },
        "voicemail_messages": {
          "additionalProperties": {
            "maxLength": 400,
            "type": "string"
          },
          "description": "The messages left when `voicemail` is `leave_message`, one per language, keyed by language code (`{\"en\": \"...\", \"et\": \"...\"}`); a locale such as `de-DE` is stored as `de`. `leave_message` requires at least one. The message played is the one for the language the call is actually in; a call in a language with no message is ended without one, never given a message in another language. Plain text; runs of whitespace are collapsed, a blank text removes that language's message, and control characters are refused. Each message is played exactly as approved, never improvised by the AI agent, so keep it neutral: who is calling and how to call back, with no account, amount or other personal details, because a voicemail box can be heard by someone other than the person you meant to reach. Messages are kept when `voicemail` changes to another mode and for languages the agent no longer offers.",
          "maxProperties": 32,
          "propertyNames": {
            "pattern": "^[A-Za-z]{2,3}([-_][A-Za-z0-9]+)*$"
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "AgentFollowCaller": {
      "additionalProperties": false,
      "description": "Saved and published automatic multilingual policy. On by default: an AI agent that never set it follows its caller wherever one transcriber can listen for its whole selected language set, and answers in its opening language elsewhere, never refused for it. Sending enabled records an explicit choice that stays when the language set or transcriber changes: false keeps the AI agent in its opening language, and true is refused where the transcriber cannot follow. Sending the value the AI agent already resolves to publishes nothing new. Read responses always carry the resolved value, so a client that never wants to choose omits the field. Existing clients may send only enabled; omitted scope means selected. With scope all, the server resolves every language compatible with the exact stack at publication and freezes that concrete set. With selected, languages supplies the allowed subset. Clients cannot supply runtime adapter options, bindings, or rates.",
      "properties": {
        "default": {
          "description": "Read responses only: true when the AI agent never chose and this is the resolved default, false when it is the owner's choice. A voice-stack write that echoes a read with default true and the same value records no choice; at creation the field is stored as sent.",
          "readOnly": true,
          "type": "boolean"
        },
        "enabled": {
          "type": "boolean"
        },
        "scope": {
          "description": "Valid only when enabled. Omit for selected compatibility. All is expanded only at explicit publication and can be unavailable when a provider candidate limit, or the 256-language limit of an AI agent's selection, is smaller than the compatible set.",
          "enum": [
            "selected",
            "all"
          ],
          "type": "string"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    },
    "AgentLanguageProfileOverride": {
      "additionalProperties": false,
      "properties": {
        "greeting": {
          "maxLength": 1000,
          "type": "string"
        },
        "locale": {
          "maxLength": 35,
          "minLength": 2,
          "type": "string"
        },
        "transcriber": {
          "additionalProperties": false,
          "properties": {
            "model": {
              "maxLength": 160,
              "minLength": 1,
              "type": "string"
            },
            "provider": {
              "maxLength": 120,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "provider",
            "model"
          ],
          "type": "object"
        },
        "voice": {
          "additionalProperties": false,
          "properties": {
            "model": {
              "maxLength": 160,
              "minLength": 1,
              "type": "string"
            },
            "provider": {
              "maxLength": 120,
              "minLength": 1,
              "type": "string"
            },
            "voice_id": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "provider",
            "model",
            "voice_id"
          ],
          "type": "object"
        }
      },
      "required": [
        "locale"
      ],
      "type": "object"
    },
    "AgentListening": {
      "additionalProperties": false,
      "description": "Which languages this AI agent's calls listen for. `open` (the default, and what an absent section means): the call's transcriber hears the other party in any language when it has a mode that names no language (Deepgram Nova-3's multilingual mode), on outbound, inbound and browser-test calls alike; the AI agent still answers only in its own published languages. `agent_language`: the transcriber listens in the call's own language only, which is slightly more accurate in that language and hears nothing in others. Changes nothing for a transcriber without such a mode, for a call that follows the caller (its published setting decides), or for a call that holds a keypad value for a phone menu (it listens in the AI agent's language). Saved by voice-stack PATCH and frozen in each publication, so changing it republishes. An engine without a language axis refuses it with 400.",
      "properties": {
        "mode": {
          "default": "open",
          "enum": [
            "open",
            "agent_language"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "AgentModelUnresponsive": {
      "additionalProperties": false,
      "description": "How long the agent may stay silent after the caller has finished speaking before the platform ends the call. It exists because a conversation engine can stop answering without saying so: a provider outage mid-call leaves the line up, the caller talking to nobody and the call billing, and on some engines nothing at all is reported. It counts only time the line was free: the clock starts when a caller turn ends, it does NOT run while the caller is speaking (their own speech is subtracted, so a caller who keeps talking is never cut off mid-sentence, and one who pauses between attempts still reaches the bound), and it is cleared the moment the agent produces anything — a reply, a tool call, or the end of the call. It also never runs while the agent is speaking, while a tool is running, before the caller's first turn, or on a call whose replies come from a workflow. A call ended this way reports `ended_reason` `agent_unresponsive` with `reason_detail` `model_unresponsive` (calls completed before 2026-09-25 reported `model_session_lost` with the same detail). On by default at the platform's own bound; an absent section is that default and is not stored.",
      "properties": {
        "seconds": {
          "description": "The bound, in seconds. `0` switches it off, and is the only value outside the range: an agent that waits on something genuinely slow may need it. Otherwise 10 to 120. The platform's own bound applies when unset.",
          "type": "number"
        }
      },
      "type": "object"
    },
    "AgentNavigation": {
      "additionalProperties": false,
      "description": "Whether the AI agent answers automated phone menus and waits in hold queues on the calls it places, and for how long. On by default: an agent that never chose (`enabled` null) navigates, and a customer who does not want it turns it off once with `enabled: false`, which every save keeps. A write of this section must say what `enabled` is: `true` (on), `false` (off) or `null` (follow the platform default, which is on). An empty object, `null` for the whole section, or a section without `enabled` is refused with 400 `navigation_enabled_required` (an older client used `{}` for off, and it is never guessed at). The section is replaced whole: limits you leave out return to their defaults. Agent create accepts the same section as `metadata.navigation` under the same rules; the generic agent update keeps the stored section and refuses a different one, naming this route. Navigation applies only to outbound calls (calls the agent places, campaign calls included); inbound calls (a phone test you dial in to included), browser tests, simulations, chat and SMS never navigate. Time in menus and on hold is billed at the normal call rate, and a campaign retries a call that ended at the hold limit or the call's maximum length, or whose other side hung up during the hold, without a person reached earlier (running out of the menu limit is final), so a waiting call can cost far more than one that ends at once. While a call is in a menu or on hold, the answer-detection non-human-audio ending is suspended; turn navigation off if an agent must hang up on hold music. The two limits are per agent and apply to the whole call, never to one menu or one queue: time spent in menus and time spent on hold are counted separately, and the call also ends if it reaches its overall maximum length (`turn_taking.max_call_seconds`). A single call cannot change them. While navigation is on (chosen or by default), a limit longer than the AI agent's maximum call length (`turn_taking.max_call_seconds`, at most 1740 seconds) is refused with 400, because a hold or a menu cannot outlast the call; the same refusal applies when you shorten the maximum call length below a limit already set, and when you switch navigation back on beside such a limit. A limit kept beside `enabled: false` is kept as it is. Applied when a call starts; saving never changes an in-progress call, and no republish is needed. Navigation works in any of the agent's languages that the transcribers Skysay can use for phone menus listen to, with at most two connections for all of the agent's languages; there is no separate list of menu languages. A transcriber measured to mishear phone menus in a language is still used for it: the measurement is recorded and the call's events report it, and it never stops an agent from navigating. Saving and publishing are never refused because an agent cannot navigate yet: an agent on GPT-Live, or one whose languages cannot all be listened to, keeps its setting, its calls run without navigation, and the voice-stack response says why in `navigation.eligible`, `navigation.ineligible_reason` and `navigation.ineligible_languages`. Such agents start navigating when support ships, with no change on your side. The tool names `press_digits`, `wait_on_hold` and `abandon_navigation` are reserved for navigation and refused for your own tools.",
      "properties": {
        "effective": {
          "description": "Read-only (see AgentNavigationStatus). Accepted and ignored on write, so a section read back from GET can be sent as it is.",
          "readOnly": true,
          "type": "boolean"
        },
        "eligible": {
          "description": "Read-only (see AgentNavigationStatus). Accepted and ignored on write.",
          "readOnly": true,
          "type": "boolean"
        },
        "enabled": {
          "description": "`true` turns phone-menu navigation and hold waiting on for this agent's outbound calls, `false` turns it off and is kept by every save, and `null` follows the platform default (on). Required in every write of this section.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "ineligible_languages": {
          "description": "Read-only (see AgentNavigationStatus). Accepted and ignored on write.",
          "items": {
            "type": "string"
          },
          "readOnly": true,
          "type": "array"
        },
        "ineligible_reason": {
          "description": "Read-only (see AgentNavigationStatus). Accepted and ignored on write.",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "max_hold_seconds": {
          "default": 600,
          "description": "The most time a call may spend waiting in a hold queue before it ends. When it runs out the call ends with `ended_reason` `ivr_timeout` and `reason_detail` `hold_limit`. Only time the other end is a menu or a queue counts: after a person was confirmed, the platform's own checks of whether a person is speaking are not counted.",
          "maximum": 3600,
          "minimum": 10,
          "type": "integer"
        },
        "max_navigation_seconds": {
          "default": 180,
          "description": "The most time a call may spend answering phone menus before it ends. When it runs out the call ends with `ended_reason` `ivr_timeout` and `reason_detail` `navigation_limit`. Only time the other end is a menu or a queue counts: after a person was confirmed, the platform's own checks of whether a person is speaking are not counted.",
          "maximum": 900,
          "minimum": 10,
          "type": "integer"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    },
    "AgentOpening": {
      "additionalProperties": false,
      "description": "Outbound opening policy shared across conversation engines. Only managed outbound telephone calls use this wait; inbound and browser tests retain their normal opening. Saved by voice-stack PATCH and frozen in each call publication. Empty object resets to callee-first with two seconds of observed silence. Speech is allowed to finish beyond this wait. The timer authorizes the opening request, not first audible sound; provider generation and network latency add time.",
      "properties": {
        "first_speaker": {
          "default": "callee",
          "enum": [
            "callee",
            "agent"
          ],
          "type": "string"
        },
        "silence_wait_seconds": {
          "default": 2,
          "description": "Silence before requesting the first message when first_speaker is callee. Preserved but unused with agent-first.",
          "maximum": 5,
          "minimum": 1,
          "type": "number"
        }
      },
      "type": "object"
    },
    "AgentTool": {
      "description": "A configured built-in tool, signed webhook tool, or attached Integration Action. String placeholders are refused. Custom tools explicitly declare read or write; every business write requires caller confirmation. The names `press_digits`, `wait_on_hold` and `abandon_navigation` are reserved for phone-menu navigation and refused with 400.",
      "oneOf": [
        {
          "$ref": "#/$defs/BuiltinAgentTool"
        },
        {
          "$ref": "#/$defs/WebhookAgentTool"
        },
        {
          "$ref": "#/$defs/IntegrationActionAttachment"
        }
      ]
    },
    "AgentToolWait": {
      "additionalProperties": false,
      "description": "What the caller hears while a slow tool call (an integration action, a knowledge search) is still running. Off unless a mode is set. `sound` plays a quiet keyboard-typing bed on the separate outgoing track once the tool has run for `delay_ms`, cut the instant the tool finishes, capped at 15 seconds; it is wordless, so it works in every language. `acknowledge` speaks one short phrase in the agent's own voice and language instead; without phrases the platform's reviewed list for the call language is used, and a language without one stays silent. Feedback never plays over the caller or the agent, at most once per tool wait, and never for the built-in end-call or transfer tools.",
      "properties": {
        "delay_ms": {
          "default": 1000,
          "description": "How long a tool may run before feedback starts. Most tools finish well inside this.",
          "maximum": 3000,
          "minimum": 600,
          "type": "integer"
        },
        "knowledge_search_immediate": {
          "default": false,
          "description": "On cascade voice calls in acknowledge mode, a knowledge search may play a ready phrase as soon as the search starts. Other tools keep their configured delay. Off by default.",
          "type": "boolean"
        },
        "mode": {
          "default": "off",
          "enum": [
            "off",
            "acknowledge",
            "sound"
          ],
          "type": "string"
        },
        "phrases": {
          "description": "For `acknowledge` only; the same bounded neutral-phrase rule as acknowledgements. Rejected with `sound`.",
          "items": {
            "maxLength": 40,
            "minLength": 1,
            "type": "string"
          },
          "maxItems": 6,
          "type": "array"
        }
      },
      "type": "object"
    },
    "AgentTurnTaking": {
      "additionalProperties": false,
      "description": "Per-agent barge-in and endpointing tuning. Every field is optional and omitted from responses when it is at its default, so an agent that has never configured this section has no `turn_taking` key at all. Applied when a call starts; saving never changes an in-progress call.",
      "properties": {
        "barge_in_speech_rms": {
          "deprecated": true,
          "description": "Deprecated. Accepted, stored and returned for compatibility only; this runtime does not apply it to call behavior. Use `interruption_sensitivity`, `min_speech_ms` and `min_interruption_words` to control interruptions.",
          "maximum": 32000,
          "minimum": 100,
          "type": "number"
        },
        "interruption_sensitivity": {
          "default": "balanced",
          "description": "Hosted phone calls in every language. Preset interruption threshold: balanced 500 ms (the default), low 750 ms, high 150 ms. Preset end-of-turn hold on a language with the trained turn detector, the wait when the detector judges the caller finished: balanced 600 ms (the default), low 900 ms, high 260 ms; and the longest wait when it judges them probably not finished, before the turn ends anyway: balanced 1200 ms (the default), low 1800 ms, high 600 ms. On a language without the detector, where the hold is the whole end-of-turn decision: balanced 800 ms (the default), low 1100 ms, high 600 ms. Phone lines get these longer holds than a browser test because a caller pausing mid-sentence (after their name, before a number, while leaving a message) must not have their turn ended for them; `low` holds longer still, and `high` replies sooner. An explicit `min_speech_ms` or `silence_hold_ms` takes precedence over the preset for its knob. The end-of-turn hold is a minimum wait, not the reply time: a turn never ends before voice detection reports the end of speech, which takes about 250 ms of silence, or before the final transcript arrives, which depends on the speech-to-text provider.",
          "enum": [
            "balanced",
            "low",
            "high"
          ],
          "type": "string"
        },
        "max_call_seconds": {
          "default": 1740,
          "description": "How long a call may run before the platform ends it and reports `ended_reason: max_call_duration_reached`. Defaults to 1740 (29 minutes), which is also the worker ceiling. This leaves headroom below the 30-minute native SIP backstop on configured managed trunks; an existing or imported trunk must have that backstop configured separately. Lower it to cap a call sooner; a value outside the range is refused rather than clamped.",
          "maximum": 1740,
          "minimum": 60,
          "type": "integer"
        },
        "min_interruption_words": {
          "description": "Defaults to 1 on hosted phone calls in every language and to 0 on browser and web calls; set 0 explicitly to disable it. When set, an interruption must ALSO carry at least this many recognized words from the caller, in addition to the speech-duration threshold; it never lowers that threshold. Short listening noises in the call's language do not count toward it, so a caller showing they are following does not interrupt; today that list exists for English (\"mm-hm\", \"uh-huh\", \"yeah\", \"okay\", \"right\", \"sure\", \"I see\", and filler words such as \"uh\"), and every word counts in other languages. Effective only on stacks whose transcriber reports words fast enough to land inside the decision window (today the Deepgram Nova-3 stacks, in every language they serve). Elsewhere it is stored, returned unchanged, and ignored at call time, and the call runs on the speech-duration threshold alone.",
          "maximum": 5,
          "minimum": 0,
          "type": "integer"
        },
        "min_speech_ms": {
          "description": "Hosted phone calls in every language. Explicit continuous-speech threshold before an interruption is considered; it overrides any sensitivity preset. On a phone call the value is honoured down to 150 ms; a value below 150 ms is raised to 150 ms. A phone call with no value set and no sensitivity preset uses the 500 ms default. Browser and web calls do not apply this value at all: it is still stored and returned, but those calls keep the stack's own threshold.",
          "maximum": 2000,
          "minimum": 80,
          "type": "integer"
        },
        "no_caller_speech_seconds": {
          "default": 20,
          "description": "How long after the call is answered the platform waits to hear the other party before ending the call and reporting `ended_reason: no_caller_speech_after_answer`. Defaults to 20. Speech is detected from the audio itself, not from a transcript, and once the other party has been heard once the rule does not apply again for the rest of that call. The floor is 10 because the witness is voice activity: a caller who is merely listening looks the same as one who is not there, and a shorter value ends the call partway through the agent's own opening line.",
          "maximum": 120,
          "minimum": 10,
          "type": "integer"
        },
        "silence_hold_ms": {
          "description": "Hosted phone calls in every language. The shortest wait after the caller stops speaking before their turn can end; it overrides the platform default hold and any sensitivity preset's shortest wait (the preset's longest wait still applies on a language with the trained turn detector, and is raised to this value when it is shorter). It is a minimum, not the reply time: a value below about 250 ms has no effect, because voice detection needs that much silence to report the end of speech, and the wait is longer whenever the final transcript arrives later than this value.",
          "maximum": 2000,
          "minimum": 100,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "AgentUnrecognisedSpeech": {
      "additionalProperties": false,
      "description": "What the agent does when the caller speaks and the transcriber produces nothing at all — most often a caller using a language the agent's transcriber is not listening for, but also a bad line or a dropout. The agent says one short line in the call's own language telling the caller it could not understand them and which languages it can help in, then keeps listening; it never guesses what was said, never calls a tool and never ends the call. It is spoken only after the caller has stopped talking and the platform's wait for a transcript has expired, so it cannot talk over a live caller, and it is skipped entirely on an agent with follow-the-caller enabled, where the language switch answers instead. On by default, and spoken at most twice per call unless you change `max_per_call`. Send `enabled: false` to switch it off; an absent section is the default and is not stored.",
      "properties": {
        "enabled": {
          "description": "`false` switches the line off for this agent, and is the only value stored: the behaviour is on for every agent that says nothing.",
          "type": "boolean"
        },
        "max_per_call": {
          "description": "How many times one call may hear it. Two when unset.",
          "maximum": 5,
          "minimum": 1,
          "type": "integer"
        },
        "phrase": {
          "description": "Your own wording, spoken verbatim in place of the line the agent would otherwise compose in the call's language. Write it in the agent's language: it is not translated.",
          "maxLength": 300,
          "type": "string"
        }
      },
      "type": "object"
    },
    "AgentVoicePolish": {
      "additionalProperties": false,
      "description": "Per-agent voice polish. Absent keys keep the platform defaults; the response omits the section entirely when nothing is configured.",
      "properties": {
        "acknowledgements": {
          "$ref": "#/$defs/AgentAcknowledgements"
        },
        "delivery": {
          "description": "How the selected voice performs its speech. Unset keeps the provider's own defaults, which is what every agent had before this field existed. Each profile maps to allowlisted provider controls only where the selected TTS provider/model truthfully exposes them: ElevenLabs voice settings (eleven_v3 supports stability only), a bounded Gemini TTS synthesis instruction, and a speaking-rate multiplier for Soniox and Cartesia. Fish Audio and Azure neural voices accept the setting but apply no change. The voice preview (POST /v1/voice-previews with the same `delivery`) uses the identical mapping, so an audition sounds like the call.",
          "enum": [
            "natural",
            "lively",
            "calm",
            "precise"
          ],
          "type": "string"
        },
        "end_of_call_phrase": {
          "maxLength": 300,
          "type": "string"
        },
        "model_unresponsive": {
          "$ref": "#/$defs/AgentModelUnresponsive"
        },
        "tool_wait": {
          "$ref": "#/$defs/AgentToolWait"
        },
        "unrecognised_speech": {
          "$ref": "#/$defs/AgentUnrecognisedSpeech"
        }
      },
      "type": "object"
    },
    "AgentVoiceSetupEdit": {
      "additionalProperties": false,
      "description": "Shared finite input. Requires expected_voice_setup_revision beside it. Do not mix with transcriber or overlapping turn_taking fields. With a workflow, stages input for workflow publication; ordinary calls keep their published stack. Without a workflow, publishes a compatible cascade selection or saves an independent native-engine confirmation listener. Free-form business writes require the finite listener, with additional transcription usage; conversation input remains engine-owned. GPT-Live Transcribe is qualified for finite English input with platform-managed credentials.",
      "properties": {
        "listener": {
          "anyOf": [
            {
              "additionalProperties": false,
              "oneOf": [
                {
                  "not": {
                    "required": [
                      "credential_id"
                    ]
                  },
                  "properties": {
                    "credential_source": {
                      "enum": [
                        "platform_managed"
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "credential_source": {
                      "enum": [
                        "customer_byok"
                      ]
                    }
                  },
                  "required": [
                    "credential_id"
                  ]
                }
              ],
              "properties": {
                "credential_id": {
                  "maxLength": 128,
                  "type": "string"
                },
                "credential_source": {
                  "enum": [
                    "platform_managed",
                    "customer_byok"
                  ],
                  "type": "string"
                },
                "languages": {
                  "items": {
                    "maxLength": 64,
                    "type": "string"
                  },
                  "maxItems": 256,
                  "minItems": 1,
                  "type": "array"
                },
                "model": {
                  "maxLength": 128,
                  "type": "string"
                },
                "registry_name": {
                  "pattern": "^[a-z][a-z0-9_]{0,63}$",
                  "type": "string"
                }
              },
              "required": [
                "registry_name",
                "model",
                "languages",
                "credential_source"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "turn_taking": {
          "additionalProperties": false,
          "description": "Explicit values override the preset. Workflow bounds: 300–3000 ms silence, 0–1000 ms interruption. Cascade bounds: 100–2000 and 80–2000 respectively.",
          "properties": {
            "interruption_sensitivity": {
              "enum": [
                "balanced",
                "low",
                "high"
              ],
              "type": "string"
            },
            "min_speech_ms": {
              "maximum": 2000,
              "minimum": 0,
              "type": "integer"
            },
            "silence_hold_ms": {
              "maximum": 3000,
              "minimum": 100,
              "type": "integer"
            }
          },
          "type": "object"
        }
      },
      "required": [
        "listener",
        "turn_taking"
      ],
      "type": "object"
    },
    "AudioEnvironmentSelection": {
      "additionalProperties": false,
      "properties": {
        "asset_version": {
          "description": "Immutable packaged asset version; it is never inferred.",
          "enum": [
            "v1"
          ],
          "type": "string"
        },
        "preset_id": {
          "description": "Exact catalogue id. `off` has no asset.",
          "type": "string"
        },
        "volume": {
          "description": "Whole-number selection. Off requires 0; enabled presets require 1 through 100.",
          "maximum": 100,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "preset_id",
        "asset_version",
        "volume"
      ],
      "type": "object"
    },
    "BuiltinAgentTool": {
      "description": "A built-in tool the AI agent can invoke during a call. `phone_number` is conditionally required: see its own description.",
      "properties": {
        "connection_id": {
          "description": "Required for calendar builtins: one active, owner-configured calendar connection in the AI agent's organization/project. The model cannot select it.",
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "name": {
          "enum": [
            "end_call",
            "send_sms",
            "transfer_to_human",
            "request_callback",
            "set_call_disposition",
            "get_phone_number_coverage",
            "calendar_check_availability",
            "calendar_book_appointment"
          ],
          "type": "string"
        },
        "phone_number": {
          "description": "Destination for `transfer_to_human`, and required when that tool is enabled. Must be full E.164 including the leading `+` and country code (for example `+12025550100`); a blank, partial, or non-dialable number is rejected when the agent is created or updated, rather than failing mid-call. Ignored by `end_call` and `send_sms`.",
          "type": "string"
        },
        "ref": {
          "description": "Read-only, server-issued. A stable opaque identifier for this configured tool, used to name the tool on a call's transcript rows without storing the tool's own name with them. Ignored if you send it: the value is taken from what is already stored, so it cannot be chosen. It survives any edit that keeps the tool's `name` and `type`; renaming, retyping or removing a tool retires its identifier, and transcript rows recorded before that show the tool's kind instead of a name.",
          "readOnly": true,
          "type": "string"
        },
        "type": {
          "const": "builtin"
        }
      },
      "required": [
        "type",
        "name"
      ],
      "type": "object"
    },
    "IntegrationActionAttachment": {
      "description": "Explicitly attaches one existing Integration Action to this agent. The model cannot choose another action or endpoint.",
      "properties": {
        "connection_id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "ref": {
          "description": "Read-only, server-issued. A stable opaque identifier for this configured tool, used to name the tool on a call's transcript rows without storing the tool's own name with them. Ignored if you send it: the value is taken from what is already stored, so it cannot be chosen. It survives any edit that keeps the tool's `name` and `type`; renaming, retyping or removing a tool retires its identifier, and transcript rows recorded before that show the tool's kind instead of a name.",
          "readOnly": true,
          "type": "string"
        },
        "tool_id": {
          "type": "string"
        },
        "type": {
          "const": "connection"
        }
      },
      "required": [
        "type",
        "name",
        "connection_id",
        "tool_id"
      ],
      "type": "object"
    },
    "VoiceComponentSelection": {
      "properties": {
        "language": {
          "description": "STT selection language when supplied.",
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "voice_id": {
          "description": "TTS voice identifier when supplied.",
          "type": "string"
        }
      },
      "required": [
        "provider",
        "model"
      ],
      "type": "object"
    },
    "WebhookAgentTool": {
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "operation_kind": {
          "description": "Explicitly required; no default. Writes require a short read-back and a later caller confirmation. Their webhook envelope carries the durable action identity as tool_call_id for receiver deduplication.",
          "enum": [
            "read",
            "write"
          ],
          "type": "string"
        },
        "parameters": {
          "type": "object"
        },
        "ref": {
          "description": "Read-only, server-issued. A stable opaque identifier for this configured tool, used to name the tool on a call's transcript rows without storing the tool's own name with them. Ignored if you send it: the value is taken from what is already stored, so it cannot be chosen. It survives any edit that keeps the tool's `name` and `type`; renaming, retyping or removing a tool retires its identifier, and transcript rows recorded before that show the tool's kind instead of a name.",
          "readOnly": true,
          "type": "string"
        },
        "type": {
          "const": "webhook"
        },
        "url": {
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "type",
        "name",
        "url",
        "operation_kind"
      ],
      "type": "object"
    }
  }
}