{"components":{"schemas":{"ApiKeyList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"ApiKeyList","type":"object"},"ApiKeyResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Expires At"},"id":{"format":"uuid","title":"Id","type":"string"},"last_used_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Last Used At"},"name":{"title":"Name","type":"string"},"prefix":{"title":"Prefix","type":"string"},"revoked_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Revoked At"},"scopes":{"items":{"type":"string","x-extensible-enum":["campaigns:read","campaigns:write","contacts:read","contacts:write","assistants:read","knowledge:read","knowledge:write","usage:read","credit:read"]},"title":"Scopes","type":"array"}},"required":["id","name","prefix","scopes","created_by","created_at","last_used_at","expires_at","revoked_at"],"title":"ApiKeyResponse","type":"object"},"ErrorResponse":{"additionalProperties":false,"properties":{"code":{"description":"`http_error` for a plain HTTP error, `validation_error` with `errors`, `internal_error`, or the specific code an operation's description names.","title":"Code","type":"string"},"errors":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldError"},"type":"array"},{"type":"null"}],"title":"Errors"},"message":{"title":"Message","type":"string"}},"required":["code","message"],"title":"ErrorResponse","type":"object"},"FieldError":{"additionalProperties":false,"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Loc","type":"array"},"type":{"title":"Type","type":"string"}},"required":["loc","type"],"title":"FieldError","type":"object"},"CreateApiKeyRequest":{"additionalProperties":false,"properties":{"expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Expires At"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"scopes":{"items":{"$ref":"#/components/schemas/Scope"},"title":"Scopes","type":"array"}},"required":["name","scopes"],"title":"CreateApiKeyRequest","type":"object"},"Scope":{"enum":["campaigns:read","campaigns:write","contacts:read","contacts:write","assistants:read","knowledge:read","knowledge:write","usage:read","credit:read"],"title":"Scope","type":"string"},"CreatedApiKeyResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"},"expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Expires At"},"id":{"format":"uuid","title":"Id","type":"string"},"last_used_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Last Used At"},"name":{"title":"Name","type":"string"},"prefix":{"title":"Prefix","type":"string"},"revoked_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Revoked At"},"scopes":{"items":{"type":"string","x-extensible-enum":["campaigns:read","campaigns:write","contacts:read","contacts:write","assistants:read","knowledge:read","knowledge:write","usage:read","credit:read"]},"title":"Scopes","type":"array"},"secret":{"title":"Secret","type":"string"}},"required":["id","name","prefix","scopes","created_by","created_at","last_used_at","expires_at","revoked_at","secret"],"title":"CreatedApiKeyResponse","type":"object"},"BuilderAppliedRequest":{"additionalProperties":false,"properties":{"assistant_id":{"format":"uuid","title":"Assistant Id","type":"string"}},"required":["assistant_id"],"title":"BuilderAppliedRequest","type":"object"},"BuilderMessageRequest":{"additionalProperties":false,"properties":{"assistant_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"},"conversation":{"items":{"$ref":"#/components/schemas/BuilderTurnRequest"},"maxItems":20,"title":"Conversation","type":"array"},"message":{"maxLength":4000,"minLength":1,"title":"Message","type":"string"},"mode":{"anyOf":[{"enum":["pipeline","realtime"],"type":"string"},{"type":"null"}],"title":"Mode"},"target":{"default":"auto","enum":["prompt","tree","auto"],"title":"Target","type":"string"}},"required":["message"],"title":"BuilderMessageRequest","type":"object"},"BuilderTurnRequest":{"additionalProperties":false,"properties":{"content":{"maxLength":4000,"minLength":1,"title":"Content","type":"string"},"role":{"enum":["user","assistant"],"title":"Role","type":"string"}},"required":["role","content"],"title":"BuilderTurnRequest","type":"object"},"BuilderMessageResponse":{"additionalProperties":false,"properties":{"proposal":{"anyOf":[{"$ref":"#/components/schemas/BuilderProposalResponse"},{"type":"null"}]},"proposal_errors":{"items":{"maxLength":500,"type":"string"},"maxItems":20,"title":"Proposal Errors","type":"array"},"reply":{"maxLength":8000,"title":"Reply","type":"string"},"suggestions":{"items":{"maxLength":500,"type":"string"},"maxItems":4,"title":"Suggestions","type":"array"}},"required":["reply","suggestions","proposal","proposal_errors"],"title":"BuilderMessageResponse","type":"object"},"BuilderProposalResponse":{"additionalProperties":false,"properties":{"changes":{"items":{"maxLength":500,"type":"string"},"maxItems":12,"title":"Changes","type":"array"},"config":{"$ref":"#/components/schemas/AssistantVersion"},"name":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}],"title":"Name"}},"required":["changes","name","config"],"title":"BuilderProposalResponse","type":"object"},"AssistantVersion":{"additionalProperties":false,"allOf":[{"if":{"properties":{"mode":{"const":"pipeline"}},"required":["mode"]},"then":{"properties":{"pipeline":{"type":"object"},"realtime":{"type":"null"}},"required":["pipeline"]}},{"if":{"properties":{"mode":{"const":"realtime"}},"required":["mode"]},"then":{"properties":{"pipeline":{"type":"null"},"realtime":{"type":"object"}},"required":["realtime"]}},{"else":{"required":["instructions"]},"if":{"properties":{"instructions_mode":{"const":"flow"}},"required":["instructions_mode"]},"then":{"properties":{"flow":{"type":"object"}},"required":["flow"]}}],"properties":{"analysis":{"$ref":"#/components/schemas/AnalysisSettings","default":{"criteria":[],"enabled":false,"include_summary_in_event":false,"sentiment":true,"summary_prompt":"Resumí la llamada en 2 o 3 frases: motivo, qué se acordó y cómo terminó. No incluyas números de teléfono, documentos ni datos de tarjetas."}},"behavior":{"$ref":"#/components/schemas/BehaviorSettings","default":{"background_sound":"none","background_volume":0.3,"dtmf":{"enabled":false},"endpointing":{"max_delay_seconds":1.5,"min_delay_seconds":0.5,"mode":"fixed"},"guardrails":{"blocked_topics":[],"never_say":[]},"interruptions":{"allow":true,"false_interruption_timeout_seconds":2,"first_message_interruptible":true,"min_duration_seconds":0.5,"min_words":0},"recording":{"disclosure_message":"","enabled":false}}},"first_message":{"title":"First Message","type":"string"},"first_message_mode":{"default":"assistant_speaks_first","enum":["assistant_speaks_first","wait_for_user"],"title":"First Message Mode","type":"string"},"flow":{"anyOf":[{"$ref":"#/components/schemas/Flow"},{"type":"null"}]},"instructions":{"default":"","title":"Instructions","type":"string"},"instructions_mode":{"default":"prompt","enum":["prompt","flow"],"title":"Instructions Mode","type":"string"},"knowledge_bases":{"default":[],"items":{"$ref":"#/components/schemas/KnowledgeAttachment"},"maxItems":5,"title":"Knowledge Bases","type":"array"},"mcp":{"default":[],"items":{"$ref":"#/components/schemas/McpAttachment"},"maxItems":3,"title":"Mcp","type":"array"},"mode":{"enum":["pipeline","realtime"],"title":"Mode","type":"string"},"pipeline":{"anyOf":[{"$ref":"#/components/schemas/PipelineConfig"},{"type":"null"}]},"pronunciation":{"$ref":"#/components/schemas/PronunciationSettings","default":{"dictionary_ids":[]}},"realtime":{"anyOf":[{"discriminator":{"mapping":{"azure_openai":"#/components/schemas/AzureOpenAiRealtime","gemini":"#/components/schemas/GeminiRealtime","openai":"#/components/schemas/OpenAiRealtime"},"propertyName":"provider"},"oneOf":[{"$ref":"#/components/schemas/OpenAiRealtime"},{"$ref":"#/components/schemas/AzureOpenAiRealtime"},{"$ref":"#/components/schemas/GeminiRealtime"}]},{"type":"null"}],"title":"Realtime"},"result_spec":{"anyOf":[{"$ref":"#/components/schemas/ResultSpec"},{"type":"null"}]},"speech_style":{"$ref":"#/components/schemas/SpeechStyleSettings","default":{"spoken_prompt":false}},"tools":{"$ref":"#/components/schemas/AssistantTools","default":{"api":[],"built_in":{"date_time":{"date_format":"long","enabled":false,"time_format":"24h"},"end_call":{"enabled":false,"message":""},"transfer_call":{"destination_type":"phone","enabled":false,"message":"","sip_headers":{}}}}},"variables":{"default":[],"items":{"pattern":"^[a-z][a-z0-9_]{0,63}$","type":"string"},"maxItems":50,"title":"Variables","type":"array"},"voice_profile":{"$ref":"#/components/schemas/VoiceProfileSettings","default":{"intensity":"normal","profile":"off"}}},"required":["mode","first_message"],"title":"AssistantVersion","type":"object"},"AnalysisSettings":{"additionalProperties":false,"properties":{"criteria":{"default":[],"items":{"$ref":"#/components/schemas/SuccessCriterion"},"maxItems":10,"title":"Criteria","type":"array"},"enabled":{"default":false,"title":"Enabled","type":"boolean"},"include_summary_in_event":{"default":false,"title":"Include Summary In Event","type":"boolean"},"sentiment":{"default":true,"title":"Sentiment","type":"boolean"},"summary_prompt":{"default":"Resumí la llamada en 2 o 3 frases: motivo, qué se acordó y cómo terminó. No incluyas números de teléfono, documentos ni datos de tarjetas.","maxLength":1000,"minLength":1,"title":"Summary Prompt","type":"string"}},"title":"AnalysisSettings","type":"object"},"SuccessCriterion":{"additionalProperties":false,"description":"Judged as `success`, `failure` or `unknown` (with a rationale) for every analyzed call.","properties":{"description":{"maxLength":500,"minLength":1,"title":"Description","type":"string"},"id":{"pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","type":"string"},"name":{"maxLength":80,"minLength":1,"title":"Name","type":"string"}},"required":["id","name","description"],"title":"SuccessCriterion","type":"object"},"BehaviorSettings":{"additionalProperties":false,"properties":{"background_sound":{"default":"none","enum":["none","office","call_center"],"title":"Background Sound","type":"string"},"background_speech":{"anyOf":[{"$ref":"#/components/schemas/BackgroundSpeechSettings"},{"type":"null"}]},"background_volume":{"default":0.3,"maximum":1,"minimum":0.05,"title":"Background Volume","type":"number"},"dtmf":{"$ref":"#/components/schemas/DtmfSettings","default":{"enabled":false}},"end_call_phrases":{"anyOf":[{"$ref":"#/components/schemas/EndCallPhrases"},{"type":"null"}]},"endpointing":{"$ref":"#/components/schemas/EndpointingSettings","default":{"max_delay_seconds":1.5,"min_delay_seconds":0.5,"mode":"fixed"}},"guardrails":{"$ref":"#/components/schemas/GuardrailSettings","default":{"blocked_topics":[],"never_say":[]}},"interruptions":{"$ref":"#/components/schemas/InterruptionSettings","default":{"allow":true,"false_interruption_timeout_seconds":2,"first_message_interruptible":true,"min_duration_seconds":0.5,"min_words":0}},"max_duration":{"anyOf":[{"$ref":"#/components/schemas/MaxDurationSettings"},{"type":"null"}]},"recording":{"$ref":"#/components/schemas/RecordingSettings","default":{"disclosure_message":"","enabled":false}},"silence":{"anyOf":[{"$ref":"#/components/schemas/SilenceSettings"},{"type":"null"}]},"voicemail":{"anyOf":[{"$ref":"#/components/schemas/VoicemailSettings"},{"type":"null"}]}},"title":"BehaviorSettings","type":"object"},"BackgroundSpeechSettings":{"additionalProperties":false,"description":"Speech that is not the caller's (a TV, people nearby). Pipeline only; off when absent.\nA final transcript of at most `max_words` words whose STT confidence is under\n`min_confidence` is dropped, unless it holds an answer (\"sí\", \"no\", a number, a date: #107): the\nmodel, the tree and the transcript never get it, and the call log gets a `speech.ignored` event\n(no text). `vad_activation_threshold` is Silero's (0.5 by\ndefault): higher, faint or distant speech does not count as the caller speaking. A quiet or\nhesitant caller can be ignored too, so it is opt-in. `primary_speaker_only` (Deepgram only)\nturns on Deepgram's diarization and drops every final transcript of a speaker other than the\nprimary one (the loudest, normally the caller), whatever its length, as a\n`speech.background_speaker` event (no text); a background louder than the caller can make the\ncaller the one dropped.","properties":{"max_words":{"default":3,"maximum":5,"minimum":1,"title":"Max Words","type":"integer"},"min_confidence":{"default":0.7,"maximum":0.99,"minimum":0.1,"title":"Min Confidence","type":"number"},"primary_speaker_only":{"default":false,"title":"Primary Speaker Only","type":"boolean"},"vad_activation_threshold":{"default":0.5,"maximum":0.9,"minimum":0.5,"title":"Vad Activation Threshold","type":"number"}},"title":"BackgroundSpeechSettings","type":"object"},"DtmfSettings":{"additionalProperties":false,"description":"The `send_dtmf` tool. Stub until SIP: the tool answers that tones cannot be sent yet.","properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"}},"title":"DtmfSettings","type":"object"},"EndCallPhrases":{"additionalProperties":false,"description":"A phrase (a case and accent insensitive substring) that ends the call when said.","properties":{"listen_to":{"default":"assistant","enum":["assistant","user","both"],"title":"Listen To","type":"string"},"phrases":{"items":{"maxLength":140,"minLength":2,"type":"string"},"maxItems":10,"minItems":1,"title":"Phrases","type":"array"}},"required":["phrases"],"title":"EndCallPhrases","type":"object"},"EndpointingSettings":{"additionalProperties":false,"description":"When the caller's turn is over. Pipeline only (realtime: the provider's own VAD).","properties":{"max_delay_seconds":{"default":1.5,"maximum":10,"minimum":0.5,"title":"Max Delay Seconds","type":"number"},"min_delay_seconds":{"default":0.5,"maximum":5,"minimum":0,"title":"Min Delay Seconds","type":"number"},"mode":{"default":"fixed","enum":["fixed","dynamic"],"title":"Mode","type":"string"}},"title":"EndpointingSettings","type":"object"},"GuardrailSettings":{"additionalProperties":false,"description":"Pipeline: `never_say` is filtered out of the speech (logged as `guardrail.triggered`) and\nboth lists are told to the model. Realtime: only the instruction to the model.","properties":{"blocked_topics":{"default":[],"items":{"maxLength":140,"minLength":2,"type":"string"},"maxItems":10,"title":"Blocked Topics","type":"array"},"never_say":{"default":[],"items":{"$ref":"#/components/schemas/NeverSay"},"maxItems":50,"title":"Never Say","type":"array"}},"title":"GuardrailSettings","type":"object"},"NeverSay":{"additionalProperties":false,"properties":{"phrase":{"maxLength":140,"minLength":2,"title":"Phrase","type":"string"},"replacement":{"default":"","maxLength":140,"title":"Replacement","type":"string"}},"required":["phrase"],"title":"NeverSay","type":"object"},"InterruptionSettings":{"additionalProperties":false,"description":"Barge-in. Pipeline: all six. Realtime: only `allow` (the provider's server decides when\nthe caller started speaking).","properties":{"allow":{"default":true,"title":"Allow","type":"boolean"},"false_interruption_timeout_seconds":{"anyOf":[{"maximum":10,"minimum":0.5,"type":"number"},{"type":"null"}],"default":2,"title":"False Interruption Timeout Seconds"},"first_message_interruptible":{"default":true,"title":"First Message Interruptible","type":"boolean"},"min_duration_seconds":{"default":0.5,"maximum":5,"minimum":0.1,"title":"Min Duration Seconds","type":"number"},"min_words":{"default":0,"maximum":10,"minimum":0,"title":"Min Words","type":"integer"},"mode":{"anyOf":[{"enum":["adaptive","vad"],"type":"string"},{"type":"null"}],"title":"Mode"}},"title":"InterruptionSettings","type":"object"},"MaxDurationSettings":{"additionalProperties":false,"description":"A hard cap: `warning_message` (when not empty) is said 30 seconds before the end.","properties":{"goodbye_message":{"default":"","maxLength":300,"title":"Goodbye Message","type":"string"},"seconds":{"maximum":7200,"minimum":30,"title":"Seconds","type":"integer"},"warning_message":{"default":"","maxLength":300,"title":"Warning Message","type":"string"}},"required":["seconds"],"title":"MaxDurationSettings","type":"object"},"RecordingSettings":{"additionalProperties":false,"description":"Audio recording of the call (LiveKit Egress; a campaign can override `enabled`). Off by\ndefault. `disclosure_message` is what the agent says at the start of a recorded call, before\nanything else (the notice some markets require); empty says nothing. See\ndocs/call-recording.md.","properties":{"disclosure_message":{"default":"","maxLength":300,"title":"Disclosure Message","type":"string"},"enabled":{"default":false,"title":"Enabled","type":"boolean"}},"title":"RecordingSettings","type":"object"},"SilenceSettings":{"additionalProperties":false,"description":"A phase that is absent inherits the original flat policy.","properties":{"goodbye_message":{"default":"Parece que se cortó la comunicación. Hasta luego.","maxLength":300,"title":"Goodbye Message","type":"string"},"in_conversation":{"anyOf":[{"$ref":"#/components/schemas/ConversationSilenceSettings"},{"type":"null"}]},"initial":{"anyOf":[{"$ref":"#/components/schemas/SilencePhaseSettings"},{"type":"null"}]},"max_reprompts":{"default":2,"maximum":5,"minimum":0,"title":"Max Reprompts","type":"integer"},"reprompt_message":{"default":"¿Sigue ahí?","maxLength":300,"title":"Reprompt Message","type":"string"},"timeout_seconds":{"default":15,"maximum":120,"minimum":3,"title":"Timeout Seconds","type":"number"}},"title":"SilenceSettings","type":"object"},"ConversationSilenceSettings":{"additionalProperties":false,"properties":{"final_action":{"default":"close_message","enum":["cut","transfer","close_message"],"title":"Final Action","type":"string"},"goodbye_message":{"default":"Parece que se cortó la comunicación. Hasta luego.","maxLength":300,"title":"Goodbye Message","type":"string"},"max_reprompts":{"default":1,"maximum":5,"minimum":0,"title":"Max Reprompts","type":"integer"},"reprompt_message":{"default":"¿Sigue ahí?","maxLength":300,"title":"Reprompt Message","type":"string"},"timeout_seconds":{"default":6,"maximum":120,"minimum":3,"title":"Timeout Seconds","type":"number"}},"title":"ConversationSilenceSettings","type":"object"},"SilencePhaseSettings":{"additionalProperties":false,"properties":{"final_action":{"default":"close_message","enum":["cut","transfer","close_message"],"title":"Final Action","type":"string"},"goodbye_message":{"default":"Parece que se cortó la comunicación. Hasta luego.","maxLength":300,"title":"Goodbye Message","type":"string"},"max_reprompts":{"default":1,"maximum":5,"minimum":0,"title":"Max Reprompts","type":"integer"},"reprompt_message":{"default":"¿Sigue ahí?","maxLength":300,"title":"Reprompt Message","type":"string"},"timeout_seconds":{"default":3,"maximum":120,"minimum":3,"title":"Timeout Seconds","type":"number"}},"title":"SilencePhaseSettings","type":"object"},"VoicemailSettings":{"additionalProperties":false,"description":"One or more answering-machine detectors (`detectors`, default the model's tool):\n\n- `llm_tool`: the conversation model gets a `voicemail_detected` tool. It answers at the end of\n  the callee's turn, so a long greeting is heard whole first.\n- `llm_transcript`: a classifier reads the live transcript of the first seconds, once the callee\n  said 3 words and again every 2 new words, and hangs up as soon as it hears a machine. It runs\n  on Jev when the organization has TypeSafe configured, otherwise on a small model of the\n  assistant's own provider. It stops listening after 10 seconds.\n- `audio`: outbound phone calls only. The platform's audio detector listens before the\n  assistant joins (no model, no voice); it needs the detector deployed (docs/sip-amd.md) and\n  does nothing in browser tests.","properties":{"detectors":{"default":["llm_tool"],"items":{"enum":["llm_tool","llm_transcript","audio"],"type":"string"},"maxItems":3,"minItems":1,"title":"Detectors","type":"array"},"message":{"default":"","maxLength":500,"title":"Message","type":"string"}},"title":"VoicemailSettings","type":"object"},"Flow":{"additionalProperties":false,"description":"A conversation tree: global instructions plus steps linked by exits. Texts may name\n`{{variable}}`s (plain placeholders only: no statements, no filters) that are either in the\nassistant version's `variables` or captured by a step that can come earlier;\n`check_names` enforces that, because the variables live on the version, not here.","properties":{"advance_mode":{"default":"async","enum":["async","gate"],"title":"Advance Mode","type":"string"},"decider":{"$ref":"#/components/schemas/Decider"},"global_instructions":{"default":"","maxLength":8000,"title":"Global Instructions","type":"string"},"lookahead_depth":{"default":2,"maximum":3,"minimum":0,"title":"Lookahead Depth","type":"integer"},"nodes":{"maxProperties":50,"minProperties":1,"patternProperties":{"^[a-z][a-z0-9_]{0,63}$":{"$ref":"#/components/schemas/Step"}},"title":"Nodes","type":"object"},"start":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Start","type":"string"},"transition_strategy":{"const":"decider","default":"decider","title":"Transition Strategy","type":"string"}},"required":["start","nodes"],"title":"Flow","type":"object"},"Decider":{"additionalProperties":false,"description":"Who picks the exit. `llm` (default) is a small LLM on the assistant's own provider; `model`\nis a model of that provider, and the worker picks its default for the provider when it is\nnull. `jev` uses only TypeSafe's Jev for the choice (the text of the call goes to TypeSafe).\nThe LLM only extracts fields; `model` names that LLM. Jev errors keep the current step.\n`min_confidence` is the confidence a move needs (null: 0.6 for `llm`, 0.0 for `jev`) and\n`history_turns` the last turns the decider reads.","properties":{"extraction_history_turns":{"default":1,"maximum":20,"minimum":1,"title":"Extraction History Turns","type":"integer"},"extraction_timeout_ms":{"default":2500,"maximum":10000,"minimum":500,"title":"Extraction Timeout Ms","type":"integer"},"history_turns":{"default":10,"maximum":20,"minimum":2,"title":"History Turns","type":"integer"},"kind":{"default":"llm","enum":["llm","jev"],"title":"Kind","type":"string"},"min_confidence":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"title":"Min Confidence"},"model":{"anyOf":[{"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,79}$","type":"string"},{"type":"null"}],"title":"Model"},"timeout_ms":{"default":2500,"maximum":10000,"minimum":500,"title":"Timeout Ms","type":"integer"}},"title":"Decider","type":"object"},"Step":{"additionalProperties":false,"properties":{"entry_lines":{"default":[],"items":{"$ref":"#/components/schemas/EntryLine"},"maxItems":10,"title":"Entry Lines","type":"array"},"extract":{"default":[],"items":{"$ref":"#/components/schemas/Capture"},"maxItems":10,"title":"Extract","type":"array"},"goal":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Goal"},"instructions":{"maxLength":4000,"minLength":1,"title":"Instructions","type":"string"},"max_stays":{"anyOf":[{"maximum":20,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Max Stays"},"on_max_stays":{"anyOf":[{"$ref":"#/components/schemas/StayLimit"},{"type":"null"}]},"opt_out_failure_message":{"anyOf":[{"maxLength":500,"minLength":1,"type":"string"},{"type":"null"}],"title":"Opt Out Failure Message"},"terminal_action":{"anyOf":[{"enum":["voicemail","opt_out"],"type":"string"},{"type":"null"}],"title":"Terminal Action"},"tools":{"anyOf":[{"items":{"type":"string"},"maxItems":44,"type":"array"},{"type":"null"}],"title":"Tools"},"transitions":{"default":[],"items":{"$ref":"#/components/schemas/Exit"},"maxItems":10,"title":"Transitions","type":"array"}},"required":["instructions"],"title":"Step","type":"object"},"EntryLine":{"additionalProperties":false,"description":"A line the step says as written, with no model, when the call moves into it (#92). `when`\npicks it by the call's variables: each named variable equals one of its values, ignoring case\nand extra spaces, and \"\" matches a missing or blank value. The first line that matches is\nsaid; a line without `when` always matches. No match: the model replies, as without lines.","properties":{"text":{"maxLength":1000,"minLength":1,"title":"Text","type":"string"},"when":{"anyOf":[{"maxProperties":5,"minProperties":1,"patternProperties":{"^[a-z][a-z0-9_]{0,63}$":{"items":{"maxLength":100,"type":"string"},"maxItems":20,"minItems":1,"type":"array"}},"type":"object"},{"type":"null"}],"title":"When"}},"required":["text"],"title":"EntryLine","type":"object"},"Capture":{"additionalProperties":false,"description":"A value the decider reads from the conversation in this step.","properties":{"description":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Description"},"name":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Name","type":"string"},"type":{"enum":["string","number","boolean","date"],"title":"Type","type":"string"}},"required":["name","type"],"title":"Capture","type":"object"},"StayLimit":{"additionalProperties":false,"description":"What to do when a step has stayed `max_stays` times: `transfer` the call to a person (the\nassistant needs `transfer_call` enabled), `goto` the step `to`, or `end` the call.","properties":{"action":{"enum":["transfer","goto","end"],"title":"Action","type":"string"},"to":{"anyOf":[{"pattern":"^[a-z][a-z0-9_]{0,63}$","type":"string"},{"type":"null"}],"title":"To"}},"required":["action"],"title":"StayLimit","type":"object"},"Exit":{"additionalProperties":false,"description":"Where the conversation goes next, and when, in plain language.","properties":{"to":{"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"To","type":"string"},"when":{"maxLength":300,"minLength":1,"title":"When","type":"string"}},"required":["to","when"],"title":"Exit","type":"object"},"KnowledgeAttachment":{"additionalProperties":false,"description":"A knowledge base the assistant may search, and when to do it.","properties":{"description":{"maxLength":500,"minLength":1,"title":"Description","type":"string"},"knowledge_base_id":{"format":"uuid","title":"Knowledge Base Id","type":"string"},"tags":{"default":[],"items":{"maxLength":40,"minLength":1,"type":"string"},"maxItems":20,"title":"Tags","type":"array"}},"required":["knowledge_base_id","description"],"title":"KnowledgeAttachment","type":"object"},"McpAttachment":{"additionalProperties":false,"description":"Tools of one MCP server (`/v1/mcp-servers`) the assistant may call, by name. `frozen` is\nset by publishing, never by a client.","properties":{"frozen":{"anyOf":[{"$ref":"#/components/schemas/FrozenMcpServer"},{"type":"null"}]},"server_id":{"format":"uuid","title":"Server Id","type":"string"},"tools":{"items":{"pattern":"^[A-Za-z][A-Za-z0-9_-]{0,39}$","type":"string"},"maxItems":20,"minItems":1,"title":"Tools","type":"array"}},"required":["server_id","tools"],"title":"McpAttachment","type":"object"},"FrozenMcpServer":{"additionalProperties":false,"description":"The tools of one MCP server frozen into a published version. A call never lists the tools\nof the live server: it uses these schemas.","properties":{"origin":{"maxLength":300,"title":"Origin","type":"string"},"slug":{"pattern":"^[a-z0-9_]{1,16}$","title":"Slug","type":"string"},"snapshot_hash":{"maxLength":64,"title":"Snapshot Hash","type":"string"},"tools":{"items":{"$ref":"#/components/schemas/FrozenMcpTool"},"maxItems":20,"title":"Tools","type":"array"}},"required":["slug","origin","snapshot_hash","tools"],"title":"FrozenMcpServer","type":"object"},"FrozenMcpTool":{"additionalProperties":false,"description":"An MCP tool as it was approved: what the model is told, fixed at publish.","properties":{"description":{"maxLength":2000,"title":"Description","type":"string"},"input_schema":{"additionalProperties":true,"title":"Input Schema","type":"object"},"name":{"pattern":"^[A-Za-z][A-Za-z0-9_-]{0,39}$","title":"Name","type":"string"},"requires_confirmation":{"default":false,"title":"Requires Confirmation","type":"boolean"}},"required":["name","description","input_schema"],"title":"FrozenMcpTool","type":"object"},"PipelineConfig":{"additionalProperties":false,"allOf":[{"if":{"anyOf":[{"properties":{"stt":{"properties":{"language":{"pattern":"^es(-|$)","type":"string"}},"required":["language"]}},"required":["stt"]},{"properties":{"stt":{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}}},"required":["stt"]}]},"then":{"anyOf":[{"properties":{"tts":{"properties":{"language":{"pattern":"^es(-|$)","type":"string"}},"required":["language"]}},"required":["tts"]},{"properties":{"tts":{"allOf":[{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}}]}},"required":["tts"]}]}},{"if":{"anyOf":[{"properties":{"stt":{"properties":{"language":{"pattern":"^en(-|$)","type":"string"}},"required":["language"]}},"required":["stt"]}]},"then":{"anyOf":[{"properties":{"tts":{"properties":{"language":{"pattern":"^en(-|$)","type":"string"}},"required":["language"]}},"required":["tts"]},{"properties":{"tts":{"allOf":[{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}},{"properties":{"provider":{"not":{"const":"cartesia"}}}}]}},"required":["tts"]}]}},{"if":{"anyOf":[{"properties":{"stt":{"properties":{"language":{"pattern":"^pt(-|$)","type":"string"}},"required":["language"]}},"required":["stt"]}]},"then":{"anyOf":[{"properties":{"tts":{"properties":{"language":{"pattern":"^pt(-|$)","type":"string"}},"required":["language"]}},"required":["tts"]},{"properties":{"tts":{"allOf":[{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}},{"properties":{"provider":{"not":{"const":"cartesia"}}}}]}},"required":["tts"]}]}},{"if":{"anyOf":[{"properties":{"stt":{"properties":{"language":{"pattern":"^fr(-|$)","type":"string"}},"required":["language"]}},"required":["stt"]}]},"then":{"anyOf":[{"properties":{"tts":{"properties":{"language":{"pattern":"^fr(-|$)","type":"string"}},"required":["language"]}},"required":["tts"]},{"properties":{"tts":{"allOf":[{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}},{"properties":{"provider":{"not":{"const":"cartesia"}}}}]}},"required":["tts"]}]}},{"if":{"anyOf":[{"properties":{"stt":{"properties":{"language":{"pattern":"^de(-|$)","type":"string"}},"required":["language"]}},"required":["stt"]}]},"then":{"anyOf":[{"properties":{"tts":{"properties":{"language":{"pattern":"^de(-|$)","type":"string"}},"required":["language"]}},"required":["tts"]},{"properties":{"tts":{"allOf":[{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}},{"properties":{"provider":{"not":{"const":"cartesia"}}}}]}},"required":["tts"]}]}},{"if":{"anyOf":[{"properties":{"stt":{"properties":{"language":{"pattern":"^it(-|$)","type":"string"}},"required":["language"]}},"required":["stt"]}]},"then":{"anyOf":[{"properties":{"tts":{"properties":{"language":{"pattern":"^it(-|$)","type":"string"}},"required":["language"]}},"required":["tts"]},{"properties":{"tts":{"allOf":[{"not":{"properties":{"language":{"type":"string"}},"required":["language"]}},{"properties":{"provider":{"not":{"const":"cartesia"}}}}]}},"required":["tts"]}]}}],"properties":{"finalize_stt_on_silence":{"default":false,"title":"Finalize Stt On Silence","type":"boolean"},"llm":{"discriminator":{"mapping":{"anthropic":"#/components/schemas/AnthropicLlm","azure_openai":"#/components/schemas/AzureOpenAiLlm","cerebras":"#/components/schemas/CerebrasLlm","google":"#/components/schemas/GoogleLlm","groq":"#/components/schemas/GroqLlm","openai":"#/components/schemas/OpenAiLlm"},"propertyName":"provider"},"oneOf":[{"$ref":"#/components/schemas/OpenAiLlm"},{"$ref":"#/components/schemas/AzureOpenAiLlm"},{"$ref":"#/components/schemas/AnthropicLlm"},{"$ref":"#/components/schemas/GoogleLlm"},{"$ref":"#/components/schemas/GroqLlm"},{"$ref":"#/components/schemas/CerebrasLlm"}],"title":"Llm"},"preemptive_generation":{"default":true,"title":"Preemptive Generation","type":"boolean"},"preemptive_max_speech_seconds":{"default":10,"maximum":60,"minimum":1,"title":"Preemptive Max Speech Seconds","type":"number"},"preemptive_tts":{"default":false,"title":"Preemptive Tts","type":"boolean"},"stt":{"discriminator":{"mapping":{"deepgram":"#/components/schemas/DeepgramStt","google":"#/components/schemas/GoogleStt"},"propertyName":"provider"},"oneOf":[{"$ref":"#/components/schemas/DeepgramStt"},{"$ref":"#/components/schemas/GoogleStt"}],"title":"Stt"},"tts":{"discriminator":{"mapping":{"azure":"#/components/schemas/AzureTts","cartesia":"#/components/schemas/CartesiaTts","elevenlabs":"#/components/schemas/ElevenLabsTts","openai":"#/components/schemas/OpenAiTts"},"propertyName":"provider"},"oneOf":[{"$ref":"#/components/schemas/OpenAiTts"},{"$ref":"#/components/schemas/ElevenLabsTts"},{"$ref":"#/components/schemas/CartesiaTts"},{"$ref":"#/components/schemas/AzureTts"}],"title":"Tts"},"turn_detection":{"default":"vad","enum":["vad","stt","model"],"title":"Turn Detection","type":"string"}},"required":["stt","llm","tts"],"title":"PipelineConfig","type":"object"},"OpenAiLlm":{"additionalProperties":false,"properties":{"model":{"pattern":"^gpt-[a-z0-9.]+(-[a-z0-9.]+)*$","title":"Model","type":"string"},"provider":{"const":"openai","title":"Provider","type":"string"},"reasoning_effort":{"anyOf":[{"enum":["none","minimal","low","medium","high","xhigh","max"],"type":"string"},{"type":"null"}],"title":"Reasoning Effort"},"reasoning_mode":{"default":"standard","enum":["standard","pro"],"title":"Reasoning Mode","type":"string"},"service_tier":{"default":"auto","enum":["auto","default","flex","priority","fast","ultrafast"],"title":"Service Tier","type":"string"},"temperature":{"default":0.3,"maximum":2,"minimum":0,"title":"Temperature","type":"number"}},"required":["provider","model"],"title":"OpenAiLlm","type":"object"},"AzureOpenAiLlm":{"additionalProperties":false,"properties":{"deployment":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","title":"Deployment","type":"string"},"model":{"anyOf":[{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","type":"string"},{"type":"null"}],"title":"Model"},"provider":{"const":"azure_openai","title":"Provider","type":"string"},"reasoning_effort":{"anyOf":[{"enum":["none","minimal","low","medium","high","xhigh","max"],"type":"string"},{"type":"null"}],"title":"Reasoning Effort"},"reasoning_mode":{"default":"standard","enum":["standard","pro"],"title":"Reasoning Mode","type":"string"},"service_tier":{"default":"auto","enum":["auto","default","flex","priority"],"title":"Service Tier","type":"string"},"temperature":{"default":0.3,"maximum":2,"minimum":0,"title":"Temperature","type":"number"}},"required":["provider","deployment"],"title":"AzureOpenAiLlm","type":"object"},"AnthropicLlm":{"additionalProperties":false,"properties":{"model":{"pattern":"^claude-[a-z0-9.]+(-[a-z0-9.]+)*$","title":"Model","type":"string"},"provider":{"const":"anthropic","title":"Provider","type":"string"},"temperature":{"default":0.3,"maximum":1,"minimum":0,"title":"Temperature","type":"number"}},"required":["provider","model"],"title":"AnthropicLlm","type":"object"},"GoogleLlm":{"additionalProperties":false,"properties":{"model":{"pattern":"^gemini-[a-z0-9.]+(-[a-z0-9.]+)*$","title":"Model","type":"string"},"provider":{"const":"google","title":"Provider","type":"string"},"temperature":{"default":0.3,"maximum":2,"minimum":0,"title":"Temperature","type":"number"}},"required":["provider","model"],"title":"GoogleLlm","type":"object"},"GroqLlm":{"additionalProperties":false,"properties":{"model":{"maxLength":80,"pattern":"^[a-z0-9][a-z0-9._-]*(/[a-z0-9][a-z0-9._-]*)?$","title":"Model","type":"string"},"provider":{"const":"groq","title":"Provider","type":"string"},"temperature":{"default":0.3,"maximum":2,"minimum":0,"title":"Temperature","type":"number"}},"required":["provider","model"],"title":"GroqLlm","type":"object"},"CerebrasLlm":{"additionalProperties":false,"properties":{"model":{"maxLength":80,"pattern":"^[a-z0-9][a-z0-9._-]*$","title":"Model","type":"string"},"provider":{"const":"cerebras","title":"Provider","type":"string"},"reasoning_effort":{"default":"low","enum":["low","medium","high"],"title":"Reasoning Effort","type":"string"},"temperature":{"default":0.3,"maximum":2,"minimum":0,"title":"Temperature","type":"number"}},"required":["provider","model"],"title":"CerebrasLlm","type":"object"},"DeepgramStt":{"additionalProperties":false,"properties":{"keyterms":{"default":[],"items":{"maxLength":60,"minLength":1,"type":"string"},"maxItems":50,"title":"Keyterms","type":"array"},"language":{"default":"es","pattern":"^(multi|[a-z]{2,3}(-[A-Z]{2}|-[0-9]{3})?)$","title":"Language","type":"string"},"model":{"default":"nova-3","pattern":"^nova-[0-9]+(-[a-z0-9]+)*$","title":"Model","type":"string"},"provider":{"const":"deepgram","title":"Provider","type":"string"}},"required":["provider"],"title":"DeepgramStt","type":"object"},"GoogleStt":{"additionalProperties":false,"properties":{"language":{"default":"es-ES","pattern":"^[a-z]{2,3}-[A-Z]{2}$","title":"Language","type":"string"},"model":{"default":"latest_long","enum":["latest_long","latest_short","telephony","chirp_2","chirp_3"],"title":"Model","type":"string"},"provider":{"const":"google","title":"Provider","type":"string"}},"required":["provider"],"title":"GoogleStt","type":"object"},"OpenAiTts":{"additionalProperties":false,"properties":{"model":{"default":"gpt-4o-mini-tts","enum":["tts-1","tts-1-hd","gpt-4o-mini-tts"],"title":"Model","type":"string"},"provider":{"const":"openai","title":"Provider","type":"string"},"voice":{"enum":["alloy","ash","ballad","coral","echo","fable","nova","onyx","sage","shimmer","verse","marin","cedar"],"title":"Voice","type":"string"}},"required":["provider","voice"],"title":"OpenAiTts","type":"object"},"ElevenLabsTts":{"additionalProperties":false,"properties":{"language":{"anyOf":[{"pattern":"^(multi|[a-z]{2,3}(-[A-Z]{2}|-[0-9]{3})?)$","type":"string"},{"type":"null"}],"title":"Language"},"model":{"default":"eleven_flash_v2_5","pattern":"^eleven_[a-z0-9_]+$","title":"Model","type":"string"},"provider":{"const":"elevenlabs","title":"Provider","type":"string"},"voice_id":{"pattern":"^[A-Za-z0-9]{10,40}$","title":"Voice Id","type":"string"}},"required":["provider","voice_id"],"title":"ElevenLabsTts","type":"object"},"CartesiaTts":{"additionalProperties":false,"properties":{"language":{"default":"es","pattern":"^(multi|[a-z]{2,3}(-[A-Z]{2}|-[0-9]{3})?)$","title":"Language","type":"string"},"model":{"default":"sonic-3","pattern":"^sonic(-[a-z0-9]+)*$","title":"Model","type":"string"},"provider":{"const":"cartesia","title":"Provider","type":"string"},"voice":{"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","title":"Voice","type":"string"}},"required":["provider","voice"],"title":"CartesiaTts","type":"object"},"AzureTts":{"additionalProperties":false,"properties":{"language":{"anyOf":[{"pattern":"^[a-z]{2,3}-[A-Z]{2}$","type":"string"},{"type":"null"}],"title":"Language"},"provider":{"const":"azure","title":"Provider","type":"string"},"voice":{"pattern":"^[a-z]{2,3}-[A-Z]{2}-[A-Za-z0-9:-]+$","title":"Voice","type":"string"}},"required":["provider","voice"],"title":"AzureTts","type":"object"},"PronunciationSettings":{"additionalProperties":false,"description":"Pronunciation dictionaries of the organization (`/v1/pronunciation-dictionaries`).","properties":{"dictionary_ids":{"default":[],"items":{"format":"uuid","type":"string"},"maxItems":5,"title":"Dictionary Ids","type":"array"}},"title":"PronunciationSettings","type":"object"},"OpenAiRealtime":{"additionalProperties":false,"properties":{"model":{"pattern":"^gpt-realtime(-[a-z0-9.]+)*$","title":"Model","type":"string"},"noise_reduction":{"anyOf":[{"enum":["near_field","far_field"],"type":"string"},{"type":"null"}],"title":"Noise Reduction"},"provider":{"const":"openai","title":"Provider","type":"string"},"transcription_language":{"anyOf":[{"pattern":"^[a-z]{2}$","type":"string"},{"type":"null"}],"title":"Transcription Language"},"turn_detection":{"default":"server_vad","enum":["server_vad","semantic"],"title":"Turn Detection","type":"string"},"voice":{"enum":["alloy","ash","ballad","coral","echo","sage","shimmer","verse","marin","cedar"],"title":"Voice","type":"string"}},"required":["provider","model","voice"],"title":"OpenAiRealtime","type":"object"},"AzureOpenAiRealtime":{"additionalProperties":false,"properties":{"deployment":{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","title":"Deployment","type":"string"},"model":{"anyOf":[{"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","type":"string"},{"type":"null"}],"title":"Model"},"noise_reduction":{"anyOf":[{"enum":["near_field","far_field"],"type":"string"},{"type":"null"}],"title":"Noise Reduction"},"provider":{"const":"azure_openai","title":"Provider","type":"string"},"transcription_language":{"anyOf":[{"pattern":"^[a-z]{2}$","type":"string"},{"type":"null"}],"title":"Transcription Language"},"turn_detection":{"default":"server_vad","enum":["server_vad","semantic"],"title":"Turn Detection","type":"string"},"voice":{"enum":["alloy","ash","ballad","coral","echo","sage","shimmer","verse","marin","cedar"],"title":"Voice","type":"string"}},"required":["provider","deployment","voice"],"title":"AzureOpenAiRealtime","type":"object"},"GeminiRealtime":{"additionalProperties":false,"properties":{"model":{"maxLength":80,"pattern":"^gemini-[0-9]+(\\.[0-9]+)*(-[a-z]+)*-(live|native-audio)(-[a-z0-9.]+)*$","title":"Model","type":"string"},"provider":{"const":"gemini","title":"Provider","type":"string"},"turn_detection":{"const":"server_vad","default":"server_vad","title":"Turn Detection","type":"string"},"voice":{"enum":["Achernar","Achird","Algenib","Algieba","Alnilam","Aoede","Autonoe","Callirrhoe","Charon","Despina","Enceladus","Erinome","Fenrir","Gacrux","Iapetus","Kore","Laomedeia","Leda","Orus","Pulcherrima","Puck","Rasalgethi","Sadachbia","Sadaltager","Schedar","Sulafat","Umbriel","Vindemiatrix","Zephyr","Zubenelgenubi"],"title":"Voice","type":"string"}},"required":["provider","model","voice"],"title":"GeminiRealtime","type":"object"},"ResultSpec":{"additionalProperties":false,"description":"What to extract from a call (a JSON Schema) and the limits the extracted values must keep.","properties":{"guardrails":{"default":[],"items":{"discriminator":{"mapping":{"max_days_ahead":"#/components/schemas/MaxDaysAhead","min_amount":"#/components/schemas/MinAmount"},"propertyName":"rule"},"oneOf":[{"$ref":"#/components/schemas/MinAmount"},{"$ref":"#/components/schemas/MaxDaysAhead"}]},"maxItems":20,"title":"Guardrails","type":"array"},"json_schema":{"additionalProperties":true,"properties":{"type":{"const":"object"}},"required":["type"],"title":"Json Schema","type":"object"}},"required":["json_schema"],"title":"ResultSpec","type":"object"},"MinAmount":{"additionalProperties":false,"properties":{"field":{"maxLength":200,"minLength":1,"title":"Field","type":"string"},"minimum":{"title":"Minimum","type":"number"},"rule":{"const":"min_amount","title":"Rule","type":"string"}},"required":["rule","field","minimum"],"title":"MinAmount","type":"object"},"MaxDaysAhead":{"additionalProperties":false,"properties":{"days":{"minimum":0,"title":"Days","type":"integer"},"field":{"maxLength":200,"minLength":1,"title":"Field","type":"string"},"rule":{"const":"max_days_ahead","title":"Rule","type":"string"}},"required":["rule","field","days"],"title":"MaxDaysAhead","type":"object"},"SpeechStyleSettings":{"additionalProperties":false,"description":"How the model writes its replies. `spoken_prompt` adds the spoken style block to the\ninstructions (pipeline, realtime and every step of a tree): text written to be heard, short\nturns that open fast, numbers in words. Off for a version without the field, so a published\nassistant sounds as before; new assistants are created with it on. See\ndocs/speech-friendly-text.md.","properties":{"spoken_prompt":{"default":false,"title":"Spoken Prompt","type":"boolean"}},"title":"SpeechStyleSettings","type":"object"},"AssistantTools":{"additionalProperties":false,"description":"What the model may call during a call: API tools by reference and the built-ins.","properties":{"api":{"default":[],"items":{"$ref":"#/components/schemas/ToolReference"},"maxItems":20,"title":"Api","type":"array"},"built_in":{"$ref":"#/components/schemas/BuiltInTools","default":{"date_time":{"date_format":"long","enabled":false,"time_format":"24h"},"end_call":{"enabled":false,"message":""},"transfer_call":{"destination_type":"phone","enabled":false,"message":"","sip_headers":{}}}}},"title":"AssistantTools","type":"object"},"ToolReference":{"additionalProperties":false,"description":"An API tool of the organization's library, by id (`/v1/tools`).","properties":{"tool_id":{"format":"uuid","title":"Tool Id","type":"string"}},"required":["tool_id"],"title":"ToolReference","type":"object"},"BuiltInTools":{"additionalProperties":false,"properties":{"date_time":{"$ref":"#/components/schemas/DateTimeTool","default":{"date_format":"long","enabled":false,"time_format":"24h"}},"end_call":{"$ref":"#/components/schemas/EndCallTool","default":{"enabled":false,"message":""}},"transfer_call":{"$ref":"#/components/schemas/TransferCallTool","default":{"destination_type":"phone","enabled":false,"message":"","sip_headers":{}}}},"title":"BuiltInTools","type":"object"},"DateTimeTool":{"additionalProperties":false,"description":"The current date and time of the call, written in `date_format` and `time_format`, in\n`timezone`: null (automatic) is the call's zone (the contact's or the campaign's, Buenos\nAires in a browser test); an IANA zone such as `America/Lima` (which follows daylight saving\ntime) forces that zone.","properties":{"date_format":{"default":"long","enum":["long","numeric","iso"],"title":"Date Format","type":"string"},"enabled":{"default":false,"title":"Enabled","type":"boolean"},"time_format":{"default":"24h","enum":["24h","12h"],"title":"Time Format","type":"string"},"timezone":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Timezone"}},"title":"DateTimeTool","type":"object"},"EndCallTool":{"additionalProperties":false,"description":"The `end_call` tool: the model hangs up after saying goodbye.","properties":{"enabled":{"default":false,"title":"Enabled","type":"boolean"},"message":{"default":"","maxLength":300,"title":"Message","type":"string"}},"title":"EndCallTool","type":"object"},"TransferCallTool":{"additionalProperties":false,"allOf":[{"else":{"properties":{"destination":{"anyOf":[{"pattern":"^\\+[1-9][0-9]{6,14}$","type":"string"},{"type":"null"}]}}},"if":{"properties":{"destination_type":{"const":"queue"}},"required":["destination_type"]},"then":{"properties":{"destination":{"anyOf":[{"pattern":"^[0-9]+$","type":"string"},{"type":"null"}]}}}}],"properties":{"destination":{"anyOf":[{"pattern":"^\\+[1-9][0-9]{6,14}$","type":"string"},{"pattern":"^[0-9]+$","type":"string"},{"type":"null"}],"title":"Destination"},"destination_type":{"default":"phone","enum":["phone","queue"],"title":"Destination Type","type":"string"},"enabled":{"default":false,"title":"Enabled","type":"boolean"},"message":{"default":"","maxLength":300,"title":"Message","type":"string"},"outbound_trunk_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Outbound Trunk Id"},"sip_headers":{"additionalProperties":{"pattern":"^[a-z][a-z0-9_]{0,63}$","type":"string"},"propertyNames":{"const":"X-Trid"},"title":"Sip Headers","type":"object"}},"title":"TransferCallTool","type":"object"},"VoiceProfileSettings":{"additionalProperties":false,"description":"The expressive mode the assistant speaks in. `off` adds nothing to the instructions, so a\nversion stored without the field sounds as before. `intensity` sets how marked the tone is\nand how often tags are used. `custom` holds the assistant's own profile; it is required when\n`profile` is `custom` and kept (unused) otherwise. See docs/voice-profiles.md.","properties":{"custom":{"anyOf":[{"$ref":"#/components/schemas/CustomVoiceProfile"},{"type":"null"}]},"intensity":{"default":"normal","enum":["subtle","normal","expressive"],"title":"Intensity","type":"string"},"profile":{"default":"off","enum":["off","neutral","empathetic","firm","warm","energetic","custom"],"title":"Profile","type":"string"}},"title":"VoiceProfileSettings","type":"object"},"CustomVoiceProfile":{"additionalProperties":false,"description":"A profile written for one assistant: free tone guidance (Spanish, added to the prompt as\nit is) and the expressive tags it may use, when the TTS supports them.","properties":{"allowed_tags":{"default":[],"items":{"enum":["sighs","exhales","laughs","whispers","curious","excited","pause","slower","faster"],"type":"string"},"maxItems":9,"title":"Allowed Tags","type":"array"},"guidance":{"maxLength":1000,"minLength":1,"title":"Guidance","type":"string"}},"required":["guidance"],"title":"CustomVoiceProfile","type":"object"},"AssistantPage":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/AssistantSummary"},"maxItems":200,"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"AssistantPage","type":"object"},"AssistantSummary":{"additionalProperties":false,"properties":{"archived_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Archived At"},"id":{"format":"uuid","title":"Id","type":"string"},"latest_version":{"minimum":0,"title":"Latest Version","type":"integer"},"mode":{"$ref":"#/components/schemas/AssistantMode"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"status":{"$ref":"#/components/schemas/AssistantStatus"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","mode","latest_version","status","updated_at"],"title":"AssistantSummary","type":"object"},"AssistantMode":{"enum":["pipeline","realtime"],"title":"AssistantMode","type":"string"},"AssistantStatus":{"enum":["draft","published"],"title":"AssistantStatus","type":"string"},"CreateAssistantRequest":{"additionalProperties":false,"properties":{"mode":{"anyOf":[{"$ref":"#/components/schemas/AssistantMode"},{"type":"null"}]},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"template_id":{"anyOf":[{"$ref":"#/components/schemas/TemplateId"},{"type":"null"}]}},"required":["name"],"title":"CreateAssistantRequest","type":"object"},"TemplateId":{"enum":["preventive-collections","early-arrears","nps-survey","inbound-faq","receptionist"],"title":"TemplateId","type":"string"},"AssistantDetail":{"additionalProperties":false,"properties":{"archived_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Archived At"},"config":{"$ref":"#/components/schemas/AssistantVersion"},"id":{"format":"uuid","title":"Id","type":"string"},"latest_version":{"minimum":0,"title":"Latest Version","type":"integer"},"mode":{"$ref":"#/components/schemas/AssistantMode"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"published_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Published Version Id"},"status":{"$ref":"#/components/schemas/AssistantStatus"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","mode","latest_version","status","updated_at","config","published_version_id"],"title":"AssistantDetail","type":"object"},"UpdateDraftRequest":{"additionalProperties":false,"properties":{"config":{"$ref":"#/components/schemas/AssistantVersion"},"name":{"anyOf":[{"maxLength":120,"minLength":1,"type":"string"},{"type":"null"}],"title":"Name"}},"required":["config"],"title":"UpdateDraftRequest","type":"object"},"DuplicateAssistantRequest":{"additionalProperties":false,"properties":{"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"DuplicateAssistantRequest","type":"object"},"ExperimentList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/ExperimentResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"ExperimentList","type":"object"},"ExperimentResponse":{"additionalProperties":false,"properties":{"assistant_id":{"format":"uuid","title":"Assistant Id","type":"string"},"ended_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Ended At"},"id":{"format":"uuid","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"promoted_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Promoted Version"},"started_at":{"format":"date-time","title":"Started At","type":"string"},"status":{"$ref":"#/components/schemas/ExperimentStatus"},"variants":{"items":{"$ref":"#/components/schemas/VariantResponse"},"title":"Variants","type":"array"},"winner_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Winner Version"}},"required":["id","assistant_id","name","status","variants","started_at","ended_at","winner_version","promoted_version"],"title":"ExperimentResponse","type":"object"},"ExperimentStatus":{"enum":["running","stopped","promoted"],"title":"ExperimentStatus","type":"string"},"VariantResponse":{"additionalProperties":false,"properties":{"version":{"minimum":1,"title":"Version","type":"integer"},"weight":{"maximum":100,"minimum":1,"title":"Weight","type":"integer"}},"required":["version","weight"],"title":"VariantResponse","type":"object"},"StartExperimentRequest":{"additionalProperties":false,"properties":{"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"variants":{"items":{"$ref":"#/components/schemas/VariantInput"},"maxItems":5,"minItems":2,"title":"Variants","type":"array"}},"required":["name","variants"],"title":"StartExperimentRequest","type":"object"},"VariantInput":{"additionalProperties":false,"properties":{"version":{"minimum":1,"title":"Version","type":"integer"},"weight":{"maximum":100,"minimum":1,"title":"Weight","type":"integer"}},"required":["version","weight"],"title":"VariantInput","type":"object"},"ExperimentResultsResponse":{"additionalProperties":false,"properties":{"experiment":{"$ref":"#/components/schemas/ExperimentResponse"},"significance":{"$ref":"#/components/schemas/Significance"},"versions":{"items":{"$ref":"#/components/schemas/VersionResult"},"title":"Versions","type":"array"}},"required":["experiment","versions","significance"],"title":"ExperimentResultsResponse","type":"object"},"Significance":{"additionalProperties":false,"properties":{"comparisons":{"items":{"$ref":"#/components/schemas/Comparison"},"title":"Comparisons","type":"array"},"control_version":{"title":"Control Version","type":"integer"},"metric":{"title":"Metric","type":"string"},"note":{"title":"Note","type":"string"}},"required":["metric","control_version","comparisons","note"],"title":"Significance","type":"object"},"Comparison":{"additionalProperties":false,"properties":{"enough_data":{"title":"Enough Data","type":"boolean"},"p_value":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"title":"P Value"},"significant":{"title":"Significant","type":"boolean"},"version":{"title":"Version","type":"integer"},"z":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Z"}},"required":["version","z","p_value","significant","enough_data"],"title":"Comparison","type":"object"},"VersionResult":{"additionalProperties":false,"properties":{"answer_rate":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"title":"Answer Rate"},"answered":{"minimum":0,"title":"Answered","type":"integer"},"avg_cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Avg Cost Usd"},"avg_duration_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds"},"calls":{"minimum":0,"title":"Calls","type":"integer"},"outcomes":{"additionalProperties":{"type":"integer"},"title":"Outcomes","type":"object"},"success_rate":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"title":"Success Rate"},"version":{"title":"Version","type":"integer"},"weight":{"title":"Weight","type":"integer"}},"required":["version","weight","calls","answered","answer_rate","avg_duration_seconds","outcomes","avg_cost_usd"],"title":"VersionResult","type":"object"},"PromoteExperimentRequest":{"additionalProperties":false,"properties":{"version":{"minimum":1,"title":"Version","type":"integer"}},"required":["version"],"title":"PromoteExperimentRequest","type":"object"},"PublishAssistantRequest":{"additionalProperties":false,"properties":{"change_note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Change Note"}},"title":"PublishAssistantRequest","type":"object"},"CreateTalkSessionRequest":{"additionalProperties":false,"properties":{"use_draft":{"default":false,"title":"Use Draft","type":"boolean"},"variables":{"maxProperties":50,"patternProperties":{"^[a-z][a-z0-9_]{0,63}$":{"discriminator":{"mapping":{"date":"#/components/schemas/TalkDate","money":"#/components/schemas/TalkMoney","phone":"#/components/schemas/TalkPhone","string":"#/components/schemas/TalkString"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/TalkString"},{"$ref":"#/components/schemas/TalkMoney"},{"$ref":"#/components/schemas/TalkDate"},{"$ref":"#/components/schemas/TalkPhone"}]}},"title":"Variables","type":"object"}},"title":"CreateTalkSessionRequest","type":"object"},"TalkString":{"additionalProperties":false,"properties":{"type":{"const":"string","title":"Type","type":"string"},"value":{"maxLength":200,"minLength":1,"title":"Value","type":"string"}},"required":["type","value"],"title":"TalkString","type":"object"},"TalkMoney":{"additionalProperties":false,"properties":{"amount":{"pattern":"^\\d{1,12}(\\.\\d{1,2})?$","title":"Amount","type":"string"},"currency":{"enum":["ARS","USD"],"title":"Currency","type":"string"},"type":{"const":"money","title":"Type","type":"string"}},"required":["type","amount","currency"],"title":"TalkMoney","type":"object"},"TalkDate":{"additionalProperties":false,"properties":{"type":{"const":"date","title":"Type","type":"string"},"value":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Value","type":"string"}},"required":["type","value"],"title":"TalkDate","type":"object"},"TalkPhone":{"additionalProperties":false,"properties":{"type":{"const":"phone","title":"Type","type":"string"},"value":{"pattern":"^\\+[1-9]\\d{6,14}$","title":"Value","type":"string"}},"required":["type","value"],"title":"TalkPhone","type":"object"},"TalkSessionResponse":{"additionalProperties":false,"properties":{"expires_in":{"minimum":1,"title":"Expires In","type":"integer"},"livekit_url":{"maxLength":255,"title":"Livekit Url","type":"string"},"room":{"maxLength":100,"title":"Room","type":"string"},"session_id":{"format":"uuid","title":"Session Id","type":"string"},"token":{"maxLength":4096,"title":"Token","type":"string"}},"required":["session_id","room","livekit_url","token","expires_in"],"title":"TalkSessionResponse","type":"object"},"CreateCallTestRequest":{"additionalProperties":false,"properties":{"caller_id_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Caller Id Id"},"outbound_trunk_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Outbound Trunk Id"},"phone_number":{"maxLength":16,"pattern":"^\\+[1-9][0-9]{6,14}$","title":"Phone Number","type":"string"},"use_draft":{"default":false,"title":"Use Draft","type":"boolean"},"variables":{"maxProperties":50,"patternProperties":{"^[a-z][a-z0-9_]{0,63}$":{"discriminator":{"mapping":{"date":"#/components/schemas/TalkDate","money":"#/components/schemas/TalkMoney","phone":"#/components/schemas/TalkPhone","string":"#/components/schemas/TalkString"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/TalkString"},{"$ref":"#/components/schemas/TalkMoney"},{"$ref":"#/components/schemas/TalkDate"},{"$ref":"#/components/schemas/TalkPhone"}]}},"title":"Variables","type":"object"}},"required":["phone_number"],"title":"CreateCallTestRequest","type":"object"},"CallTestResponse":{"additionalProperties":false,"properties":{"assistant_version":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Assistant Version"},"assistant_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The version selected before dialing, when known.","title":"Assistant Version Id"},"call_id":{"format":"uuid","title":"Call Id","type":"string"},"failure_reason":{"anyOf":[{"$ref":"#/components/schemas/CallTestFailure"},{"type":"null"}],"description":"Set when `status` is `failed`: `no_answer`, `busy`, `rejected`, `unavailable` (carrier or media server) or `timeout`."},"started_at":{"format":"date-time","title":"Started At","type":"string"},"status":{"$ref":"#/components/schemas/CallTestStatus","description":"`dialing` (ringing), `in_progress` (answered, the agent is talking), `completed` (the call ended) or `failed` (see `failure_reason`)."}},"required":["call_id","status","started_at"],"title":"CallTestResponse","type":"object"},"CallTestFailure":{"enum":["no_answer","busy","rejected","unavailable","timeout"],"title":"CallTestFailure","type":"string"},"CallTestStatus":{"enum":["dialing","in_progress","completed","failed"],"title":"CallTestStatus","type":"string"},"TestCaseList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/TestCaseResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"TestCaseList","type":"object"},"TestCaseResponse":{"additionalProperties":false,"properties":{"assertions":{"default":[],"items":{"discriminator":{"mapping":{"criterion":"#/components/schemas/Criterion","ended_with":"#/components/schemas/EndedWith","not_said":"#/components/schemas/NotSaid","reached_step":"#/components/schemas/ReachedStep","said":"#/components/schemas/Said","tool_called":"#/components/schemas/ToolCalled","tool_not_called":"#/components/schemas/ToolNotCalled"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/Criterion"},{"$ref":"#/components/schemas/ToolCalled"},{"$ref":"#/components/schemas/ToolNotCalled"},{"$ref":"#/components/schemas/ReachedStep"},{"$ref":"#/components/schemas/EndedWith"},{"$ref":"#/components/schemas/Said"},{"$ref":"#/components/schemas/NotSaid"}]},"maxItems":20,"title":"Assertions","type":"array"},"assistant_id":{"format":"uuid","title":"Assistant Id","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"last_run":{"anyOf":[{"$ref":"#/components/schemas/RunSummary"},{"type":"null"}]},"max_turns":{"default":12,"maximum":40,"minimum":1,"title":"Max Turns","type":"integer"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"persona":{"maxLength":4000,"minLength":1,"title":"Persona","type":"string"},"tool_mocks":{"default":[],"items":{"$ref":"#/components/schemas/ToolMock"},"maxItems":20,"title":"Tool Mocks","type":"array"},"tool_mode":{"default":"mock","enum":["mock","live"],"title":"Tool Mode","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"variables":{"default":{},"maxProperties":50,"patternProperties":{"^[a-z][a-z0-9_]{0,63}$":{"maxLength":500,"type":"string"}},"title":"Variables","type":"object"}},"required":["name","persona","id","assistant_id","created_at","updated_at"],"title":"TestCaseResponse","type":"object"},"Criterion":{"additionalProperties":false,"description":"A success criterion in plain language, judged by an LLM (pass or fail with a rationale).","properties":{"text":{"maxLength":1000,"minLength":1,"title":"Text","type":"string"},"type":{"const":"criterion","title":"Type","type":"string"}},"required":["type","text"],"title":"Criterion","type":"object"},"ToolCalled":{"additionalProperties":false,"properties":{"arguments":{"additionalProperties":true,"default":{},"maxProperties":20,"title":"Arguments","type":"object"},"match":{"default":"equals","enum":["equals","contains","regex"],"title":"Match","type":"string"},"name":{"maxLength":64,"minLength":1,"title":"Name","type":"string"},"type":{"const":"tool_called","title":"Type","type":"string"}},"required":["type","name"],"title":"ToolCalled","type":"object"},"ToolNotCalled":{"additionalProperties":false,"properties":{"name":{"maxLength":64,"minLength":1,"title":"Name","type":"string"},"type":{"const":"tool_not_called","title":"Type","type":"string"}},"required":["type","name"],"title":"ToolNotCalled","type":"object"},"ReachedStep":{"additionalProperties":false,"properties":{"step":{"maxLength":64,"minLength":1,"title":"Step","type":"string"},"type":{"const":"reached_step","title":"Type","type":"string"}},"required":["type","step"],"title":"ReachedStep","type":"object"},"EndedWith":{"additionalProperties":false,"properties":{"outcome":{"enum":["completed","transferred","caller_hangup","max_turns"],"title":"Outcome","type":"string"},"type":{"const":"ended_with","title":"Type","type":"string"}},"required":["type","outcome"],"title":"EndedWith","type":"object"},"Said":{"additionalProperties":false,"properties":{"phrase":{"maxLength":300,"minLength":1,"title":"Phrase","type":"string"},"type":{"const":"said","title":"Type","type":"string"}},"required":["type","phrase"],"title":"Said","type":"object"},"NotSaid":{"additionalProperties":false,"properties":{"phrase":{"maxLength":300,"minLength":1,"title":"Phrase","type":"string"},"type":{"const":"not_said","title":"Type","type":"string"}},"required":["type","phrase"],"title":"NotSaid","type":"object"},"RunSummary":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Finished At"},"id":{"format":"uuid","title":"Id","type":"string"},"status":{"$ref":"#/components/schemas/control_plane__core__simulations__RunStatus"}},"required":["id","status","created_at","finished_at"],"title":"RunSummary","type":"object"},"control_plane__core__simulations__RunStatus":{"enum":["queued","running","passed","failed","error"],"title":"RunStatus","type":"string"},"ToolMock":{"additionalProperties":false,"description":"A canned answer for a tool: the first mock of the tool whose `arguments` match is used.","properties":{"arguments":{"additionalProperties":true,"default":{},"maxProperties":20,"title":"Arguments","type":"object"},"error":{"default":false,"title":"Error","type":"boolean"},"response":{"default":"","maxLength":4000,"title":"Response","type":"string"},"tool":{"maxLength":64,"minLength":1,"title":"Tool","type":"string"}},"required":["tool"],"title":"ToolMock","type":"object"},"TestCaseRequest":{"additionalProperties":false,"description":"A test case: a simulated caller, what to check and which tools are mocked.","properties":{"assertions":{"default":[],"items":{"discriminator":{"mapping":{"criterion":"#/components/schemas/Criterion","ended_with":"#/components/schemas/EndedWith","not_said":"#/components/schemas/NotSaid","reached_step":"#/components/schemas/ReachedStep","said":"#/components/schemas/Said","tool_called":"#/components/schemas/ToolCalled","tool_not_called":"#/components/schemas/ToolNotCalled"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/Criterion"},{"$ref":"#/components/schemas/ToolCalled"},{"$ref":"#/components/schemas/ToolNotCalled"},{"$ref":"#/components/schemas/ReachedStep"},{"$ref":"#/components/schemas/EndedWith"},{"$ref":"#/components/schemas/Said"},{"$ref":"#/components/schemas/NotSaid"}]},"maxItems":20,"title":"Assertions","type":"array"},"max_turns":{"default":12,"maximum":40,"minimum":1,"title":"Max Turns","type":"integer"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"persona":{"maxLength":4000,"minLength":1,"title":"Persona","type":"string"},"tool_mocks":{"default":[],"items":{"$ref":"#/components/schemas/ToolMock"},"maxItems":20,"title":"Tool Mocks","type":"array"},"tool_mode":{"default":"mock","enum":["mock","live"],"title":"Tool Mode","type":"string"},"variables":{"default":{},"maxProperties":50,"patternProperties":{"^[a-z][a-z0-9_]{0,63}$":{"maxLength":500,"type":"string"}},"title":"Variables","type":"object"}},"required":["name","persona"],"title":"TestCaseRequest","type":"object"},"RunStatus-Input":{"enum":["queued","running","passed","failed","error"],"title":"RunStatus","type":"string"},"RunList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/RunResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"RunList","type":"object"},"RunResponse":{"additionalProperties":false,"properties":{"batch_id":{"format":"uuid","title":"Batch Id","type":"string"},"config_hash":{"title":"Config Hash","type":"string"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Finished At"},"id":{"format":"uuid","title":"Id","type":"string"},"result":{"anyOf":[{"$ref":"#/components/schemas/RunResult"},{"type":"null"}]},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Started At"},"status":{"$ref":"#/components/schemas/control_plane__core__simulations__RunStatus"},"target":{"enum":["draft","published"],"title":"Target","type":"string"},"test_id":{"format":"uuid","title":"Test Id","type":"string"},"test_name":{"title":"Test Name","type":"string"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version Number"}},"required":["id","test_id","test_name","batch_id","target","version_number","config_hash","status","created_at","started_at","finished_at","result"],"title":"RunResponse","type":"object"},"RunResult":{"additionalProperties":false,"description":"What the simulation runner reports: the conversation and each verdict.","properties":{"assertions":{"default":[],"items":{"$ref":"#/components/schemas/AssertionResult"},"maxItems":100,"title":"Assertions","type":"array"},"duration_ms":{"default":0,"maximum":86400000,"minimum":0,"title":"Duration Ms","type":"integer"},"end_reason":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"title":"End Reason"},"error":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Error"},"steps":{"default":[],"items":{"maxLength":64,"type":"string"},"maxItems":200,"title":"Steps","type":"array"},"tokens":{"$ref":"#/components/schemas/TokenUsage","default":{"assistant_completion":0,"assistant_prompt":0,"caller_completion":0,"caller_prompt":0,"judge_completion":0,"judge_prompt":0}},"tool_calls":{"default":[],"items":{"$ref":"#/components/schemas/ToolCallRecord"},"maxItems":200,"title":"Tool Calls","type":"array"},"transcript":{"default":[],"items":{"$ref":"#/components/schemas/TranscriptTurn"},"maxItems":200,"title":"Transcript","type":"array"},"usage":{"default":[],"items":{"$ref":"#/components/schemas/ModelUsage"},"maxItems":3,"title":"Usage","type":"array"}},"title":"RunResult","type":"object"},"AssertionResult":{"additionalProperties":false,"properties":{"index":{"maximum":100,"minimum":0,"title":"Index","type":"integer"},"label":{"maxLength":1100,"title":"Label","type":"string"},"passed":{"title":"Passed","type":"boolean"},"rationale":{"default":"","maxLength":1000,"title":"Rationale","type":"string"},"type":{"maxLength":32,"title":"Type","type":"string"}},"required":["index","type","label","passed"],"title":"AssertionResult","type":"object"},"TokenUsage":{"additionalProperties":false,"properties":{"assistant_completion":{"default":0,"minimum":0,"title":"Assistant Completion","type":"integer"},"assistant_prompt":{"default":0,"minimum":0,"title":"Assistant Prompt","type":"integer"},"caller_completion":{"default":0,"minimum":0,"title":"Caller Completion","type":"integer"},"caller_prompt":{"default":0,"minimum":0,"title":"Caller Prompt","type":"integer"},"judge_completion":{"default":0,"minimum":0,"title":"Judge Completion","type":"integer"},"judge_prompt":{"default":0,"minimum":0,"title":"Judge Prompt","type":"integer"}},"title":"TokenUsage","type":"object"},"ToolCallRecord":{"additionalProperties":false,"properties":{"arguments":{"additionalProperties":true,"default":{},"title":"Arguments","type":"object"},"is_error":{"default":false,"title":"Is Error","type":"boolean"},"mocked":{"default":false,"title":"Mocked","type":"boolean"},"name":{"maxLength":64,"title":"Name","type":"string"},"output":{"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Output"}},"required":["name"],"title":"ToolCallRecord","type":"object"},"TranscriptTurn":{"additionalProperties":false,"properties":{"role":{"enum":["caller","assistant"],"title":"Role","type":"string"},"step":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Step"},"text":{"maxLength":4000,"title":"Text","type":"string"}},"required":["role","text"],"title":"TranscriptTurn","type":"object"},"ModelUsage":{"additionalProperties":false,"description":"What one model of the run consumed; it is what the run adds to the tenant's usage.","properties":{"input_tokens":{"default":0,"minimum":0,"title":"Input Tokens","type":"integer"},"model":{"maxLength":200,"title":"Model","type":"string"},"output_tokens":{"default":0,"minimum":0,"title":"Output Tokens","type":"integer"},"provider":{"maxLength":100,"title":"Provider","type":"string"},"role":{"enum":["assistant","caller","judge"],"title":"Role","type":"string"}},"required":["role","provider","model"],"title":"ModelUsage","type":"object"},"RunTestsRequest":{"additionalProperties":false,"properties":{"target":{"default":"draft","enum":["draft","published"],"title":"Target","type":"string"},"test_ids":{"anyOf":[{"items":{"format":"uuid","type":"string"},"maxItems":100,"minItems":1,"type":"array"},{"type":"null"}],"title":"Test Ids"}},"title":"RunTestsRequest","type":"object"},"RunsStarted":{"additionalProperties":false,"properties":{"batch_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Batch Id"},"items":{"items":{"$ref":"#/components/schemas/RunResponse"},"title":"Items","type":"array"}},"required":["batch_id","items"],"title":"RunsStarted","type":"object"},"TestSettingsResponse":{"additionalProperties":false,"properties":{"require_pass_before_publish":{"title":"Require Pass Before Publish","type":"boolean"}},"required":["require_pass_before_publish"],"title":"TestSettingsResponse","type":"object"},"TestSettingsRequest":{"additionalProperties":false,"properties":{"require_pass_before_publish":{"title":"Require Pass Before Publish","type":"boolean"}},"required":["require_pass_before_publish"],"title":"TestSettingsRequest","type":"object"},"RunTestRequest":{"additionalProperties":false,"properties":{"target":{"default":"draft","enum":["draft","published"],"title":"Target","type":"string"}},"title":"RunTestRequest","type":"object"},"AssistantVersionList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/AssistantVersionSummary"},"title":"Items","type":"array"}},"required":["items"],"title":"AssistantVersionList","type":"object"},"AssistantVersionSummary":{"additionalProperties":false,"properties":{"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"id":{"format":"uuid","title":"Id","type":"string"},"number":{"minimum":1,"title":"Number","type":"integer"}},"required":["id","number","created_at","created_by","change_note"],"title":"AssistantVersionSummary","type":"object"},"AssistantVersionDetail":{"additionalProperties":false,"properties":{"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"},"config":{"$ref":"#/components/schemas/AssistantVersion"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"id":{"format":"uuid","title":"Id","type":"string"},"number":{"minimum":1,"title":"Number","type":"integer"}},"required":["id","number","created_at","created_by","change_note","config"],"title":"AssistantVersionDetail","type":"object"},"AuditLogPageResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditEntryResponse"},"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"AuditLogPageResponse","type":"object"},"AuditEntryResponse":{"additionalProperties":false,"properties":{"action":{"title":"Action","type":"string"},"actor":{"$ref":"#/components/schemas/AuditActorResponse"},"after":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"After"},"before":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Before"},"id":{"format":"uuid","title":"Id","type":"string"},"occurred_at":{"format":"date-time","title":"Occurred At","type":"string"},"resource_id":{"title":"Resource Id","type":"string"},"resource_type":{"title":"Resource Type","type":"string"}},"required":["id","occurred_at","actor","action","resource_type","resource_id","before","after"],"title":"AuditEntryResponse","type":"object"},"AuditActorResponse":{"additionalProperties":false,"properties":{"id":{"title":"Id","type":"string"},"kind":{"description":"`user`, `api_key`, `platform_admin` (a platform admin acting on this organization), `optimizer` or `service` (an internal service such as the orchestrator; the id is the service name). The set may grow: handle unknown values.","title":"Kind","type":"string","x-extensible-enum":["user","api_key","platform_admin","optimizer","service"]}},"required":["kind","id"],"title":"AuditActorResponse","type":"object"},"CallerIdList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/CallerIdResponse"},"maxItems":50,"title":"Items","type":"array"}},"required":["items"],"title":"CallerIdList","type":"object"},"CallerIdResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"label":{"maxLength":60,"minLength":1,"title":"Label","type":"string"},"phone_e164":{"maxLength":16,"pattern":"^\\+[1-9][0-9]{6,14}$","title":"Phone E164","type":"string"}},"required":["id","phone_e164","label","created_at"],"title":"CallerIdResponse","type":"object"},"CreateCallerIdRequest":{"additionalProperties":false,"properties":{"label":{"maxLength":60,"minLength":1,"title":"Label","type":"string"},"phone_e164":{"maxLength":16,"pattern":"^\\+[1-9][0-9]{6,14}$","title":"Phone E164","type":"string"}},"required":["phone_e164","label"],"title":"CreateCallerIdRequest","type":"object"},"Outcome":{"enum":["answered","busy","no_answer","voicemail","failed","dnc"],"title":"Outcome","type":"string"},"EndReason":{"description":"Why a call ended. The first six are the `call.ended` reasons; the rest only come from the\nsimulated dialer, whose calls never connect.","enum":["completed","caller_hangup","transferred","voicemail","time_limit","error","no_answer","busy","dnc"],"title":"EndReason","type":"string"},"Direction":{"enum":["inbound","outbound"],"title":"Direction","type":"string"},"CallPage":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/CallSummary"},"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"CallPage","type":"object"},"CallSummary":{"additionalProperties":false,"properties":{"assistant":{"anyOf":[{"$ref":"#/components/schemas/AssistantRef"},{"type":"null"}]},"assistant_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The immutable snapshot when known. Null for drafts.","title":"Assistant Version Id"},"called_last4":{"anyOf":[{"pattern":"^[0-9]{4}$","type":"string"},{"type":"null"}],"description":"Inbound calls: the end of the eco number that was dialed (`phone_last4` is the caller). Null for outbound calls, where `phone_last4` is the number called. Never the full number.","title":"Called Last4"},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignRef"},{"type":"null"}]},"cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Estimate: the sum of the usage lines when every one has a price, else the total the call reported; null when neither exists.","title":"Cost Usd"},"direction":{"$ref":"#/components/schemas/Direction"},"draft":{"default":false,"description":"The call ran the assistant's unpublished draft (a Talk session or a test call of the draft). A draft has no version number: `assistant.version` is then only the last published number (1 when there is none) and must not be shown as the version the call ran.","title":"Draft","type":"boolean"},"duration_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"end_reason":{"anyOf":[{"$ref":"#/components/schemas/EndReason"},{"type":"null"}]},"id":{"format":"uuid","title":"Id","type":"string"},"outcome":{"$ref":"#/components/schemas/Outcome"},"phone_last4":{"anyOf":[{"pattern":"^[0-9]{4}$","type":"string"},{"type":"null"}],"description":"Never the full number.","title":"Phone Last4"},"sentiment":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}],"description":"From the post-call analysis; null when the call was not analyzed.","title":"Sentiment"},"silence_phase":{"anyOf":[{"enum":["initial","in_conversation"],"type":"string"},{"type":"null"}],"description":"When a silence policy ended the call, the phase in which it timed out.","title":"Silence Phase"},"simulated":{"description":"A campaign attempt without a worker call record.","title":"Simulated","type":"boolean"},"started_at":{"format":"date-time","title":"Started At","type":"string"},"test":{"default":false,"description":"A test call: the assistant dialed a member's phone to be tried. It belongs to no campaign and is left out of the metrics.","title":"Test","type":"boolean"}},"required":["id","started_at","duration_seconds","assistant","campaign","outcome","end_reason","cost_usd","direction","phone_last4","simulated"],"title":"CallSummary","type":"object"},"AssistantRef":{"additionalProperties":false,"properties":{"id":{"format":"uuid","title":"Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null when the assistant no longer exists.","title":"Name"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"The version number when known.","title":"Version"}},"required":["id","name","version"],"title":"AssistantRef","type":"object"},"CampaignRef":{"additionalProperties":false,"properties":{"id":{"format":"uuid","title":"Id","type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"required":["id","name"],"title":"CampaignRef","type":"object"},"CallDetailResponse":{"additionalProperties":false,"properties":{"analysis":{"anyOf":[{"$ref":"#/components/schemas/CallAnalysisResponse"},{"type":"null"}],"description":"The post-call analysis (summary, the verdict and rationale of each success criterion, sentiment); null when the assistant has none or it is not ready."},"assistant":{"anyOf":[{"$ref":"#/components/schemas/AssistantRef"},{"type":"null"}]},"assistant_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The immutable snapshot when known. Null for drafts.","title":"Assistant Version Id"},"called_last4":{"anyOf":[{"pattern":"^[0-9]{4}$","type":"string"},{"type":"null"}],"description":"Inbound calls: the end of the eco number that was dialed (`phone_last4` is the caller). Null for outbound calls, where `phone_last4` is the number called. Never the full number.","title":"Called Last4"},"campaign":{"anyOf":[{"$ref":"#/components/schemas/CampaignRef"},{"type":"null"}]},"captured_data":{"default":[],"description":"Tree mode: the values the conversation tree captured during the call, with the step and moment of each (redacted like the `call.result` event). Empty for a prompt assistant or when nothing was captured. It is reported apart from `structured_output`, which is what the result extraction produced.","items":{"$ref":"#/components/schemas/CapturedFieldResponse"},"title":"Captured Data","type":"array"},"cost":{"anyOf":[{"$ref":"#/components/schemas/CallCostResponse"},{"type":"null"}]},"cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Estimate: the sum of the usage lines when every one has a price, else the total the call reported; null when neither exists.","title":"Cost Usd"},"direction":{"$ref":"#/components/schemas/Direction"},"draft":{"default":false,"description":"The call ran the assistant's unpublished draft (a Talk session or a test call of the draft). A draft has no version number: `assistant.version` is then only the last published number (1 when there is none) and must not be shown as the version the call ran.","title":"Draft","type":"boolean"},"duration_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"end_reason":{"anyOf":[{"$ref":"#/components/schemas/EndReason"},{"type":"null"}]},"guardrail_violations":{"items":{"additionalProperties":true,"type":"object"},"title":"Guardrail Violations","type":"array"},"id":{"format":"uuid","title":"Id","type":"string"},"latencies":{"items":{"$ref":"#/components/schemas/TurnLatencyResponse"},"title":"Latencies","type":"array"},"latency_breakdown":{"$ref":"#/components/schemas/LatencyBreakdownResponse","description":"Where the time of each turn went: the stages between the end of the caller's speech and the first audio of the reply, what they leave unexplained, and the mean, p50 and p95 of each over the call. Stage times are measured on the worker; the network part is an estimate (see each field). Empty for a call with no turns."},"outcome":{"$ref":"#/components/schemas/Outcome"},"phone_last4":{"anyOf":[{"pattern":"^[0-9]{4}$","type":"string"},{"type":"null"}],"description":"Never the full number.","title":"Phone Last4"},"recording":{"anyOf":[{"$ref":"#/components/schemas/RecordingInfo"},{"type":"null"}],"description":"The audio recording of the call; null when the call was not recorded, it expired or recordings are not configured. The audio itself is read with `GET /v1/calls/{call_id}/recording`."},"result_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`valid`, `guardrail_violation`, `schema_invalid` or `not_extracted`.","title":"Result Outcome"},"sentiment":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}],"description":"From the post-call analysis; null when the call was not analyzed.","title":"Sentiment"},"silence_phase":{"anyOf":[{"enum":["initial","in_conversation"],"type":"string"},{"type":"null"}],"description":"When a silence policy ended the call, the phase in which it timed out.","title":"Silence Phase"},"simulated":{"description":"A campaign attempt without a worker call record.","title":"Simulated","type":"boolean"},"started_at":{"format":"date-time","title":"Started At","type":"string"},"structured_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Redacted like the `call.result` event; null when none.","title":"Structured Output"},"test":{"default":false,"description":"A test call: the assistant dialed a member's phone to be tried. It belongs to no campaign and is left out of the metrics.","title":"Test","type":"boolean"},"timeline":{"items":{"$ref":"#/components/schemas/TimelineEntryResponse"},"title":"Timeline","type":"array"},"transcript":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"deprecated":true,"description":"Deprecated: use `transcript_turns`. One `role: text` line per spoken turn (tool calls are left out), for clients written before transcripts were stored. Null when there is none, it expired or transcripts are not configured.","title":"Transcript"},"transcript_info":{"anyOf":[{"$ref":"#/components/schemas/TranscriptInfo"},{"type":"null"}],"description":"Null exactly when `transcript_turns` is null."},"transcript_turns":{"anyOf":[{"items":{"$ref":"#/components/schemas/TranscriptTurnResponse"},"type":"array"},{"type":"null"}],"description":"What was said, in order, with roles and times; null when there is none, it expired or transcripts are not configured.","title":"Transcript Turns"},"tree_path":{"description":"Steps of the conversation tree, in order.","items":{"type":"string"},"title":"Tree Path","type":"array"}},"required":["id","started_at","duration_seconds","assistant","campaign","outcome","end_reason","cost_usd","direction","phone_last4","simulated","timeline","latencies","latency_breakdown","tree_path","cost","result_outcome","structured_output","guardrail_violations","transcript"],"title":"CallDetailResponse","type":"object"},"CallAnalysisResponse":{"additionalProperties":false,"properties":{"analyzed_at":{"format":"date-time","title":"Analyzed At","type":"string"},"criteria":{"items":{"$ref":"#/components/schemas/CriterionResultResponse"},"title":"Criteria","type":"array"},"model":{"title":"Model","type":"string"},"sentiment":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}],"title":"Sentiment"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Redacted like the transcript.","title":"Summary"}},"required":["summary","criteria","sentiment","model","analyzed_at"],"title":"CallAnalysisResponse","type":"object"},"CriterionResultResponse":{"additionalProperties":false,"properties":{"id":{"title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"rationale":{"title":"Rationale","type":"string"},"result":{"description":"`success`, `failure` or `unknown`.","enum":["success","failure","unknown"],"title":"Result","type":"string"}},"required":["id","name","result","rationale"],"title":"CriterionResultResponse","type":"object"},"CapturedFieldResponse":{"additionalProperties":false,"properties":{"captured_at":{"format":"date-time","title":"Captured At","type":"string"},"name":{"title":"Name","type":"string"},"step":{"title":"Step","type":"string"},"value":{"title":"Value","type":"string"}},"required":["name","value","step","captured_at"],"title":"CapturedFieldResponse","type":"object"},"CallCostResponse":{"additionalProperties":false,"properties":{"components":{"description":"The cost per component (llm, realtime, stt, tts, embeddings, telephony); a component with a model that has no price is left out. Empty when the call has no usage and the cost was reported as one total.","items":{"$ref":"#/components/schemas/CostComponentResponse"},"title":"Components","type":"array"},"llm_input_tokens":{"title":"Llm Input Tokens","type":"integer"},"llm_output_tokens":{"title":"Llm Output Tokens","type":"integer"},"total_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Total Usd"},"tts_characters":{"title":"Tts Characters","type":"integer"},"unpriced_turns":{"title":"Unpriced Turns","type":"integer"},"usage":{"description":"What the call consumed, per source, component, provider and model, with the estimated cost of each (null when the model has no price).","items":{"$ref":"#/components/schemas/CallUsageLineResponse"},"title":"Usage","type":"array"}},"required":["total_usd","unpriced_turns","llm_input_tokens","llm_output_tokens","tts_characters","components","usage"],"title":"CallCostResponse","type":"object"},"CostComponentResponse":{"additionalProperties":false,"properties":{"component":{"title":"Component","type":"string"},"cost_usd":{"minimum":0,"title":"Cost Usd","type":"number"}},"required":["component","cost_usd"],"title":"CostComponentResponse","type":"object"},"CallUsageLineResponse":{"additionalProperties":false,"properties":{"component":{"title":"Component","type":"string"},"cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Null when the model has no price.","title":"Cost Usd"},"model":{"title":"Model","type":"string"},"provider":{"title":"Provider","type":"string"},"quantities":{"$ref":"#/components/schemas/UsageQuantities"},"source":{"title":"Source","type":"string"}},"required":["source","component","provider","model","quantities","cost_usd"],"title":"CallUsageLineResponse","type":"object"},"UsageQuantities":{"additionalProperties":false,"properties":{"audio_input_tokens":{"minimum":0,"title":"Audio Input Tokens","type":"integer"},"audio_output_tokens":{"minimum":0,"title":"Audio Output Tokens","type":"integer"},"audio_seconds":{"minimum":0,"title":"Audio Seconds","type":"number"},"cached_input_tokens":{"description":"Part of `input_tokens`.","minimum":0,"title":"Cached Input Tokens","type":"integer"},"characters":{"minimum":0,"title":"Characters","type":"integer"},"input_tokens":{"minimum":0,"title":"Input Tokens","type":"integer"},"output_tokens":{"minimum":0,"title":"Output Tokens","type":"integer"},"reasoning_tokens":{"description":"Part of `output_tokens`.","minimum":0,"title":"Reasoning Tokens","type":"integer"},"requests":{"minimum":0,"title":"Requests","type":"integer"},"text_input_tokens":{"minimum":0,"title":"Text Input Tokens","type":"integer"},"text_output_tokens":{"minimum":0,"title":"Text Output Tokens","type":"integer"}},"required":["input_tokens","cached_input_tokens","output_tokens","reasoning_tokens","audio_input_tokens","audio_output_tokens","text_input_tokens","text_output_tokens","audio_seconds","characters","requests"],"title":"UsageQuantities","type":"object"},"TurnLatencyResponse":{"additionalProperties":false,"properties":{"audio_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Realtime turns: the audio part of the input tokens.","title":"Audio Input Tokens"},"audio_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Audio Output Tokens"},"e2e_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"E2E Ms"},"eou_delay_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Eou Delay Ms"},"estimated_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Estimated cost of the turn; null when a stage has no price.","title":"Estimated Cost Usd"},"expressive_tags_removed":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Tags the model wrote that the profile or the TTS does not allow, removed before the TTS. Null when the assistant has no voice profile.","title":"Expressive Tags Removed"},"expressive_tags_sent":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Voice profile tags the model wrote that reached the TTS (pipeline). Null when the assistant has no voice profile.","title":"Expressive Tags Sent"},"interrupted":{"title":"Interrupted","type":"boolean"},"llm_cached_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Cached input tokens, already inside the input tokens.","title":"Llm Cached Tokens"},"llm_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Input tokens of the turn.","title":"Llm Input Tokens"},"llm_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Output Tokens"},"llm_provider_ttft_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"First token as the model client saw it; `llm_ttft_ms` is at the node.","title":"Llm Provider Ttft Ms"},"llm_rtt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE: TCP round trip to the LLM provider endpoint.","title":"Llm Rtt Ms"},"llm_ttfs_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Model start to the first sentence reaching the TTS (pipeline).","title":"Llm Ttfs Ms"},"llm_ttft_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Llm Ttft Ms"},"media_rtt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE: round trip between the worker and the LiveKit server, sampled during the call. The leg between LiveKit and the caller is not measured.","title":"Media Rtt Ms"},"playback_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"First audio forwarded to the output reporting it started.","title":"Playback Ms"},"stt_audio_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Seconds of audio sent to the STT (pipeline).","title":"Stt Audio Seconds"},"stt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Stt Ms"},"stt_rtt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE: TCP round trip to the STT provider endpoint.","title":"Stt Rtt Ms"},"text_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Text Input Tokens"},"text_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Text Output Tokens"},"tts_audio_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Seconds of audio the TTS produced (pipeline).","title":"Tts Audio Seconds"},"tts_characters":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tts Characters"},"tts_rtt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE: TCP round trip to the TTS provider endpoint.","title":"Tts Rtt Ms"},"tts_ttfb_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Tts Ttfb Ms"},"turn_index":{"title":"Turn Index","type":"integer"},"user_callback_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Time of the agent's own hook between the turn and the model call.","title":"User Callback Ms"}},"required":["turn_index","stt_ms","eou_delay_ms","llm_ttft_ms","tts_ttfb_ms","e2e_ms","interrupted"],"title":"TurnLatencyResponse","type":"object"},"LatencyBreakdownResponse":{"additionalProperties":false,"properties":{"media_rtt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE: median worker to LiveKit round trip of the call.","title":"Media Rtt Ms"},"summary":{"description":"Mean, p50 and p95 of each component over the turns of the call.","items":{"$ref":"#/components/schemas/ComponentStatsResponse"},"title":"Summary","type":"array"},"turns":{"items":{"$ref":"#/components/schemas/TurnBreakdownResponse"},"title":"Turns","type":"array"}},"required":["turns","summary","media_rtt_ms"],"title":"LatencyBreakdownResponse","type":"object"},"ComponentStatsResponse":{"additionalProperties":false,"properties":{"count":{"description":"Turns that have the component.","title":"Count","type":"integer"},"key":{"anyOf":[{"enum":["stt","endpointing","user_callback","llm_ttft","llm_first_sentence","tts_ttfb","playback","unexplained"],"type":"string"},{"const":"total","type":"string"}],"description":"A stage key, or `total`.","title":"Key"},"mean_ms":{"minimum":0,"title":"Mean Ms","type":"number"},"network_mean_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE: mean network part over the turns that have one.","title":"Network Mean Ms"},"p50_ms":{"minimum":0,"title":"P50 Ms","type":"number"},"p95_ms":{"minimum":0,"title":"P95 Ms","type":"number"}},"required":["key","count","mean_ms","p50_ms","p95_ms"],"title":"ComponentStatsResponse","type":"object"},"TurnBreakdownResponse":{"additionalProperties":false,"properties":{"interrupted":{"title":"Interrupted","type":"boolean"},"media_rtt_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Media Rtt Ms"},"overlap_ms":{"description":"How much the stages add up to more than `total_ms` because they overlapped (preemptive generation); 0 otherwise.","minimum":0,"title":"Overlap Ms","type":"number"},"segments":{"items":{"$ref":"#/components/schemas/LatencySegmentResponse"},"title":"Segments","type":"array"},"total_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"The latency the caller waited as the worker measured it (`e2e_ms`).","title":"Total Ms"},"turn_index":{"title":"Turn Index","type":"integer"}},"required":["turn_index","interrupted","total_ms","segments","overlap_ms","media_rtt_ms"],"title":"TurnBreakdownResponse","type":"object"},"LatencySegmentResponse":{"additionalProperties":false,"properties":{"basis":{"description":"`measured` by LiveKit; `derived` from measured values.","enum":["measured","derived"],"title":"Basis","type":"string"},"key":{"description":"The stage, in the order they happen: `stt`, `endpointing`, `user_callback`, `llm_ttft`, `llm_first_sentence`, `tts_ttfb`, `playback`, then `unexplained`, what no stage accounts for.","enum":["stt","endpointing","user_callback","llm_ttft","llm_first_sentence","tts_ttfb","playback","unexplained"],"title":"Key","type":"string"},"ms":{"minimum":0,"title":"Ms","type":"number"},"network_estimate_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"ESTIMATE of the part of `ms` that is one network round trip to the provider (a probe), never above `ms`. Null when not probed or the stage has no provider.","title":"Network Estimate Ms"}},"required":["key","ms","basis"],"title":"LatencySegmentResponse","type":"object"},"RecordingInfo":{"additionalProperties":false,"properties":{"bytes":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Bytes"},"duration_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"expires_at":{"format":"date-time","title":"Expires At","type":"string"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A short machine reason when `status` is `failed`.","title":"Failure Reason"},"start_offset_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Audio file start relative to call start, if known.","title":"Start Offset Ms"},"status":{"$ref":"#/components/schemas/RecordingStatus","description":"`recording` (not in the bucket yet), `ready` (it can be played) or `failed` (see `failure_reason`; the call itself was not affected)."}},"required":["status","duration_seconds","bytes","failure_reason","expires_at"],"title":"RecordingInfo","type":"object"},"RecordingStatus":{"enum":["recording","ready","failed"],"title":"RecordingStatus","type":"string"},"TimelineEntryResponse":{"additionalProperties":false,"properties":{"at":{"format":"date-time","title":"At","type":"string"},"captured":{"description":"Names of captured fields, never values.","items":{"type":"string"},"title":"Captured","type":"array"},"decision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision"},"duration_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Duration Ms"},"e2e_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"E2E Ms"},"from_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Step"},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted"},"kind":{"description":"`started`, `answered`, `amd`, `turn`, `tool`, `transfer`, `flow_transition`, `flow_decision`, `guardrail_triggered`, `speech_ignored`, `speech_background_speaker` or `ended`; other call events keep their own name.","title":"Kind","type":"string"},"latency_ms":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Latency Ms"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result"},"sequence":{"title":"Sequence","type":"integer"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step"},"to_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Step"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"turn_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Index"}},"required":["sequence","at","kind","captured"],"title":"TimelineEntryResponse","type":"object"},"TranscriptInfo":{"additionalProperties":false,"properties":{"expires_at":{"format":"date-time","title":"Expires At","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"omitted_turns":{"minimum":0,"title":"Omitted Turns","type":"integer"},"source":{"$ref":"#/components/schemas/TranscriptSource"},"truncated":{"description":"True when the call was longer than what is stored.","title":"Truncated","type":"boolean"}},"required":["source","language","truncated","omitted_turns","expires_at"],"title":"TranscriptInfo","type":"object"},"TranscriptSource":{"enum":["call","talk"],"title":"TranscriptSource","type":"string"},"TranscriptTurnResponse":{"additionalProperties":false,"properties":{"ended_at_ms":{"minimum":0,"title":"Ended At Ms","type":"integer"},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted"},"role":{"$ref":"#/components/schemas/TurnRole","description":"`assistant`, `user` (the caller) or `tool`."},"started_at_ms":{"description":"From the start of the call.","minimum":0,"title":"Started At Ms","type":"integer"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Conversation tree step, when there is one.","title":"Step"},"text":{"title":"Text","type":"string"}},"required":["role","text","started_at_ms","ended_at_ms"],"title":"TranscriptTurnResponse","type":"object"},"TurnRole":{"enum":["assistant","user","tool"],"title":"TurnRole","type":"string"},"RecordingLinkResponse":{"additionalProperties":false,"properties":{"content_type":{"description":"The media type of the audio.","title":"Content Type","type":"string"},"expires_at":{"format":"date-time","title":"Expires At","type":"string"},"url":{"description":"A presigned GET URL; never store it.","title":"Url","type":"string"}},"required":["url","expires_at","content_type"],"title":"RecordingLinkResponse","type":"object"},"CampaignStatus":{"enum":["draft","running","paused","completed","cancelled"],"title":"CampaignStatus","type":"string"},"CampaignPage":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/CampaignResponse"},"maxItems":200,"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"CampaignPage","type":"object"},"CampaignResponse":{"additionalProperties":false,"properties":{"assistant_id":{"format":"uuid","title":"Assistant Id","type":"string"},"caller_id":{"$ref":"#/components/schemas/CallerIdPolicy"},"completed_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Completed At"},"contact_import_id":{"format":"uuid","title":"Contact Import Id","type":"string"},"contacts_total":{"maximum":1000000,"minimum":0,"title":"Contacts Total","type":"integer"},"counters":{"$ref":"#/components/schemas/CampaignCounters"},"cps":{"maximum":50,"minimum":1,"title":"Cps","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"has_experiment":{"default":false,"title":"Has Experiment","type":"boolean"},"id":{"format":"uuid","title":"Id","type":"string"},"max_call_duration_seconds":{"anyOf":[{"maximum":7200,"minimum":1,"type":"integer"},{"type":"null"}],"description":"Maximum answered-call duration in seconds. Null or omitted inherits the platform CALL_MAX_DURATION (30 minutes by default). A campaign override applies to both the dialer's timer and the remote SIP duration limit.","title":"Max Call Duration Seconds"},"max_concurrency":{"maximum":200,"minimum":1,"title":"Max Concurrency","type":"integer"},"name":{"title":"Name","type":"string"},"outbound_trunk_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Outbound Trunk Id"},"priority":{"description":"1 to 10. When several campaigns of the organization run at once, the free call slots are shared in proportion to it.","maximum":10,"minimum":1,"title":"Priority","type":"integer"},"recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Audio recording of the campaign's calls: true records, false does not, null follows the assistant version's `behavior.recording.enabled`.","title":"Recording"},"retry":{"$ref":"#/components/schemas/RetryPolicy"},"schedule":{"$ref":"#/components/schemas/Schedule"},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Started At"},"status":{"$ref":"#/components/schemas/CampaignStatus"},"timezone":{"title":"Timezone","type":"string"}},"required":["id","name","assistant_id","contact_import_id","status","timezone","schedule","retry","cps","max_concurrency","priority","caller_id","recording","contacts_total","created_at","started_at","completed_at","counters"],"title":"CampaignResponse","type":"object"},"CallerIdPolicy":{"additionalProperties":false,"description":"How a campaign chooses the number it shows. `none` leaves it to the trunk. `fixed` always\nuses `caller_id_id`. `round_robin` takes the tenant's numbers in turn. `area_code` shows the\nnumber that shares the longest prefix with the one called (a Cordoba number for a Cordoba\ncontact), and rotates when none matches.","properties":{"caller_id_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Caller Id Id"},"strategy":{"$ref":"#/components/schemas/CallerIdStrategy","default":"none"}},"title":"CallerIdPolicy","type":"object"},"CallerIdStrategy":{"enum":["none","fixed","round_robin","area_code"],"title":"CallerIdStrategy","type":"string"},"CampaignCounters":{"additionalProperties":false,"properties":{"attempts_by_outcome":{"$ref":"#/components/schemas/OutcomeCounts","description":"Closed attempts by outcome. `dnc` is closed without an attempt."},"attempts_total":{"maximum":1000000,"minimum":0,"title":"Attempts Total","type":"integer"},"contacts_by_state":{"$ref":"#/components/schemas/ContactStateCounts"},"contacts_done":{"maximum":1000000,"minimum":0,"title":"Contacts Done","type":"integer"},"final_outcomes":{"$ref":"#/components/schemas/OutcomeCounts","description":"Done contacts by the outcome that closed them."},"progress":{"description":"`contacts_done` over `contacts_total`.","maximum":1,"minimum":0,"title":"Progress","type":"number"}},"required":["contacts_by_state","final_outcomes","attempts_by_outcome","attempts_total","contacts_done","progress"],"title":"CampaignCounters","type":"object"},"OutcomeCounts":{"additionalProperties":false,"properties":{"answered":{"maximum":1000000,"minimum":0,"title":"Answered","type":"integer"},"busy":{"maximum":1000000,"minimum":0,"title":"Busy","type":"integer"},"dnc":{"maximum":1000000,"minimum":0,"title":"Dnc","type":"integer"},"failed":{"maximum":1000000,"minimum":0,"title":"Failed","type":"integer"},"no_answer":{"maximum":1000000,"minimum":0,"title":"No Answer","type":"integer"},"voicemail":{"maximum":1000000,"minimum":0,"title":"Voicemail","type":"integer"}},"required":["answered","busy","no_answer","voicemail","failed","dnc"],"title":"OutcomeCounts","type":"object"},"ContactStateCounts":{"additionalProperties":false,"properties":{"done":{"maximum":1000000,"minimum":0,"title":"Done","type":"integer"},"in_progress":{"maximum":1000000,"minimum":0,"title":"In Progress","type":"integer"},"pending":{"maximum":1000000,"minimum":0,"title":"Pending","type":"integer"}},"required":["pending","in_progress","done"],"title":"ContactStateCounts","type":"object"},"RetryPolicy":{"additionalProperties":false,"properties":{"max_attempts":{"default":3,"maximum":10,"minimum":1,"title":"Max Attempts","type":"integer"},"retry_delay_minutes":{"default":60,"maximum":1440,"minimum":1,"title":"Retry Delay Minutes","type":"integer"},"retry_on":{"items":{"$ref":"#/components/schemas/RetryOutcome"},"maxItems":4,"title":"Retry On","type":"array"},"rules":{"items":{"$ref":"#/components/schemas/RetryRule"},"maxItems":4,"title":"Rules","type":"array"}},"title":"RetryPolicy","type":"object"},"RetryOutcome":{"description":"The outcomes a campaign may retry. `answered` ends a contact; `dnc` never retries.","enum":["busy","no_answer","voicemail","failed"],"title":"RetryOutcome","type":"string"},"RetryRule":{"additionalProperties":false,"description":"How one outcome is retried: wait `delay_minutes` (up to a week; 1440 is the next day),\nand give up after `max_attempts` attempts that ended this way (none: only the campaign's\n`max_attempts` limits).","properties":{"delay_minutes":{"maximum":10080,"minimum":1,"title":"Delay Minutes","type":"integer"},"max_attempts":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Max Attempts"},"outcome":{"$ref":"#/components/schemas/RetryOutcome"}},"required":["outcome","delay_minutes"],"title":"RetryRule","type":"object"},"Schedule":{"additionalProperties":false,"description":"When calls may start. The main range is `weekdays` with `window_start` to `window_end`;\n`extra_windows` add ranges on other weekdays or a second range on the same day (9 to 13 and\n15 to 20). All times are local to the contact. A day in `skip_dates`, and a national holiday\nwhen `skip_holidays` is on, has no calls. `max_attempts_per_day` caps the attempts per contact\nin a local day and `daily_call_cap` the attempts of the whole campaign in a day of its time\nzone.","properties":{"daily_call_cap":{"anyOf":[{"maximum":1000000,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Daily Call Cap"},"extra_windows":{"items":{"$ref":"#/components/schemas/Window"},"maxItems":6,"title":"Extra Windows","type":"array"},"holiday_country":{"default":"AR","pattern":"^[A-Z]{2}$","title":"Holiday Country","type":"string"},"max_attempts_per_day":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Max Attempts Per Day"},"recurrence":{"default":"once","description":"Run once or repeat weekly after the campaign is started. Weekly occurrences are due every seven calendar days from the initial start date in the campaign timezone. Calling windows still govern dialing. An occurrence uses a fresh attempt budget and retains earlier attempt history. Occurrences due while a run is active or the campaign is paused are skipped. Cancelling stops future occurrences.","enum":["once","weekly"],"title":"Recurrence","type":"string"},"skip_dates":{"items":{"format":"date","type":"string"},"maxItems":100,"title":"Skip Dates","type":"array"},"skip_holidays":{"default":false,"title":"Skip Holidays","type":"boolean"},"weekdays":{"items":{"maximum":7,"minimum":1,"type":"integer"},"maxItems":7,"minItems":1,"title":"Weekdays","type":"array"},"window_end":{"maxLength":5,"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","title":"Window End","type":"string"},"window_start":{"maxLength":5,"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","title":"Window Start","type":"string"}},"required":["weekdays","window_start","window_end"],"title":"Schedule","type":"object"},"Window":{"additionalProperties":false,"description":"An extra range: on these weekdays calls may also start from `start` to `end`.","properties":{"end":{"maxLength":5,"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","title":"End","type":"string"},"start":{"maxLength":5,"pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","title":"Start","type":"string"},"weekdays":{"items":{"maximum":7,"minimum":1,"type":"integer"},"maxItems":7,"minItems":1,"title":"Weekdays","type":"array"}},"required":["weekdays","start","end"],"title":"Window","type":"object"},"CreateCampaignRequest":{"additionalProperties":false,"properties":{"assistant_id":{"format":"uuid","title":"Assistant Id","type":"string"},"caller_id":{"$ref":"#/components/schemas/CallerIdPolicy"},"contact_import_id":{"format":"uuid","title":"Contact Import Id","type":"string"},"cps":{"default":1,"maximum":50,"minimum":1,"title":"Cps","type":"integer"},"experiment":{"anyOf":[{"$ref":"#/components/schemas/CampaignExperiment"},{"type":"null"}]},"max_call_duration_seconds":{"anyOf":[{"maximum":7200,"minimum":1,"type":"integer"},{"type":"null"}],"description":"Maximum answered-call duration in seconds. Null or omitted inherits the platform CALL_MAX_DURATION (30 minutes by default). A campaign override applies to both the dialer's timer and the remote SIP duration limit.","title":"Max Call Duration Seconds"},"max_concurrency":{"default":10,"maximum":200,"minimum":1,"title":"Max Concurrency","type":"integer"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"outbound_trunk_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Outbound Trunk Id"},"priority":{"default":5,"maximum":10,"minimum":1,"title":"Priority","type":"integer"},"recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Overrides the assistant version's `behavior.recording.enabled` for this campaign: true records the audio of its calls, false does not, null (default) follows the assistant.","title":"Recording"},"retry":{"$ref":"#/components/schemas/RetryPolicy"},"schedule":{"$ref":"#/components/schemas/Schedule"},"timezone":{"default":"America/Argentina/Buenos_Aires","maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_+-]*(/[A-Za-z0-9_+-]+){0,2}$","title":"Timezone","type":"string"}},"required":["name","assistant_id","contact_import_id","schedule"],"title":"CreateCampaignRequest","type":"object"},"CampaignExperiment":{"additionalProperties":false,"properties":{"mode":{"enum":["rules","agent"],"title":"Mode","type":"string"},"objective":{"anyOf":[{"$ref":"#/components/schemas/TrialObjective"},{"type":"null"}]},"trial_contacts":{"anyOf":[{"exclusiveMinimum":0,"maximum":1000000,"type":"integer"},{"type":"null"}],"title":"Trial Contacts"},"trial_percentage":{"anyOf":[{"exclusiveMinimum":0,"maximum":100,"type":"integer"},{"type":"null"}],"title":"Trial Percentage"},"variants":{"items":{"$ref":"#/components/schemas/TrialVariant"},"maxItems":5,"minItems":2,"title":"Variants","type":"array"}},"required":["variants","mode"],"title":"CampaignExperiment","type":"object"},"TrialObjective":{"additionalProperties":false,"properties":{"expected_value":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"maxLength":500,"type":"string"}],"title":"Expected Value"},"field":{"maxLength":200,"minLength":1,"title":"Field","type":"string"}},"required":["field","expected_value"],"title":"TrialObjective","type":"object"},"TrialVariant":{"additionalProperties":false,"properties":{"version_id":{"format":"uuid","title":"Version Id","type":"string"},"weight":{"exclusiveMinimum":0,"maximum":1000000,"title":"Weight","type":"integer"}},"required":["version_id","weight"],"title":"TrialVariant","type":"object"},"AttemptPage":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/AttemptResponse"},"maxItems":200,"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"AttemptPage","type":"object"},"AttemptResponse":{"additionalProperties":false,"properties":{"assistant_version":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Assistant Version"},"assistant_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Version Id"},"attempt_number":{"maximum":10,"minimum":1,"title":"Attempt Number","type":"integer"},"contact_id":{"format":"uuid","title":"Contact Id","type":"string"},"dispatch_sequence":{"description":"Dispatch order for this contact, including released leases.","minimum":1,"title":"Dispatch Sequence","type":"integer"},"duration_seconds":{"anyOf":[{"maximum":7200,"minimum":0,"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"ended_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Ended At"},"failure_kind":{"anyOf":[{"$ref":"#/components/schemas/FailureKind"},{"type":"null"}]},"id":{"format":"uuid","title":"Id","type":"string"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/Outcome"},{"type":"null"}]},"phone_last4":{"description":"Last four digits of the number: the phone is personal data.","pattern":"^[0-9]{4}$","title":"Phone Last4","type":"string"},"started_at":{"format":"date-time","title":"Started At","type":"string"},"status":{"$ref":"#/components/schemas/AttemptStatus"}},"required":["id","contact_id","phone_last4","attempt_number","dispatch_sequence","status","outcome","duration_seconds","started_at","ended_at"],"title":"AttemptResponse","type":"object"},"FailureKind":{"enum":["transient","permanent"],"title":"FailureKind","type":"string"},"AttemptStatus":{"enum":["in_progress","completed","released"],"title":"AttemptStatus","type":"string"},"CampaignTrialResponse":{"additionalProperties":false,"properties":{"mode":{"enum":["rules","agent"],"title":"Mode","type":"string"},"objective_field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective Field"},"phase":{"enum":["trial","evaluating","winner","cancelled"],"title":"Phase","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"variants":{"items":{"$ref":"#/components/schemas/CampaignTrialVariant"},"title":"Variants","type":"array"},"winner_version_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Winner Version Id"}},"required":["phase","mode","objective_field","winner_version_id","reason","variants"],"title":"CampaignTrialResponse","type":"object"},"CampaignTrialVariant":{"additionalProperties":false,"properties":{"assigned":{"title":"Assigned","type":"integer"},"completed":{"title":"Completed","type":"integer"},"duration_count":{"title":"Duration Count","type":"integer"},"mean_conversation_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Conversation Seconds"},"objective_observed":{"title":"Objective Observed","type":"integer"},"objective_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Objective Rate"},"outcomes":{"additionalProperties":{"type":"integer"},"propertyNames":{"$ref":"#/components/schemas/Outcome"},"title":"Outcomes","type":"object"},"response_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Response Rate"},"responses":{"title":"Responses","type":"integer"},"successes":{"title":"Successes","type":"integer"},"version":{"title":"Version","type":"integer"},"version_id":{"format":"uuid","title":"Version Id","type":"string"}},"required":["version_id","version","assigned","completed","successes","objective_observed","objective_rate","responses","response_rate","duration_count","mean_conversation_seconds","outcomes"],"title":"CampaignTrialVariant","type":"object"},"OptimizerResponse":{"additionalProperties":false,"properties":{"available":{"description":"False when the platform has the optimizer off: it cannot be turned on.","title":"Available","type":"boolean"},"cadence_minutes":{"title":"Cadence Minutes","type":"integer"},"campaign_id":{"format":"uuid","title":"Campaign Id","type":"string"},"enabled":{"title":"Enabled","type":"boolean"},"guardrails":{"$ref":"#/components/schemas/Guardrails"},"last_run_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Last Run At"},"mode":{"$ref":"#/components/schemas/OptimizerMode"},"next_run_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Next Run At"},"updated_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Updated At"}},"required":["campaign_id","available","enabled","mode","cadence_minutes","guardrails","next_run_at","last_run_at","updated_at"],"title":"OptimizerResponse","type":"object"},"Guardrails":{"additionalProperties":false,"description":"What the agent may do in `auto` mode, and what a proposal must respect in any mode.\n\n`max_variants` caps the arms of an experiment it starts; every arm gets at least\n`min_variant_weight` percent and the challengers (every arm but the first, the control) at most\n`max_challenger_weight` percent together. A version is promoted only when each arm has\n`min_calls_per_variant` calls and the z-test of the experiments says the winner is\nsignificantly better than the control (or, to keep the control, no challenger is). At most\n`max_actions_per_run` actions per run, only the `allowed_actions`; in auto mode it only stops\nor promotes experiments it started itself.","properties":{"allowed_actions":{"items":{"$ref":"#/components/schemas/ExperimentAction"},"maxItems":3,"title":"Allowed Actions","type":"array"},"max_actions_per_run":{"default":1,"maximum":3,"minimum":1,"title":"Max Actions Per Run","type":"integer"},"max_challenger_weight":{"default":50,"maximum":99,"minimum":1,"title":"Max Challenger Weight","type":"integer"},"max_variants":{"default":2,"maximum":5,"minimum":2,"title":"Max Variants","type":"integer"},"min_calls_per_variant":{"default":30,"maximum":100000,"minimum":30,"title":"Min Calls Per Variant","type":"integer"},"min_variant_weight":{"default":10,"maximum":50,"minimum":1,"title":"Min Variant Weight","type":"integer"}},"title":"Guardrails","type":"object"},"ExperimentAction":{"description":"The actions that change something: the ones a guardrail can allow, and a person approves.","enum":["start_experiment","stop_experiment","promote_version"],"title":"ExperimentAction","type":"string"},"OptimizerMode":{"enum":["propose","auto"],"title":"OptimizerMode","type":"string"},"UpdateOptimizerRequest":{"additionalProperties":false,"properties":{"cadence_minutes":{"anyOf":[{"maximum":10080,"minimum":15,"type":"integer"},{"type":"null"}],"description":"Minutes between two runs; null is the platform's default. The platform may ask for more than the minimum here (422 when below it).","title":"Cadence Minutes"},"enabled":{"description":"Turn the campaign's optimizer on or off.","title":"Enabled","type":"boolean"},"guardrails":{"$ref":"#/components/schemas/Guardrails"},"mode":{"$ref":"#/components/schemas/OptimizerMode","default":"propose","description":"`propose`: every action is a proposal a person approves. `auto`: the optimizer applies it at once, within `guardrails`."}},"required":["enabled"],"title":"UpdateOptimizerRequest","type":"object"},"ProposalStatus":{"enum":["pending","applied","rejected","failed","superseded","noted"],"title":"ProposalStatus","type":"string"},"ProposalList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/ProposalResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"ProposalList","type":"object"},"ProposalResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"decided_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Decided At"},"decided_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decided By"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"experiment_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Experiment Id"},"experiment_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Experiment Name"},"id":{"format":"uuid","title":"Id","type":"string"},"kind":{"$ref":"#/components/schemas/ActionKind","description":"`start_experiment`, `stop_experiment` and `promote_version` change the assistant's experiments; `keep_measuring` and `strategy_note` are written down only (a strategy note is a change of the campaign's settings for a person to make)."},"knob":{"anyOf":[{"$ref":"#/components/schemas/StrategyKnob"},{"type":"null"}]},"rationale":{"title":"Rationale","type":"string"},"run_id":{"format":"uuid","title":"Run Id","type":"string"},"status":{"$ref":"#/components/schemas/ProposalStatus","description":"`pending` waits for a person; `applied`, `rejected`, `failed` (see `error`), `superseded` by a later proposal, or `noted`."},"suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggestion"},"variants":{"items":{"$ref":"#/components/schemas/OptimizerVariant"},"title":"Variants","type":"array"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},"required":["id","run_id","kind","status","rationale","created_at","experiment_id","experiment_name","variants","version","knob","suggestion","decided_at","decided_by","error"],"title":"ProposalResponse","type":"object"},"ActionKind":{"enum":["start_experiment","stop_experiment","promote_version","keep_measuring","strategy_note"],"title":"ActionKind","type":"string"},"StrategyKnob":{"description":"What a strategy note may be about: the campaign settings a person can change.","enum":["call_window","retry_delay","max_attempts","max_attempts_per_day","daily_call_cap","pacing"],"title":"StrategyKnob","type":"string"},"OptimizerVariant":{"additionalProperties":false,"properties":{"version":{"minimum":1,"title":"Version","type":"integer"},"weight":{"maximum":100,"minimum":1,"title":"Weight","type":"integer"}},"required":["version","weight"],"title":"OptimizerVariant","type":"object"},"OptimizerRunList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/OptimizerRunResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"OptimizerRunList","type":"object"},"OptimizerRunResponse":{"additionalProperties":false,"properties":{"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why a run failed: `not_configured` (no model key), `organization_suspended`, `provider_error`, `too_many_steps` or `agent_error`.","title":"Error"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Finished At"},"id":{"format":"uuid","title":"Id","type":"string"},"input_tokens":{"title":"Input Tokens","type":"integer"},"mode":{"$ref":"#/components/schemas/OptimizerMode"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"model_calls":{"title":"Model Calls","type":"integer"},"output_tokens":{"title":"Output Tokens","type":"integer"},"started_at":{"format":"date-time","title":"Started At","type":"string"},"status":{"$ref":"#/components/schemas/control_plane__core__optimizer__RunStatus"}},"required":["id","mode","status","started_at","finished_at","model","model_calls","input_tokens","output_tokens","error"],"title":"OptimizerRunResponse","type":"object"},"control_plane__core__optimizer__RunStatus":{"enum":["running","succeeded","failed"],"title":"RunStatus","type":"string"},"OptimizerRunDetail":{"additionalProperties":false,"properties":{"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why a run failed: `not_configured` (no model key), `organization_suspended`, `provider_error`, `too_many_steps` or `agent_error`.","title":"Error"},"finished_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Finished At"},"id":{"format":"uuid","title":"Id","type":"string"},"input_tokens":{"title":"Input Tokens","type":"integer"},"mode":{"$ref":"#/components/schemas/OptimizerMode"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"model_calls":{"title":"Model Calls","type":"integer"},"output_tokens":{"title":"Output Tokens","type":"integer"},"proposals":{"items":{"$ref":"#/components/schemas/ProposalResponse"},"title":"Proposals","type":"array"},"report":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The run's report, Markdown, in Spanish.","title":"Report"},"started_at":{"format":"date-time","title":"Started At","type":"string"},"status":{"$ref":"#/components/schemas/control_plane__core__optimizer__RunStatus"}},"required":["id","mode","status","started_at","finished_at","model","model_calls","input_tokens","output_tokens","error","report","proposals"],"title":"OptimizerRunDetail","type":"object"},"UpdateCampaignTrunkRequest":{"additionalProperties":false,"properties":{"outbound_trunk_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Outbound Trunk Id"}},"required":["outbound_trunk_id"],"title":"UpdateCampaignTrunkRequest","type":"object"},"CapabilitiesResponse":{"additionalProperties":false,"properties":{"answering_machine_detection":{"$ref":"#/components/schemas/AnsweringMachineDetectionCapability","default":{"available":false}},"assistant_builder":{"$ref":"#/components/schemas/BuilderCapability"}},"required":["assistant_builder"],"title":"CapabilitiesResponse","type":"object"},"AnsweringMachineDetectionCapability":{"additionalProperties":false,"properties":{"available":{"title":"Available","type":"boolean"}},"required":["available"],"title":"AnsweringMachineDetectionCapability","type":"object"},"BuilderCapability":{"additionalProperties":false,"properties":{"available":{"title":"Available","type":"boolean"}},"required":["available"],"title":"BuilderCapability","type":"object"},"CreateContactImportRequest":{"additionalProperties":false,"properties":{"column_mapping":{"$ref":"#/components/schemas/ColumnMapping"},"filename":{"maxLength":255,"minLength":1,"title":"Filename","type":"string"},"format":{"$ref":"#/components/schemas/ContactFormat"},"size_bytes":{"maximum":52428800,"minimum":1,"title":"Size Bytes","type":"integer"}},"required":["filename","format","size_bytes","column_mapping"],"title":"CreateContactImportRequest","type":"object"},"ColumnMapping":{"additionalProperties":false,"description":"Which column of the file holds what. `phone` and the variable columns are header names.","properties":{"phone":{"maxLength":200,"minLength":1,"title":"Phone","type":"string"},"types":{"description":"The type of a mapped variable; a variable not listed is `text`. `money_ars` and `money_usd` accept `20500`, `20.500,50`, `$ 20.500` or `20500.50`; `date` accepts `2026-11-10` or `10/11/2026` (day first).","maxProperties":50,"patternProperties":{"^[a-z][a-z0-9_]*$":{"$ref":"#/components/schemas/VariableType"}},"propertyNames":{"maxLength":64},"title":"Types","type":"object"},"variables":{"maxProperties":50,"patternProperties":{"^[a-z][a-z0-9_]*$":{"maxLength":200,"minLength":1,"type":"string"}},"propertyNames":{"maxLength":64},"title":"Variables","type":"object"}},"required":["phone"],"title":"ColumnMapping","type":"object"},"VariableType":{"description":"How a mapped column is read. `text` goes to the call as written; an amount or a date is\nparsed at import (a row whose value does not parse is rejected as `invalid_variable`), stored\nnormalized (`20500.50`, `2026-11-10`) and sent to the call typed, so the assistant says it in\nwords.","enum":["text","money_ars","money_usd","date"],"title":"VariableType","type":"string"},"ContactFormat":{"enum":["csv","xlsx"],"title":"ContactFormat","type":"string"},"ContactImportCreatedResponse":{"additionalProperties":false,"properties":{"id":{"format":"uuid","title":"Id","type":"string"},"status":{"$ref":"#/components/schemas/ContactImportStatus"},"upload_expires_at":{"format":"date-time","title":"Upload Expires At","type":"string"},"upload_url":{"maxLength":2048,"title":"Upload Url","type":"string"}},"required":["id","status","upload_url","upload_expires_at"],"title":"ContactImportCreatedResponse","type":"object"},"ContactImportStatus":{"enum":["awaiting_upload","processing","completed","failed"],"title":"ContactImportStatus","type":"string"},"ContactImportResponse":{"additionalProperties":false,"properties":{"accepted":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"title":"Accepted"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"failure":{"anyOf":[{"$ref":"#/components/schemas/ContactImportFailure"},{"type":"null"}]},"filename":{"title":"Filename","type":"string"},"format":{"$ref":"#/components/schemas/ContactFormat"},"id":{"format":"uuid","title":"Id","type":"string"},"rejected":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"title":"Rejected"},"rejected_by_reason":{"anyOf":[{"$ref":"#/components/schemas/RejectionCounts"},{"type":"null"}]},"size_bytes":{"title":"Size Bytes","type":"integer"},"status":{"$ref":"#/components/schemas/ContactImportStatus"},"total_rows":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"title":"Total Rows"}},"required":["id","status","filename","format","size_bytes","created_at","total_rows","accepted","rejected","rejected_by_reason","failure"],"title":"ContactImportResponse","type":"object"},"ContactImportFailure":{"description":"Why a whole import failed. A bad row is never a failure, it is a rejected row.","enum":["unreadable_file","too_many_rows","mapping_mismatch","internal_error"],"title":"ContactImportFailure","type":"string"},"RejectionCounts":{"additionalProperties":false,"description":"Rejected rows by reason. The reasons are the closed set of `reason_code` in the report.","properties":{"do_not_call":{"default":0,"maximum":1000000,"minimum":0,"title":"Do Not Call","type":"integer"},"duplicate_existing":{"default":0,"description":"No longer emitted: each import keeps its own contacts, so a number from an earlier import is not a duplicate. Kept so the closed set does not change.","maximum":1000000,"minimum":0,"title":"Duplicate Existing","type":"integer"},"duplicate_in_file":{"default":0,"maximum":1000000,"minimum":0,"title":"Duplicate In File","type":"integer"},"invalid_phone":{"default":0,"maximum":1000000,"minimum":0,"title":"Invalid Phone","type":"integer"},"invalid_variable":{"default":0,"maximum":1000000,"minimum":0,"title":"Invalid Variable","type":"integer"},"missing_phone":{"default":0,"maximum":1000000,"minimum":0,"title":"Missing Phone","type":"integer"},"missing_variable":{"default":0,"maximum":1000000,"minimum":0,"title":"Missing Variable","type":"integer"},"not_ar_number":{"default":0,"maximum":1000000,"minimum":0,"title":"Not Ar Number","type":"integer"}},"title":"RejectionCounts","type":"object"},"RejectedRowsResponse":{"additionalProperties":false,"properties":{"download_expires_at":{"format":"date-time","title":"Download Expires At","type":"string"},"download_url":{"maxLength":2048,"title":"Download Url","type":"string"}},"required":["download_url","download_expires_at"],"title":"RejectedRowsResponse","type":"object"},"CreditResponse":{"additionalProperties":false,"properties":{"available":{"description":"`balance + credit_limit - reserved`, in signed USD micros.","title":"Available","type":"integer"},"balance":{"description":"Signed integer USD micros (1 USD = 1,000,000).","title":"Balance","type":"integer"},"credit_limit":{"description":"USD micros the balance may go below zero: 0 when prepaid.","minimum":0,"title":"Credit Limit","type":"integer"},"low_balance":{"description":"True when `available` is below the low-balance threshold.","title":"Low Balance","type":"boolean"},"low_balance_threshold":{"description":"USD micros below which `available` counts as low.","minimum":0,"title":"Low Balance Threshold","type":"integer"},"mode":{"$ref":"#/components/schemas/CreditMode","description":"Whether credit gates calls: `off`, `shadow` or `enforce`."},"reserved":{"description":"USD micros held by calls in progress.","minimum":0,"title":"Reserved","type":"integer"}},"required":["balance","credit_limit","reserved","available","mode","low_balance","low_balance_threshold"],"title":"CreditResponse","type":"object"},"CreditMode":{"description":"How strictly credit gates calls: `off` never, `shadow` records what it would deny,\n`enforce` denies.","enum":["off","shadow","enforce"],"title":"CreditMode","type":"string"},"LedgerResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/LedgerEntryResponse"},"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for older entries.","title":"Next Cursor"}},"required":["items","next_cursor"],"title":"LedgerResponse","type":"object"},"LedgerEntryResponse":{"additionalProperties":false,"properties":{"actor":{"description":"Who or what posted it.","title":"Actor","type":"string"},"amount_micros":{"description":"Signed integer USD micros (1 USD = 1,000,000).","title":"Amount Micros","type":"integer"},"balance_after_micros":{"description":"Signed integer USD micros (1 USD = 1,000,000).","title":"Balance After Micros","type":"integer"},"call_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The call, for call charges.","title":"Call Id"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"kind":{"$ref":"#/components/schemas/LedgerKind","description":"What moved the balance."},"reference":{"description":"Opaque idempotency reference.","title":"Reference","type":"string"}},"required":["id","kind","amount_micros","balance_after_micros","reference","actor","created_at"],"title":"LedgerEntryResponse","type":"object"},"LedgerKind":{"enum":["grant","limit_change","charge","adjustment","provisional_charge","reconciliation"],"title":"LedgerKind","type":"string"},"DialerSettingsResponse":{"additionalProperties":false,"properties":{"max_concurrency":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"description":"Calls open at once across every running campaign of the organization; `null` means only each campaign's own limit applies.","title":"Max Concurrency"}},"required":["max_concurrency"],"title":"DialerSettingsResponse","type":"object"},"DialerSettingsRequest":{"additionalProperties":false,"properties":{"max_concurrency":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Max Concurrency"}},"title":"DialerSettingsRequest","type":"object"},"DoNotCallPage":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/DoNotCallEntry"},"maxItems":500,"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"DoNotCallPage","type":"object"},"DoNotCallEntry":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"phone_e164":{"maxLength":16,"pattern":"^\\+[1-9][0-9]{6,14}$","title":"Phone E164","type":"string"}},"required":["phone_e164","created_at"],"title":"DoNotCallEntry","type":"object"},"DoNotCallRequest":{"additionalProperties":false,"properties":{"phone_e164":{"maxLength":16,"pattern":"^\\+[1-9][0-9]{6,14}$","title":"Phone E164","type":"string"}},"required":["phone_e164"],"title":"DoNotCallRequest","type":"object"},"HealthResponse":{"additionalProperties":false,"properties":{"status":{"const":"ok","title":"Status","type":"string"}},"required":["status"],"title":"HealthResponse","type":"object"},"InviteMemberRequest":{"additionalProperties":false,"properties":{"email":{"maxLength":254,"pattern":"^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$","title":"Email","type":"string"},"role":{"$ref":"#/components/schemas/Role"}},"required":["email","role"],"title":"InviteMemberRequest","type":"object"},"Role":{"enum":["owner","admin","editor","viewer"],"title":"Role","type":"string"},"InvitationResponse":{"additionalProperties":false,"properties":{"email":{"title":"Email","type":"string"},"role":{"$ref":"#/components/schemas/Role"}},"required":["email","role"],"title":"InvitationResponse","type":"object"},"KnowledgeBaseListResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/KnowledgeBaseResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"KnowledgeBaseListResponse","type":"object"},"KnowledgeBaseResponse":{"additionalProperties":false,"properties":{"chunk_count":{"title":"Chunk Count","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"document_count":{"title":"Document Count","type":"integer"},"embedding_model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null until the first document is indexed.","title":"Embedding Model"},"id":{"format":"uuid","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"reindexing":{"description":"A reindex of the whole base is queued or running.","title":"Reindexing","type":"boolean"},"search_settings":{"$ref":"#/components/schemas/SearchSettingsResponse"},"status":{"$ref":"#/components/schemas/KnowledgeStatus"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","description","status","document_count","chunk_count","embedding_model","created_at","updated_at","search_settings","reindexing"],"title":"KnowledgeBaseResponse","type":"object"},"SearchSettingsResponse":{"additionalProperties":false,"properties":{"hybrid":{"description":"Dense plus BM25, fused with RRF.","title":"Hybrid","type":"boolean"},"rerank":{"description":"Re-score the best candidates with a cross-encoder (slower).","title":"Rerank","type":"boolean"},"score_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Minimum cosine similarity of the dense retriever; null: none.","title":"Score Threshold"},"top_k":{"title":"Top K","type":"integer"}},"required":["top_k","score_threshold","hybrid","rerank"],"title":"SearchSettingsResponse","type":"object"},"KnowledgeStatus":{"description":"Of a whole base: `empty` has no documents, `processing` has one that is not done yet,\n`ready` has at least one searchable document, `failed` has only failed ones.","enum":["empty","processing","ready","failed"],"title":"KnowledgeStatus","type":"string"},"CreateKnowledgeBaseRequest":{"additionalProperties":false,"properties":{"description":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Description"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"CreateKnowledgeBaseRequest","type":"object"},"UpdateKnowledgeBaseRequest":{"additionalProperties":false,"properties":{"description":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Description"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"UpdateKnowledgeBaseRequest","type":"object"},"DocumentListResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"DocumentListResponse","type":"object"},"DocumentResponse":{"additionalProperties":false,"properties":{"chunk_count":{"title":"Chunk Count","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"duplicate_of":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"Another document of the base has the same content: this one is `ready` with no chunks of its own.","title":"Duplicate Of"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why a `failed` document failed: `unreadable_file`, `empty_document`, `too_many_pages`, `embedding_model_changed`, `no_text_layer` (a scanned file and OCR is off), `unreadable_file`, `internal_error`.","title":"Error Code"},"filename":{"title":"Filename","type":"string"},"format":{"$ref":"#/components/schemas/DocumentFormat"},"id":{"format":"uuid","title":"Id","type":"string"},"knowledge_base_id":{"format":"uuid","title":"Knowledge Base Id","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`es`, `en` or `pt` when recognised.","title":"Language"},"last_synced_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Last Synced At"},"ocr_used":{"title":"Ocr Used","type":"boolean"},"processed_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Processed At"},"size_bytes":{"title":"Size Bytes","type":"integer"},"source_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Source Id"},"source_type":{"description":"`file` or `url` (a page of a source).","title":"Source Type","type":"string"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"tags":{"items":{"type":"string"},"title":"Tags","type":"array"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"token_count":{"description":"Approximate tokens of the indexed text.","title":"Token Count","type":"integer"}},"required":["id","knowledge_base_id","filename","format","size_bytes","status","error_code","chunk_count","created_at","processed_at","source_type","source_id","source_url","title","tags","language","token_count","ocr_used","duplicate_of","last_synced_at"],"title":"DocumentResponse","type":"object"},"DocumentFormat":{"enum":["pdf","docx","txt","md","csv","html"],"title":"DocumentFormat","type":"string"},"DocumentStatus":{"enum":["awaiting_upload","uploaded","processing","ready","failed"],"title":"DocumentStatus","type":"string"},"CreateDocumentRequest":{"additionalProperties":false,"properties":{"filename":{"description":"A label; its extension picks the format (pdf, docx, txt, md, csv, html).","maxLength":255,"minLength":1,"title":"Filename","type":"string"},"size_bytes":{"maximum":26214400,"minimum":1,"title":"Size Bytes","type":"integer"}},"required":["filename","size_bytes"],"title":"CreateDocumentRequest","type":"object"},"DocumentCreatedResponse":{"additionalProperties":false,"properties":{"document":{"$ref":"#/components/schemas/DocumentResponse"},"upload_expires_at":{"format":"date-time","title":"Upload Expires At","type":"string"},"upload_url":{"maxLength":2048,"title":"Upload Url","type":"string"}},"required":["document","upload_url","upload_expires_at"],"title":"DocumentCreatedResponse","type":"object"},"ReplaceDocumentRequest":{"additionalProperties":false,"properties":{"filename":{"description":"A label; its extension picks the format (pdf, docx, txt, md, csv, html).","maxLength":255,"minLength":1,"title":"Filename","type":"string"},"size_bytes":{"maximum":26214400,"minimum":1,"title":"Size Bytes","type":"integer"}},"required":["filename","size_bytes"],"title":"ReplaceDocumentRequest","type":"object"},"UpdateDocumentTagsRequest":{"additionalProperties":false,"properties":{"tags":{"description":"Lower case labels without `:` or `,`; repeated ones are kept once. Used to filter a search to some documents.","items":{"maxLength":40,"minLength":1,"type":"string"},"maxItems":20,"title":"Tags","type":"array"}},"required":["tags"],"title":"UpdateDocumentTagsRequest","type":"object"},"SearchKnowledgeRequest":{"additionalProperties":false,"properties":{"hybrid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Omitted: the base's `hybrid` setting.","title":"Hybrid"},"query":{"maxLength":500,"minLength":1,"title":"Query","type":"string"},"rerank":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Omitted: the base's `rerank` setting.","title":"Rerank"},"score_threshold":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"description":"Omitted: the base's `score_threshold` setting.","title":"Score Threshold"},"tags":{"anyOf":[{"description":"Lower case labels without `:` or `,`; repeated ones are kept once. Used to filter a search to some documents.","items":{"maxLength":40,"minLength":1,"type":"string"},"maxItems":20,"type":"array"},{"type":"null"}],"description":"Only documents with at least one of these tags. Omitted: all.","title":"Tags"},"top_k":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"description":"1 to 10. Omitted: the base setting (default 4).","title":"Top K"}},"required":["query"],"title":"SearchKnowledgeRequest","type":"object"},"SearchResponse":{"additionalProperties":false,"properties":{"hits":{"items":{"$ref":"#/components/schemas/SearchHitResponse"},"title":"Hits","type":"array"},"mode":{"description":"How the search ran: `dense`, `hybrid`, `dense+rerank` or `hybrid+rerank`; `empty` when nothing is indexed and `filtered` when no document has the tags.","title":"Mode","type":"string"}},"required":["hits","mode"],"title":"SearchResponse","type":"object"},"SearchHitResponse":{"additionalProperties":false,"properties":{"document_id":{"format":"uuid","title":"Document Id","type":"string"},"document_name":{"title":"Document Name","type":"string"},"heading":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heading"},"matched_by":{"description":"Retrievers that found it: `dense`, `bm25`.","items":{"type":"string"},"title":"Matched By","type":"array"},"position":{"description":"Order of the chunk in its document, from 0.","title":"Position","type":"integer"},"score":{"description":"Cosine similarity for a dense search, the fused RRF score for a hybrid one and the cross-encoder score after a rerank. Higher is better; compare only within one response.","title":"Score","type":"number"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The page, for a document of a URL source.","title":"Source Url"},"text":{"title":"Text","type":"string"}},"required":["text","score","document_id","document_name","position","heading","source_url","matched_by"],"title":"SearchHitResponse","type":"object"},"UpdateSearchSettingsRequest":{"additionalProperties":false,"description":"Only the fields sent change; `score_threshold` null removes the threshold.","properties":{"hybrid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hybrid"},"rerank":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rerank"},"score_threshold":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"title":"Score Threshold"},"top_k":{"anyOf":[{"maximum":10,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Top K"}},"title":"UpdateSearchSettingsRequest","type":"object"},"SourceListResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/SourceResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"SourceListResponse","type":"object"},"SourceResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"document_count":{"title":"Document Count","type":"integer"},"heartbeat_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Last time the sync reported it was alive; null before it starts.","title":"Heartbeat At"},"id":{"format":"uuid","title":"Id","type":"string"},"kind":{"$ref":"#/components/schemas/SourceKind"},"knowledge_base_id":{"format":"uuid","title":"Knowledge Base Id","type":"string"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the last run failed: `fetch_failed`, `blocked_address`, `robots_disallowed`, `no_pages`, `dns_failure`, `tls_error`, `timed_out`, `sync_lost` or `internal_error`.","title":"Last Error"},"last_run_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Last Run At"},"last_run_status":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`ok`, `partial` or `failed`.","title":"Last Run Status"},"max_depth":{"title":"Max Depth","type":"integer"},"max_pages":{"title":"Max Pages","type":"integer"},"next_sync_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Next Sync At"},"pages_added":{"title":"Pages Added","type":"integer"},"pages_changed":{"title":"Pages Changed","type":"integer"},"pages_failed":{"title":"Pages Failed","type":"integer"},"pages_removed":{"title":"Pages Removed","type":"integer"},"pages_skipped":{"description":"Pages refused by robots.txt or equal to another document.","title":"Pages Skipped","type":"integer"},"pages_unchanged":{"title":"Pages Unchanged","type":"integer"},"progress":{"$ref":"#/components/schemas/SourceProgressResponse","description":"Counters of the open sync, or of the last one when none is open."},"refresh_interval":{"$ref":"#/components/schemas/RefreshInterval"},"same_domain":{"title":"Same Domain","type":"boolean"},"stalled":{"description":"True when a sync is open (`queued` or `running`) but has shown no sign of life for five minutes. `POST .../sync` then replaces it.","title":"Stalled","type":"boolean"},"status":{"$ref":"#/components/schemas/SourceStatus","description":"`queued` or `running` while a sync is open."},"url":{"title":"Url","type":"string"}},"required":["id","knowledge_base_id","kind","url","max_depth","max_pages","same_domain","refresh_interval","next_sync_at","status","last_run_at","last_run_status","last_error","pages_added","pages_changed","pages_removed","pages_unchanged","pages_skipped","pages_failed","document_count","created_at","progress","heartbeat_at","stalled"],"title":"SourceResponse","type":"object"},"SourceKind":{"enum":["url","sitemap","crawl"],"title":"SourceKind","type":"string"},"SourceProgressResponse":{"additionalProperties":false,"properties":{"failed":{"description":"URLs that could not be read, were refused or had no content.","title":"Failed","type":"integer"},"fetched":{"description":"Pages fetched with readable main content.","title":"Fetched","type":"integer"},"found":{"description":"URLs discovered so far (visited or queued).","title":"Found","type":"integer"},"indexed":{"description":"Documents of the source that are searchable.","title":"Indexed","type":"integer"}},"required":["found","fetched","indexed","failed"],"title":"SourceProgressResponse","type":"object"},"RefreshInterval":{"enum":["off","daily","weekly"],"title":"RefreshInterval","type":"string"},"SourceStatus":{"description":"`queued` and `running` have a sync job open; `idle` is waiting for the next one.","enum":["queued","running","idle"],"title":"SourceStatus","type":"string"},"CreateSourceRequest":{"additionalProperties":false,"properties":{"kind":{"$ref":"#/components/schemas/SourceKind","description":"`url`: one page. `sitemap`: the pages a sitemap lists (`url` is the sitemap). `crawl`: the pages reached by following links from `url`."},"max_depth":{"default":2,"description":"Links to follow from the start page.","maximum":5,"minimum":0,"title":"Max Depth","type":"integer"},"max_pages":{"default":50,"maximum":500,"minimum":1,"title":"Max Pages","type":"integer"},"refresh_interval":{"$ref":"#/components/schemas/RefreshInterval","default":"off"},"same_domain":{"default":true,"description":"A crawl or sitemap stays on the host of `url`.","title":"Same Domain","type":"boolean"},"url":{"maxLength":2048,"minLength":1,"title":"Url","type":"string"}},"required":["kind","url"],"title":"CreateSourceRequest","type":"object"},"UpdateSourceRequest":{"additionalProperties":false,"properties":{"refresh_interval":{"$ref":"#/components/schemas/RefreshInterval"}},"required":["refresh_interval"],"title":"UpdateSourceRequest","type":"object"},"SourceEventListResponse":{"additionalProperties":false,"properties":{"items":{"description":"The last 50 events, newest first.","items":{"$ref":"#/components/schemas/SourceEventResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"SourceEventListResponse","type":"object"},"SourceEventResponse":{"additionalProperties":false,"properties":{"code":{"description":"What happened, for example `sync_started`, `pages_fetched`, `dns_failure`, `tls_error`, `timeout`, `http_error`, `robots_disallowed`, `blocked_address`, `no_pages`, `timed_out`, `sync_lost`, `sync_finished`.","maxLength":64,"title":"Code","type":"string"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"How many pages the event is about.","title":"Count"},"detail":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"description":"A host name or a short reason such as `http_403`; never page contents.","title":"Detail"},"id":{"title":"Id","type":"integer"},"level":{"description":"Severity.","enum":["info","warn","error"],"title":"Level","type":"string"},"occurred_at":{"format":"date-time","title":"Occurred At","type":"string"}},"required":["id","occurred_at","level","code","detail","count"],"title":"SourceEventResponse","type":"object"},"McpServerList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/McpServerResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"McpServerList","type":"object"},"McpServerResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"title":"Created By","type":"string"},"description":{"title":"Description","type":"string"},"discovered_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Discovered At"},"headers":{"items":{"$ref":"#/components/schemas/McpHeaderResponse"},"title":"Headers","type":"array"},"id":{"format":"uuid","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"slug":{"title":"Slug","type":"string"},"snapshot_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Hash"},"tools":{"items":{"$ref":"#/components/schemas/McpToolResponse"},"title":"Tools","type":"array"},"transport":{"$ref":"#/components/schemas/McpTransport"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"url":{"title":"Url","type":"string"}},"required":["id","name","slug","description","url","transport","headers","tools","snapshot_hash","discovered_at","created_by","created_at","updated_at"],"title":"McpServerResponse","type":"object"},"McpHeaderResponse":{"additionalProperties":false,"properties":{"name":{"title":"Name","type":"string"},"value_mask":{"title":"Value Mask","type":"string"}},"required":["name","value_mask"],"title":"McpHeaderResponse","type":"object"},"McpToolResponse":{"additionalProperties":false,"properties":{"allowed":{"title":"Allowed","type":"boolean"},"description":{"title":"Description","type":"string"},"input_schema":{"additionalProperties":true,"title":"Input Schema","type":"object"},"name":{"title":"Name","type":"string"},"requires_confirmation":{"title":"Requires Confirmation","type":"boolean"}},"required":["name","description","input_schema","allowed","requires_confirmation"],"title":"McpToolResponse","type":"object"},"McpTransport":{"enum":["streamable_http"],"title":"McpTransport","type":"string"},"McpServerRequest":{"additionalProperties":false,"properties":{"description":{"default":"","maxLength":1000,"title":"Description","type":"string"},"headers":{"default":[],"items":{"$ref":"#/components/schemas/McpHeaderInput"},"maxItems":20,"title":"Headers","type":"array"},"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"},"transport":{"$ref":"#/components/schemas/McpTransport","default":"streamable_http"},"url":{"maxLength":2048,"minLength":9,"title":"Url","type":"string"}},"required":["name","url"],"title":"McpServerRequest","type":"object"},"McpHeaderInput":{"additionalProperties":false,"properties":{"name":{"maxLength":64,"minLength":1,"title":"Name","type":"string"},"value":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"title":"Value"}},"required":["name"],"title":"McpHeaderInput","type":"object"},"McpAllowlistRequest":{"additionalProperties":false,"properties":{"tools":{"items":{"$ref":"#/components/schemas/AllowedToolInput"},"maxItems":50,"title":"Tools","type":"array"}},"required":["tools"],"title":"McpAllowlistRequest","type":"object"},"AllowedToolInput":{"additionalProperties":false,"properties":{"name":{"maxLength":64,"minLength":1,"title":"Name","type":"string"},"requires_confirmation":{"default":false,"title":"Requires Confirmation","type":"boolean"}},"required":["name"],"title":"AllowedToolInput","type":"object"},"McpDiscoveryResponse":{"additionalProperties":false,"properties":{"added":{"items":{"type":"string"},"title":"Added","type":"array"},"changed":{"items":{"type":"string"},"title":"Changed","type":"array"},"removed":{"items":{"type":"string"},"title":"Removed","type":"array"},"server":{"$ref":"#/components/schemas/McpServerResponse"},"skipped":{"title":"Skipped","type":"integer"}},"required":["server","added","changed","removed","skipped"],"title":"McpDiscoveryResponse","type":"object"},"MeResponse":{"additionalProperties":false,"properties":{"can_view_costs":{"default":false,"title":"Can View Costs","type":"boolean"},"organization_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Name"},"platform_admin":{"title":"Platform Admin","type":"boolean"},"role":{"$ref":"#/components/schemas/Role"},"subject":{"title":"Subject","type":"string"},"tenant_id":{"format":"uuid","title":"Tenant Id","type":"string"}},"required":["subject","tenant_id","role","platform_admin","organization_name"],"title":"MeResponse","type":"object"},"MetricsResponse":{"additionalProperties":false,"properties":{"by_end_reason":{"items":{"$ref":"#/components/schemas/ShareResponse"},"title":"By End Reason","type":"array"},"by_outcome":{"items":{"$ref":"#/components/schemas/ShareResponse"},"title":"By Outcome","type":"array"},"cost_by_component":{"description":"Empty when no call reported a split.","items":{"$ref":"#/components/schemas/CostComponentResponse"},"title":"Cost By Component","type":"array"},"criteria":{"description":"Success rate per success criterion over the analyzed calls of the range; empty when no call was analyzed.","items":{"$ref":"#/components/schemas/CriterionStatResponse"},"title":"Criteria","type":"array"},"duration_by_assistant":{"items":{"$ref":"#/components/schemas/AssistantDurationResponse"},"title":"Duration By Assistant","type":"array"},"granularity":{"title":"Granularity","type":"string"},"kpis":{"$ref":"#/components/schemas/KpisResponse"},"sentiment":{"$ref":"#/components/schemas/SentimentDistributionResponse","description":"Analyzed calls by sentiment (all zero when none was analyzed)."},"series":{"items":{"$ref":"#/components/schemas/SeriesPointResponse"},"title":"Series","type":"array"},"since":{"format":"date-time","title":"Since","type":"string"},"until":{"format":"date-time","title":"Until","type":"string"}},"required":["since","until","granularity","kpis","series","by_end_reason","by_outcome","duration_by_assistant","cost_by_component","criteria","sentiment"],"title":"MetricsResponse","type":"object"},"ShareResponse":{"additionalProperties":false,"properties":{"calls":{"minimum":0,"title":"Calls","type":"integer"},"key":{"title":"Key","type":"string"}},"required":["key","calls"],"title":"ShareResponse","type":"object"},"CriterionStatResponse":{"additionalProperties":false,"properties":{"failure":{"minimum":0,"title":"Failure","type":"integer"},"id":{"title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"success":{"minimum":0,"title":"Success","type":"integer"},"success_rate":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"description":"`success` over `success` plus `failure`; null when none was decided.","title":"Success Rate"},"unknown":{"minimum":0,"title":"Unknown","type":"integer"}},"required":["id","name","success","failure","unknown","success_rate"],"title":"CriterionStatResponse","type":"object"},"AssistantDurationResponse":{"additionalProperties":false,"properties":{"assistant_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"},"assistant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Name"},"average_duration_seconds":{"minimum":0,"title":"Average Duration Seconds","type":"number"},"calls":{"minimum":0,"title":"Calls","type":"integer"}},"required":["assistant_id","assistant_name","calls","average_duration_seconds"],"title":"AssistantDurationResponse","type":"object"},"KpisResponse":{"additionalProperties":false,"properties":{"answered":{"minimum":0,"title":"Answered","type":"integer"},"answered_rate":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"description":"Null with no calls.","title":"Answered Rate"},"average_duration_seconds":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Average Duration Seconds"},"calls":{"minimum":0,"title":"Calls","type":"integer"},"cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Sum of the priced calls.","title":"Cost Usd"},"promises":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Calls whose structured output has a `promise_date` or `fecha_promesa`; null when no call in the range has a structured output.","title":"Promises"},"total_minutes":{"minimum":0,"title":"Total Minutes","type":"number"}},"required":["calls","answered","answered_rate","average_duration_seconds","total_minutes","cost_usd","promises"],"title":"KpisResponse","type":"object"},"SentimentDistributionResponse":{"additionalProperties":false,"properties":{"negative":{"minimum":0,"title":"Negative","type":"integer"},"neutral":{"minimum":0,"title":"Neutral","type":"integer"},"positive":{"minimum":0,"title":"Positive","type":"integer"}},"required":["positive","neutral","negative"],"title":"SentimentDistributionResponse","type":"object"},"SeriesPointResponse":{"additionalProperties":false,"properties":{"answered":{"minimum":0,"title":"Answered","type":"integer"},"bucket":{"description":"Start of the day or hour.","format":"date-time","title":"Bucket","type":"string"},"calls":{"minimum":0,"title":"Calls","type":"integer"},"cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"title":"Cost Usd"},"minutes":{"minimum":0,"title":"Minutes","type":"number"}},"required":["bucket","calls","answered","minutes","cost_usd"],"title":"SeriesPointResponse","type":"object"},"CreateOrganizationRequest":{"additionalProperties":false,"properties":{"name":{"maxLength":120,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"CreateOrganizationRequest","type":"object"},"OrganizationResponse":{"additionalProperties":false,"properties":{"name":{"title":"Name","type":"string"},"tenant_id":{"format":"uuid","title":"Tenant Id","type":"string"}},"required":["tenant_id","name"],"title":"OrganizationResponse","type":"object"},"OutboundTrunkOptions":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/OutboundTrunkOption"},"title":"Items","type":"array"}},"required":["items"],"title":"OutboundTrunkOptions","type":"object"},"OutboundTrunkOption":{"additionalProperties":false,"properties":{"id":{"format":"uuid","title":"Id","type":"string"},"is_default":{"title":"Is Default","type":"boolean"},"name":{"title":"Name","type":"string"}},"required":["id","name","is_default"],"title":"OutboundTrunkOption","type":"object"},"PricingResponse":{"additionalProperties":false,"properties":{"currency":{"title":"Currency","type":"string"},"prices":{"items":{"$ref":"#/components/schemas/PriceEntryResponse"},"title":"Prices","type":"array"},"unpriced":{"description":"What happens to a model that is not listed: its cost is null, never a guess.","title":"Unpriced","type":"string"},"version":{"description":"Date the prices were read, `YYYY-MM-DD`.","title":"Version","type":"string"}},"required":["version","currency","prices","unpriced"],"title":"PricingResponse","type":"object"},"PriceEntryResponse":{"additionalProperties":false,"properties":{"component":{"title":"Component","type":"string"},"model":{"title":"Model","type":"string"},"note":{"title":"Note","type":"string"},"provider":{"title":"Provider","type":"string"},"rates":{"$ref":"#/components/schemas/PriceRates"},"source":{"description":"Public pricing page the rates were read from.","title":"Source","type":"string"}},"required":["provider","model","component","rates","source","note"],"title":"PriceEntryResponse","type":"object"},"PriceRates":{"additionalProperties":false,"description":"USD per unit; a rate that is null does not apply to the model.","properties":{"audio_input_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Input Per Mtok"},"audio_minute":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Minute"},"audio_output_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Output Per Mtok"},"cached_audio_input_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cached Audio Input Per Mtok"},"cached_input_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cached Input Per Mtok"},"cached_text_input_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cached Text Input Per Mtok"},"input_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Input Per Mtok"},"output_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Output Per Mtok"},"per_mchars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Per Mchars"},"text_input_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Text Input Per Mtok"},"text_output_per_mtok":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Text Output Per Mtok"}},"required":["input_per_mtok","cached_input_per_mtok","output_per_mtok","text_input_per_mtok","cached_text_input_per_mtok","text_output_per_mtok","audio_input_per_mtok","cached_audio_input_per_mtok","audio_output_per_mtok","audio_minute","per_mchars"],"title":"PriceRates","type":"object"},"PronunciationDictionaryList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/PronunciationDictionaryResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"PronunciationDictionaryList","type":"object"},"PronunciationDictionaryResponse":{"additionalProperties":false,"properties":{"created_at":{"format":"date-time","title":"Created At","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"name":{"title":"Name","type":"string"},"rules":{"items":{"$ref":"#/components/schemas/PronunciationRuleResponse"},"title":"Rules","type":"array"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"}},"required":["id","name","language","rules","created_at","updated_at"],"title":"PronunciationDictionaryResponse","type":"object"},"PronunciationRuleResponse":{"additionalProperties":false,"properties":{"alias":{"title":"Alias","type":"string"},"case_sensitive":{"title":"Case Sensitive","type":"boolean"},"grapheme":{"title":"Grapheme","type":"string"}},"required":["grapheme","alias","case_sensitive"],"title":"PronunciationRuleResponse","type":"object"},"PronunciationDictionaryRequest":{"additionalProperties":false,"properties":{"language":{"anyOf":[{"maxLength":16,"minLength":2,"type":"string"},{"type":"null"}],"title":"Language"},"name":{"maxLength":80,"minLength":1,"title":"Name","type":"string"},"rules":{"items":{"$ref":"#/components/schemas/PronunciationRuleInput"},"maxItems":500,"title":"Rules","type":"array"}},"required":["name","rules"],"title":"PronunciationDictionaryRequest","type":"object"},"PronunciationRuleInput":{"additionalProperties":false,"properties":{"alias":{"maxLength":160,"minLength":1,"title":"Alias","type":"string"},"case_sensitive":{"default":false,"title":"Case Sensitive","type":"boolean"},"grapheme":{"maxLength":80,"minLength":1,"title":"Grapheme","type":"string"}},"required":["grapheme","alias"],"title":"PronunciationRuleInput","type":"object"},"ProviderCredentialList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/ProviderCredential"},"title":"Items","type":"array"},"platform_keys_allowed":{"title":"Platform Keys Allowed","type":"boolean"}},"required":["items","platform_keys_allowed"],"title":"ProviderCredentialList","type":"object"},"ProviderCredential":{"additionalProperties":false,"description":"What a tenant stored for a provider. Secrets are never returned: `key_mask` shows the\nlast four characters of the key.","properties":{"api_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Version"},"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"},"configured":{"title":"Configured","type":"boolean"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"},"has_service_account":{"title":"Has Service Account","type":"boolean"},"key_mask":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Mask"},"provider":{"$ref":"#/components/schemas/ProviderId"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"updated_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"},"updated_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By Name"}},"required":["provider","configured","key_mask","has_service_account","base_url","endpoint","api_version","region","updated_at","updated_by"],"title":"ProviderCredential","type":"object"},"ProviderId":{"enum":["openai","azure_openai","anthropic","google","deepgram","elevenlabs","cartesia","azure_speech","groq","cerebras","typesafe"],"title":"ProviderId","type":"string"},"ProviderCredentialUpdate":{"additionalProperties":false,"description":"Absent or null secret fields keep the stored value; the plain fields are replaced.","properties":{"api_key":{"anyOf":[{"maxLength":4096,"minLength":1,"type":"string"},{"type":"null"}],"title":"Api Key"},"api_version":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Api Version"},"base_url":{"anyOf":[{"maxLength":2048,"minLength":9,"type":"string"},{"type":"null"}],"title":"Base Url"},"endpoint":{"anyOf":[{"maxLength":2048,"minLength":9,"type":"string"},{"type":"null"}],"title":"Endpoint"},"region":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Region"},"service_account_json":{"anyOf":[{"maxLength":65536,"minLength":2,"type":"string"},{"type":"null"}],"title":"Service Account Json"}},"title":"ProviderCredentialUpdate","type":"object"},"CampaignReportResponse":{"additionalProperties":false,"properties":{"attempts_per_contact":{"items":{"$ref":"#/components/schemas/AttemptsBucketResponse"},"title":"Attempts Per Contact","type":"array"},"best_hours":{"items":{"$ref":"#/components/schemas/HourOutcomeResponse"},"title":"Best Hours","type":"array"},"completion":{"$ref":"#/components/schemas/CompletionResponse"},"contactability":{"$ref":"#/components/schemas/ContactabilityResponse"},"dnc_skipped":{"description":"Contacts closed by the do-not-call list.","minimum":0,"title":"Dnc Skipped","type":"integer"},"outcomes":{"items":{"$ref":"#/components/schemas/OutcomeCountResponse"},"title":"Outcomes","type":"array"},"summary":{"$ref":"#/components/schemas/ReportSummaryResponse"}},"required":["summary","contactability","attempts_per_contact","outcomes","best_hours","dnc_skipped","completion"],"title":"CampaignReportResponse","type":"object"},"AttemptsBucketResponse":{"additionalProperties":false,"properties":{"attempts":{"minimum":0,"title":"Attempts","type":"integer"},"contacts":{"minimum":0,"title":"Contacts","type":"integer"}},"required":["attempts","contacts"],"title":"AttemptsBucketResponse","type":"object"},"HourOutcomeResponse":{"additionalProperties":false,"properties":{"answered":{"minimum":0,"title":"Answered","type":"integer"},"attempts":{"minimum":0,"title":"Attempts","type":"integer"},"hour":{"description":"Local hour in the campaign's zone.","maximum":23,"minimum":0,"title":"Hour","type":"integer"}},"required":["hour","attempts","answered"],"title":"HourOutcomeResponse","type":"object"},"CompletionResponse":{"additionalProperties":false,"properties":{"contacts_done":{"minimum":0,"title":"Contacts Done","type":"integer"},"contacts_total":{"minimum":0,"title":"Contacts Total","type":"integer"},"progress":{"maximum":1,"minimum":0,"title":"Progress","type":"number"}},"required":["contacts_done","contacts_total","progress"],"title":"CompletionResponse","type":"object"},"ContactabilityResponse":{"additionalProperties":false,"properties":{"contacts":{"minimum":0,"title":"Contacts","type":"integer"},"rate":{"anyOf":[{"maximum":1,"minimum":0,"type":"number"},{"type":"null"}],"description":"`reached` over `contacts`.","title":"Rate"},"reached":{"description":"Contacts with at least one answered attempt.","minimum":0,"title":"Reached","type":"integer"}},"required":["contacts","reached","rate"],"title":"ContactabilityResponse","type":"object"},"OutcomeCountResponse":{"additionalProperties":false,"properties":{"attempts":{"minimum":0,"title":"Attempts","type":"integer"},"contacts":{"description":"Distinct contacts with such an attempt.","minimum":0,"title":"Contacts","type":"integer"},"outcome":{"title":"Outcome","type":"string"}},"required":["outcome","attempts","contacts"],"title":"OutcomeCountResponse","type":"object"},"ReportSummaryResponse":{"additionalProperties":false,"properties":{"assistant_id":{"format":"uuid","title":"Assistant Id","type":"string"},"attempts":{"minimum":0,"title":"Attempts","type":"integer"},"campaign_id":{"format":"uuid","title":"Campaign Id","type":"string"},"completed_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Completed At"},"contacts_total":{"minimum":0,"title":"Contacts Total","type":"integer"},"name":{"title":"Name","type":"string"},"started_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Started At"},"status":{"$ref":"#/components/schemas/CampaignStatus"},"timezone":{"title":"Timezone","type":"string"},"total_minutes":{"minimum":0,"title":"Total Minutes","type":"number"}},"required":["campaign_id","name","status","assistant_id","timezone","started_at","completed_at","contacts_total","attempts","total_minutes"],"title":"ReportSummaryResponse","type":"object"},"ReportAttemptOutcome":{"anyOf":[{"$ref":"#/components/schemas/Outcome"},{"enum":["answered_responded","no_initial_response","silence_abandonment"],"type":"string"}]},"ReportView":{"enum":["contact","attempt"],"title":"ReportView","type":"string"},"ReportRowsResponse":{"additionalProperties":false,"properties":{"available_columns":{"items":{"$ref":"#/components/schemas/ReportColumn"},"title":"Available Columns","type":"array"},"columns":{"items":{"$ref":"#/components/schemas/ReportColumn"},"title":"Columns","type":"array"},"items":{"items":{"$ref":"#/components/schemas/ReportRowResponse"},"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["columns","available_columns","items","next_cursor"],"title":"ReportRowsResponse","type":"object"},"ReportColumn":{"additionalProperties":false,"properties":{"key":{"$ref":"#/components/schemas/ColumnText"},"label":{"anyOf":[{"$ref":"#/components/schemas/ColumnText"},{"type":"null"}]},"source":{"$ref":"#/components/schemas/ColumnSource"}},"required":["source","key"],"title":"ReportColumn","type":"object"},"ColumnText":{"maxLength":120,"minLength":1,"type":"string"},"ColumnSource":{"enum":["file","result","captured"],"title":"ColumnSource","type":"string"},"ReportRowResponse":{"additionalProperties":false,"properties":{"attempt":{"anyOf":[{"$ref":"#/components/schemas/ReportAttemptResponse"},{"type":"null"}]},"attempt_count":{"title":"Attempt Count","type":"integer"},"attempt_outcomes":{"description":"Outcome of each completed attempt, ascending by dispatch sequence.","items":{"$ref":"#/components/schemas/ReportAttemptOutcome"},"title":"Attempt Outcomes","type":"array"},"best_attempt":{"anyOf":[{"$ref":"#/components/schemas/ReportAttemptResponse"},{"type":"null"}]},"cells":{"items":{"$ref":"#/components/schemas/JsonValue"},"title":"Cells","type":"array"},"contact_id":{"format":"uuid","title":"Contact Id","type":"string"},"latest_attempt":{"anyOf":[{"$ref":"#/components/schemas/ReportAttemptResponse"},{"type":"null"}]},"outcomes":{"items":{"$ref":"#/components/schemas/ReportOutcomeResponse"},"title":"Outcomes","type":"array"}},"required":["contact_id","attempt_count","outcomes","attempt_outcomes","latest_attempt","best_attempt","attempt","cells"],"title":"ReportRowResponse","type":"object"},"ReportAttemptResponse":{"additionalProperties":false,"properties":{"attempt_number":{"title":"Attempt Number","type":"integer"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd"},"dispatch_sequence":{"title":"Dispatch Sequence","type":"integer"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"id":{"format":"uuid","title":"Id","type":"string"},"outcome":{"anyOf":[{"$ref":"#/components/schemas/ReportAttemptOutcome"},{"type":"null"}]},"silence_phase":{"anyOf":[{"$ref":"#/components/schemas/SilencePhase"},{"type":"null"}]},"started_at":{"format":"date-time","title":"Started At","type":"string"},"status":{"$ref":"#/components/schemas/AttemptStatus"}},"required":["id","dispatch_sequence","attempt_number","status","outcome","started_at","duration_seconds","silence_phase"],"title":"ReportAttemptResponse","type":"object"},"SilencePhase":{"enum":["initial","in_conversation"],"type":"string"},"JsonValue":{},"ReportOutcomeResponse":{"additionalProperties":false,"properties":{"count":{"title":"Count","type":"integer"},"outcome":{"$ref":"#/components/schemas/ReportAttemptOutcome"}},"required":["outcome","count"],"title":"ReportOutcomeResponse","type":"object"},"ReportConfig":{"additionalProperties":false,"properties":{"columns":{"anyOf":[{"items":{"$ref":"#/components/schemas/ReportColumn"},"maxItems":100,"type":"array"},{"type":"null"}],"title":"Columns"},"objective_field":{"anyOf":[{"$ref":"#/components/schemas/ColumnText"},{"type":"null"}]},"ranking":{"default":["objective","stage","captured_count","human","machine","unanswered"],"items":{"$ref":"#/components/schemas/RankingCriterion"},"maxItems":6,"minItems":1,"title":"Ranking","type":"array"},"stage_order":{"default":[],"items":{"$ref":"#/components/schemas/ColumnText"},"maxItems":100,"title":"Stage Order","type":"array"}},"title":"ReportConfig","type":"object"},"RankingCriterion":{"enum":["objective","stage","captured_count","human","machine","unanswered"],"title":"RankingCriterion","type":"string"},"SipNumberList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/SipNumber"},"title":"Items","type":"array"}},"required":["items"],"title":"SipNumberList","type":"object"},"SipNumber":{"additionalProperties":false,"description":"A number of my organization.","properties":{"assigned_at":{"format":"date-time","title":"Assigned At","type":"string"},"assistant_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"},"id":{"format":"uuid","title":"Id","type":"string"},"phone_e164":{"maxLength":16,"pattern":"^\\+[1-9][0-9]{6,14}$","title":"Phone E164","type":"string"}},"required":["id","phone_e164","assistant_id","assigned_at"],"title":"SipNumber","type":"object"},"SetSipNumberAssistantRequest":{"additionalProperties":false,"description":"The assistant that answers the number; null leaves it unassigned.","properties":{"assistant_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"}},"required":["assistant_id"],"title":"SetSipNumberAssistantRequest","type":"object"},"CallTestReadinessResponse":{"additionalProperties":false,"properties":{"caller_id_required":{"default":true,"description":"Whether an ECO caller ID is required. False when telephony owns ANI selection.","title":"Caller Id Required","type":"boolean"},"caller_ids":{"items":{"$ref":"#/components/schemas/CallTestCallerId"},"title":"Caller Ids","type":"array"},"default_caller_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The caller ID used when the request names none.","title":"Default Caller Id"},"outbound_trunk":{"description":"The platform has an outbound trunk to dial through.","title":"Outbound Trunk","type":"boolean"}},"required":["outbound_trunk","caller_ids"],"title":"CallTestReadinessResponse","type":"object"},"CallTestCallerId":{"additionalProperties":false,"properties":{"id":{"format":"uuid","title":"Id","type":"string"},"label":{"title":"Label","type":"string"},"last4":{"pattern":"^[0-9]{0,4}$","title":"Last4","type":"string"}},"required":["id","label","last4"],"title":"CallTestCallerId","type":"object"},"ToolList":{"additionalProperties":false,"properties":{"built_in":{"items":{"type":"string"},"title":"Built In","type":"array"},"items":{"items":{"$ref":"#/components/schemas/ToolResponse"},"title":"Items","type":"array"}},"required":["items","built_in"],"title":"ToolList","type":"object"},"ToolResponse":{"additionalProperties":false,"properties":{"async":{"title":"Async","type":"boolean"},"body_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Template"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"created_by":{"title":"Created By","type":"string"},"description":{"title":"Description","type":"string"},"failure_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Message"},"headers":{"items":{"$ref":"#/components/schemas/ToolHeaderResponse"},"title":"Headers","type":"array"},"id":{"format":"uuid","title":"Id","type":"string"},"method":{"$ref":"#/components/schemas/ToolMethod"},"name":{"title":"Name","type":"string"},"parameters":{"additionalProperties":true,"title":"Parameters","type":"object"},"sensitive":{"title":"Sensitive","type":"boolean"},"timeout_seconds":{"title":"Timeout Seconds","type":"integer"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"url":{"title":"Url","type":"string"},"waiting_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waiting Message"}},"required":["id","name","description","parameters","url","method","headers","timeout_seconds","waiting_message","failure_message","async","sensitive","body_template","created_by","created_at","updated_at"],"title":"ToolResponse","type":"object"},"ToolHeaderResponse":{"additionalProperties":false,"properties":{"name":{"title":"Name","type":"string"},"value_mask":{"title":"Value Mask","type":"string"}},"required":["name","value_mask"],"title":"ToolHeaderResponse","type":"object"},"ToolMethod":{"enum":["GET","POST","PUT","PATCH","DELETE"],"title":"ToolMethod","type":"string"},"ToolRequest":{"additionalProperties":false,"properties":{"async":{"default":false,"title":"Async","type":"boolean"},"body_template":{"anyOf":[{"maxLength":4096,"type":"string"},{"type":"null"}],"title":"Body Template"},"description":{"maxLength":1000,"minLength":1,"title":"Description","type":"string"},"failure_message":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Failure Message"},"headers":{"default":[],"items":{"$ref":"#/components/schemas/ToolHeaderInput"},"maxItems":20,"title":"Headers","type":"array"},"method":{"$ref":"#/components/schemas/ToolMethod","default":"POST"},"name":{"pattern":"^[a-zA-Z][a-zA-Z0-9_]{0,63}$","title":"Name","type":"string"},"parameters":{"additionalProperties":true,"title":"Parameters","type":"object"},"sensitive":{"default":true,"title":"Sensitive","type":"boolean"},"timeout_seconds":{"default":10,"maximum":30,"minimum":1,"title":"Timeout Seconds","type":"integer"},"url":{"maxLength":2048,"minLength":9,"title":"Url","type":"string"},"waiting_message":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Waiting Message"}},"required":["name","description","parameters","url"],"title":"ToolRequest","type":"object"},"ToolHeaderInput":{"additionalProperties":false,"properties":{"name":{"maxLength":64,"minLength":1,"title":"Name","type":"string"},"value":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"title":"Value"}},"required":["name"],"title":"ToolHeaderInput","type":"object"},"TestToolRequest":{"additionalProperties":false,"properties":{"args":{"additionalProperties":true,"default":{},"title":"Args","type":"object"}},"title":"TestToolRequest","type":"object"},"ToolTestResponse":{"additionalProperties":false,"properties":{"duration_ms":{"title":"Duration Ms","type":"integer"},"error":{"anyOf":[{"$ref":"#/components/schemas/ToolCallError"},{"type":"null"}]},"ok":{"title":"Ok","type":"boolean"},"request":{"anyOf":[{"$ref":"#/components/schemas/ToolTestRequestPreview"},{"type":"null"}]},"response_body":{"title":"Response Body","type":"string"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"truncated":{"title":"Truncated","type":"boolean"}},"required":["ok","status_code","duration_ms","response_body","truncated","error","request"],"title":"ToolTestResponse","type":"object"},"ToolCallError":{"enum":["blocked_address","dns_failure","timeout","connection_failed","response_too_large"],"title":"ToolCallError","type":"string"},"ToolTestRequestPreview":{"additionalProperties":false,"properties":{"body":{"anyOf":[{},{"type":"null"}],"title":"Body"},"header_names":{"items":{"type":"string"},"title":"Header Names","type":"array"},"method":{"$ref":"#/components/schemas/ToolMethod"},"url":{"title":"Url","type":"string"}},"required":["method","url","body","header_names"],"title":"ToolTestRequestPreview","type":"object"},"GroupBy":{"enum":["component","provider","model","assistant","campaign","day","source"],"title":"GroupBy","type":"string"},"Component":{"enum":["llm","realtime","stt","tts","embeddings","telephony"],"title":"Component","type":"string"},"UsageSource":{"enum":["call","talk","ingest","search","builder","decider","simulation","analysis","extraction","amd","optimizer"],"title":"UsageSource","type":"string"},"UsageResponse":{"additionalProperties":false,"properties":{"group_by":{"title":"Group By","type":"string"},"groups":{"items":{"$ref":"#/components/schemas/UsageGroupResponse"},"title":"Groups","type":"array"},"price_version":{"description":"Version of the price table that new usage is priced with.","title":"Price Version","type":"string"},"since":{"format":"date-time","title":"Since","type":"string"},"then_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Then By"},"totals":{"$ref":"#/components/schemas/UsageTotalsResponse"},"truncated":{"description":"True when more than 500 groups matched.","title":"Truncated","type":"boolean"},"until":{"format":"date-time","title":"Until","type":"string"}},"required":["since","until","group_by","then_by","price_version","totals","groups","truncated"],"title":"UsageResponse","type":"object"},"UsageGroupResponse":{"additionalProperties":false,"properties":{"key":{"description":"The value of `group_by`: a component, provider, model or source name, a day (`YYYY-MM-DD`), or an assistant or campaign id (empty for usage without one).","title":"Key","type":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assistant or campaign name, if known.","title":"Label"},"subkey":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The value of `then_by`, when it is set.","title":"Subkey"},"sublabel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sublabel"},"totals":{"$ref":"#/components/schemas/UsageTotalsResponse"}},"required":["key","label","subkey","sublabel","totals"],"title":"UsageGroupResponse","type":"object"},"UsageTotalsResponse":{"additionalProperties":false,"properties":{"cost_usd":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}],"description":"Sum of the rows that have a price; null when none has.","title":"Cost Usd"},"quantities":{"$ref":"#/components/schemas/UsageQuantities"},"unpriced_rows":{"description":"Rows whose model has no price: the cost is then incomplete.","minimum":0,"title":"Unpriced Rows","type":"integer"}},"required":["quantities","cost_usd","unpriced_rows"],"title":"UsageTotalsResponse","type":"object"},"Provider":{"enum":["elevenlabs","cartesia"],"title":"Provider","type":"string"},"VoiceScope":{"enum":["all","owned","library"],"title":"VoiceScope","type":"string"},"VoiceListResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/VoiceResponse"},"title":"Items","type":"array"},"library_configured":{"description":"False when no provider has a key for the organization: no library.","title":"Library Configured","type":"boolean"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass it as `cursor` for the next page; null on the last one.","title":"Next Cursor"},"providers":{"description":"How each provider's library went, so one failing key is visible.","items":{"$ref":"#/components/schemas/ProviderListingResponse"},"title":"Providers","type":"array"}},"required":["items","library_configured","providers"],"title":"VoiceListResponse","type":"object"},"VoiceResponse":{"additionalProperties":false,"properties":{"accent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent"},"created_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Created At"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"id":{"description":"Provider voice id: the TTS `voice_id` of an assistant.","title":"Id","type":"string"},"kind":{"anyOf":[{"$ref":"#/components/schemas/VoiceKind"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"library_owner_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only for a voice of ElevenLabs' shared library: who shared it. Such a voice must be added to the organization's account before an assistant can use it.","title":"Library Owner Id"},"name":{"title":"Name","type":"string"},"owned":{"title":"Owned","type":"boolean"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"},"provider":{"description":"`elevenlabs` or `cartesia`. The set may grow: handle unknown values.","title":"Provider","type":"string","x-extensible-enum":["elevenlabs","cartesia"]}},"required":["id","name","provider","gender","accent","language","description","preview_url","owned","kind","created_at"],"title":"VoiceResponse","type":"object"},"VoiceKind":{"enum":["designed","cloned"],"title":"VoiceKind","type":"string"},"ProviderListingResponse":{"additionalProperties":false,"properties":{"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only when `status` is `error`: the provider's status.","title":"Error"},"provider":{"description":"`elevenlabs` or `cartesia`. The set may grow: handle unknown values.","title":"Provider","type":"string","x-extensible-enum":["elevenlabs","cartesia"]},"status":{"$ref":"#/components/schemas/ListingStatus","description":"`ok`; `not_configured` (the organization has no key for it, and no platform key it may use); `error` (the provider refused or was unreachable)."}},"required":["provider","status","error"],"title":"ProviderListingResponse","type":"object"},"ListingStatus":{"enum":["ok","not_configured","error"],"title":"ListingStatus","type":"string"},"CreateVoiceRequest":{"additionalProperties":false,"properties":{"description":{"maxLength":1000,"minLength":20,"title":"Description","type":"string"},"generated_voice_id":{"pattern":"^[A-Za-z0-9_-]{10,100}$","title":"Generated Voice Id","type":"string"},"name":{"maxLength":80,"minLength":1,"title":"Name","type":"string"}},"required":["name","description","generated_voice_id"],"title":"CreateVoiceRequest","type":"object"},"AccentListResponse":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/AccentResponse"},"title":"Items","type":"array"}},"required":["items"],"title":"AccentListResponse","type":"object"},"AccentResponse":{"additionalProperties":false,"properties":{"id":{"description":"The value of the `accent` filter of `GET /v1/voices`.","title":"Id","type":"string"},"language":{"description":"Language code the variant belongs to (`es`).","title":"Language","type":"string"},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"BCP-47 locale such as `es-AR`, if known.","title":"Locale"},"name":{"title":"Name","type":"string"},"provider":{"description":"`elevenlabs` or `cartesia`. The set may grow: handle unknown values.","title":"Provider","type":"string","x-extensible-enum":["elevenlabs","cartesia"]}},"required":["provider","id","name","language","locale"],"title":"AccentResponse","type":"object"},"CloneVoiceForm":{"additionalProperties":false,"description":"`multipart/form-data`: 1 to 5 audio `files`, a `name`, `consent` and its statement.","properties":{"consent":{"title":"Consent","type":"boolean"},"consent_statement":{"maxLength":500,"minLength":10,"title":"Consent Statement","type":"string"},"description":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Description"},"files":{"items":{"contentMediaType":"application/octet-stream","type":"string"},"maxItems":5,"minItems":1,"title":"Files","type":"array"},"name":{"maxLength":80,"minLength":1,"title":"Name","type":"string"}},"required":["files","name","consent","consent_statement"],"title":"CloneVoiceForm","type":"object"},"DesignVoiceRequest":{"additionalProperties":false,"properties":{"description":{"maxLength":1000,"minLength":20,"title":"Description","type":"string"},"text":{"anyOf":[{"maxLength":1000,"minLength":100,"type":"string"},{"type":"null"}],"title":"Text"}},"required":["description"],"title":"DesignVoiceRequest","type":"object"},"DesignResponse":{"additionalProperties":false,"properties":{"previews":{"items":{"$ref":"#/components/schemas/DesignPreviewResponse"},"title":"Previews","type":"array"},"text":{"title":"Text","type":"string"}},"required":["text","previews"],"title":"DesignResponse","type":"object"},"DesignPreviewResponse":{"additionalProperties":false,"properties":{"audio_base64":{"title":"Audio Base64","type":"string"},"duration_secs":{"title":"Duration Secs","type":"number"},"id":{"description":"`generated_voice_id` to save this preview.","title":"Id","type":"string"},"media_type":{"title":"Media Type","type":"string"}},"required":["id","audio_base64","media_type","duration_secs"],"title":"DesignPreviewResponse","type":"object"},"AddSharedVoiceRequest":{"additionalProperties":false,"description":"A voice of ElevenLabs' shared library, as a listing names it (`id`, `library_owner_id`).","properties":{"name":{"maxLength":80,"minLength":1,"title":"Name","type":"string"},"public_owner_id":{"pattern":"^[A-Za-z0-9]{10,100}$","title":"Public Owner Id","type":"string"},"voice_id":{"pattern":"^[A-Za-z0-9]{10,40}$","title":"Voice Id","type":"string"}},"required":["public_owner_id","voice_id","name"],"title":"AddSharedVoiceRequest","type":"object"},"WebhookList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/WebhookResponse"},"maxItems":10,"title":"Items","type":"array"}},"required":["items"],"title":"WebhookList","type":"object"},"WebhookResponse":{"additionalProperties":false,"properties":{"active":{"title":"Active","type":"boolean"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"description":{"title":"Description","type":"string"},"events":{"items":{"description":"A webhook event of the catalog. The set may grow: handle unknown values.","type":"string","x-extensible-enum":["campaign.started","campaign.completed","campaign.attempt.completed","call.result","call.analyzed"]},"maxItems":5,"title":"Events","type":"array"},"id":{"format":"uuid","title":"Id","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"url":{"title":"Url","type":"string"}},"required":["id","url","description","events","active","created_at","updated_at"],"title":"WebhookResponse","type":"object"},"CreateWebhookRequest":{"additionalProperties":false,"properties":{"description":{"default":"","maxLength":200,"title":"Description","type":"string"},"events":{"items":{"$ref":"#/components/schemas/WebhookEvent"},"maxItems":5,"minItems":1,"title":"Events","type":"array"},"url":{"maxLength":2048,"minLength":1,"title":"Url","type":"string"}},"required":["url","events"],"title":"CreateWebhookRequest","type":"object"},"WebhookEvent":{"description":"The events a webhook can subscribe to: the catalog events with `webhook = True`\n(`tests/core/test_webhooks.py` keeps the two in step).","enum":["campaign.started","campaign.completed","campaign.attempt.completed","call.result","call.analyzed"],"title":"WebhookEvent","type":"string"},"WebhookWithSecretResponse":{"additionalProperties":false,"properties":{"active":{"title":"Active","type":"boolean"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"description":{"title":"Description","type":"string"},"events":{"items":{"description":"A webhook event of the catalog. The set may grow: handle unknown values.","type":"string","x-extensible-enum":["campaign.started","campaign.completed","campaign.attempt.completed","call.result","call.analyzed"]},"maxItems":5,"title":"Events","type":"array"},"id":{"format":"uuid","title":"Id","type":"string"},"secret":{"description":"Shown once. Sign check: HMAC-SHA256 of `timestamp.body`.","title":"Secret","type":"string"},"updated_at":{"format":"date-time","title":"Updated At","type":"string"},"url":{"title":"Url","type":"string"}},"required":["id","url","description","events","active","created_at","updated_at","secret"],"title":"WebhookWithSecretResponse","type":"object"},"UpdateWebhookRequest":{"additionalProperties":false,"properties":{"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"description":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Description"},"events":{"anyOf":[{"items":{"$ref":"#/components/schemas/WebhookEvent"},"maxItems":5,"minItems":1,"type":"array"},{"type":"null"}],"title":"Events"},"url":{"anyOf":[{"maxLength":2048,"minLength":1,"type":"string"},{"type":"null"}],"title":"Url"}},"title":"UpdateWebhookRequest","type":"object"},"DeliveryStatus":{"enum":["pending","delivered","dead"],"title":"DeliveryStatus","type":"string"},"WebhookDeliveryList":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/WebhookDeliveryResponse"},"maxItems":200,"title":"Items","type":"array"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"required":["items","next_cursor"],"title":"WebhookDeliveryList","type":"object"},"WebhookDeliveryResponse":{"additionalProperties":false,"properties":{"attempts":{"title":"Attempts","type":"integer"},"created_at":{"format":"date-time","title":"Created At","type":"string"},"delivered_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Delivered At"},"event_id":{"format":"uuid","title":"Event Id","type":"string"},"event_type":{"title":"Event Type","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status"},"next_attempt_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Next Attempt At"},"status":{"$ref":"#/components/schemas/DeliveryStatus"}},"required":["id","event_id","event_type","status","attempts","next_attempt_at","last_status","last_error","created_at","delivered_at"],"title":"WebhookDeliveryResponse","type":"object"},"WebhookTestResponse":{"additionalProperties":false,"properties":{"duration_ms":{"title":"Duration Ms","type":"integer"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"ok":{"title":"Ok","type":"boolean"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"}},"required":["ok","status_code","error","duration_ms"],"title":"WebhookTestResponse","type":"object"}},"securitySchemes":{"HTTPBearer":{"description":"Access token of the identity provider, or an API key (`fnk_...`) for the operations that accept one.","scheme":"bearer","type":"http"}}},"info":{"contact":{"name":"eco"},"description":"Public API of the eco voice platform.","title":"eco control plane","version":"1.118.0"},"openapi":"3.1.0","paths":{"/v1/api-keys":{"get":{"description":"An `admin` or above, signed in as a user (an API key cannot manage keys). Newest first, revoked keys included. A key shows its `prefix` (the start of the secret, to tell keys apart), `scopes`, who created it, when it was `last_used_at` (at most a minute late) and its `expires_at` and `revoked_at`. The secret is never returned again. 401 when the token is missing, expired or invalid; 403 below `admin`; 503 when API keys are not available.","operationId":"listApiKeys","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below `admin`, or called with a key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"API keys are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the API keys of my organization","tags":["api-keys"],"x-min-role":"admin"},"post":{"description":"An `admin` or above, signed in as a user. `scopes` (at least one, no repeats) are `campaigns:read`, `campaigns:write`, `contacts:read`, `contacts:write`, `assistants:read`, `knowledge:read`, `knowledge:write`, `usage:read` and `credit:read`. `expires_at` is optional and must be in the future. The answer has the `secret` (`fnk_...`), **the only time it is shown**: only its hash is stored. Send it as `Authorization: Bearer <secret>` to the operations that accept a key: the operations whose contract shows `x-api-key-scope`. A key acts as an `editor` of its organization, limited to its scopes, and is limited per minute per key (`429` with `Retry-After`). Written to the audit log as `api_key.create`, without the secret. 401 when the token is missing, expired or invalid; 403 below `admin`; 422 when the body is invalid, no scope is given or the expiry is not in the future; 503 when API keys are not available.","operationId":"createApiKey","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKeyResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below `admin`, or called with a key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"API keys are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create an API key","tags":["api-keys"],"x-min-role":"admin"}},"/v1/api-keys/{key_id}/revoke":{"post":{"description":"An `admin` or above, signed in as a user. The key stops working at once and cannot be restored. Idempotent: a key already revoked is returned as it is. Written to the audit log as `api_key.revoke`. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when the key is not in the caller's tenant; 503 when API keys are not available.","operationId":"revokeApiKey","parameters":[{"in":"path","name":"key_id","required":true,"schema":{"format":"uuid","title":"Key Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below `admin`, or called with a key."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such key in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"API keys are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Revoke an API key","tags":["api-keys"],"x-min-role":"admin"}},"/v1/assistant-builder/applied":{"post":{"description":"An `editor` or above tells the control plane that a proposal of the builder was saved into the draft of `assistant_id`. It is audited as `assistant_builder.proposal_applied` with the assistant id and name only, never the conversation or the proposal. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 503 when assistants are not available.","operationId":"reportAssistantBuilderProposalApplied","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderAppliedRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants or the audit log are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Record that a builder proposal was applied to an assistant","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistant-builder/messages":{"post":{"description":"An `editor` or above sends the next message of a conversation with the builder. The client keeps the conversation and sends the prior turns (`conversation`, at most 20, oldest first). Send `assistant_id` to edit that assistant's draft, or `mode` to start a new assistant. `target` is `prompt` (a free prompt), `tree` (a conversation tree) or `auto` (the builder chooses). The answer has the `reply` text, optional quick-reply `suggestions` and an optional `proposal`: a short list of `changes`, an optional `name` and the complete resulting `config`, already validated as an assistant version (the draft with the proposed prompt, first message, flow, variables, tools, knowledge bases and result fields applied). Tools and knowledge bases are suggested only from the caller's organization. A proposal that fails validation is repaired once by the model; if it is still invalid there is no `proposal` and `proposal_errors` says why. Nothing is saved: the client applies a proposal by saving the draft (`PUT /v1/assistants/{id}/draft`) and then reports it with `POST /v1/assistant-builder/applied`. Each organization may send a bounded number of messages per minute; above it the answer is `429` with `Retry-After`. Messages are never logged. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when `assistant_id` is not an assistant of the caller's organization; 422 when the body is invalid; 502 `builder_failed` when the model provider failed; 503 `builder_not_configured` when no model is configured (clients fall back to a guided builder).","operationId":"sendAssistantBuilderMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderMessageRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderMessageResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many messages; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before the next message.","schema":{"minimum":1,"type":"integer"}}}},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The model provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The builder is not configured."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Chat with the AI builder to write a prompt or a conversation tree","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistant-builder/messages/stream":{"post":{"description":"The same request, checks and answer as `POST /v1/assistant-builder/messages`, sent as server-sent events so a client can show the first words of the reply while the model is still working. Every check (token, role, `assistant_id`, rate limit, budget, model configured) happens before the stream starts and fails with the same HTTP status as the plain endpoint; once the stream is open the status is `200`. Events, in order: zero or more `delta` (`{\"text\": \"...\"}`, the next words of `reply`; provisional, the `reply` of `result` replaces them), then exactly one of `result` (the full `BuilderMessageResponse`) or `error` (`{\"code\": \"builder_failed\", \"message\": \"...\"}`: the model provider failed). Nothing is saved and messages are never logged.","operationId":"streamAssistantBuilderMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderMessageRequest"}}},"required":true},"responses":{"200":{"content":{"text/event-stream":{"example":"event: delta\ndata: {\"text\": \"Hola, \"}\n\nevent: result\ndata: {\"reply\": \"Hola, ...\", \"suggestions\": [], \"proposal\": null, \"proposal_errors\": []}\n\n","schema":{"type":"string"}}},"description":"A stream of server-sent events: `delta`, then `result` or `error`."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many messages; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before the next message.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The builder is not configured."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Chat with the AI builder and read the reply as it is written","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants":{"get":{"description":"Any signed-in member of the tenant, or an API key with `assistants:read`. Each item is a summary: `id`, `name`, `mode` (`pipeline` or `realtime`), `latest_version`, `status` and `updated_at`. `latest_version` is the number of the last published version, `0` when the assistant was never published. `status` is `published` when that version is the current content and `draft` when the assistant was never published or has changes that are not published yet. `q` keeps the assistants whose name contains the text, ignoring case and accents (at most 100 characters). Pages are ordered by `updated_at`, newest first; pass `next_cursor` of a page as `cursor` to get the next one. `next_cursor` is `null` on the last page. The cursor is opaque; do not build or change it. `limit` is at most 200 (default 100). Archived assistants are left out unless `archived` is `true`, which lists only the archived ones (`archived_at` says when). Only the assistants of the caller's tenant are listed. 401 when the token is missing, expired or invalid; 422 when a parameter is out of range or the cursor is not one we issued; 503 when assistants are not available.","operationId":"listAssistants","parameters":[{"in":"query","name":"q","required":false,"schema":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"title":"Q"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}},{"in":"query","name":"archived","required":false,"schema":{"default":false,"title":"Archived","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantPage"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the assistants of my organization","tags":["assistants"],"x-api-key-scope":"assistants:read","x-min-role":"viewer"},"post":{"description":"An `editor` or above creates an assistant as a draft: `latest_version` `0`, `status` `draft`, never published. `name` is 1 to 120 characters after trimming; names are not unique. Send `mode` (`pipeline` or `realtime`) for a blank draft, or `template_id` to start from a template: `preventive-collections`, `early-arrears`, `nps-survey` (`pipeline`) or `inbound-faq`, `receptionist` (`realtime`). The template gives the mode, so `mode` may be left out; when both are sent they must agree. The content of a template (prompt, variables, result spec) lives in the API, is versioned with it and carries no customer data; clients send only the id. Blank and template drafts start with a 3-second initial silence timeout and a 6-second conversation silence timeout. The tenant is the one in the caller's access token. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the body is invalid, has neither `mode` nor `template_id`, or the `mode` does not match the template. 503 when assistants are not available.","operationId":"createAssistant","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssistantRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSummary"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create an assistant draft","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}":{"get":{"description":"Any signed-in member of the tenant, or an API key with `assistants:read`. The answer has the fields of the list item plus `config`, the current draft (an `AssistantVersion`, see `schemas/assistant-version.schema.json`), and `published_version_id`, the id of the last published version, `null` when never published. The draft includes changes that are not published yet. `mode` is the engine of the draft: it changes when a draft of the other mode is saved. 401 when the token is missing, expired or invalid; 404 when the assistant does not exist in the caller's tenant; 422 when the id is not a UUID; 503 when assistants are not available.","operationId":"getAssistant","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDetail"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Read an assistant with its current draft","tags":["assistants"],"x-api-key-scope":"assistants:read","x-min-role":"viewer"}},"/v1/assistants/{assistant_id}/archive":{"post":{"description":"An `editor` or above hides the assistant from the list and from the pickers (campaigns, phone numbers). Nothing is deleted: versions, calls and reports stay, the assistant can still be read by id and `POST /v1/assistants/{assistant_id}/restore` brings it back. An archived assistant cannot be edited or published. Archiving an archived assistant answers 200 and changes nothing. Written to the audit log as `assistant.archive`. 409 `assistant_in_use_by_campaign` while a running or paused campaign uses it and 409 `assistant_in_use_by_number` while a phone number answers with it. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 503 when assistants are not available.","operationId":"archiveAssistant","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSummary"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"A campaign or a phone number uses it."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Archive an assistant (soft delete)","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/draft":{"put":{"description":"An `editor` or above replaces the whole draft with `config` and, when `name` is sent, renames the assistant (1 to 120 characters after trimming). `config` is validated as an `AssistantVersion`, flow rules included (a start and exits that point to steps, a final step, every step reachable, and `{{name}}` placeholders that are variables or captured earlier). The `mode` of `config` decides the engine: sending a `realtime` config to a `pipeline` assistant (or the other way round) switches it, and the assistant's `mode` follows the draft at once; the config must carry the section of its own mode and not the other's. Published versions keep the engine they were published with and calls only run published versions, so nothing changes for callers until it is published. The keys of `config.result_spec.json_schema.properties` (the fields collected from a call) must be a lowercase letter followed by lowercase letters, digits or `_`, up to 64 characters; a draft with another key is refused with `422` and the error type `invalid_result_field_name` (the key is not echoed), never saved without it. A human label for a field goes in its `title`. Nothing is published: `status` becomes `draft` when the draft differs from the published version and goes back to `published` when it is saved equal to it. The change is written to the audit log as `assistant.update_draft` with names only, never the content. A knowledge base can be newly attached only when it has a ready document: an empty, still processing or failed base answers 422 `knowledge_base_not_ready` at `config.knowledge_bases` (a base already attached keeps saving). 409 `assistant_archived` when the assistant is archived. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 422 when the id or the body is invalid (including a config that does not fit its own `mode`), with the failing fields in `errors`; 503 when assistants are not available.","operationId":"updateAssistantDraft","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDraftRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDetail"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `assistant_archived`."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Replace the draft of an assistant","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/duplicate":{"post":{"description":"An `editor` or above copies an assistant of the tenant into a new draft with the given `name` (1 to 120 characters after trimming). The copy has the same `mode` and the current content of the source, including changes that are not published yet; it is never published (`latest_version` `0`, `status` `draft`) and does not share anything else with the source. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 422 when the id or the body is invalid; 503 when assistants are not available.","operationId":"duplicateAssistant","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateAssistantRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSummary"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Duplicate an assistant as a new draft","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/experiments":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. 401 when the token is missing, expired or invalid; 404 when the assistant is not in the tenant; 503 when experiments are not available.","operationId":"listAssistantExperiments","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or experiment."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Experiments are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The experiments of an assistant, newest first","tags":["experiments"],"x-min-role":"viewer"},"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above starts an A/B experiment: `variants` are 2 to 5 published versions of the assistant by `version` number, each with a `weight` (a whole number from 1 to 100); the weights add up to 100. From now on each campaign attempt and each Talk session of the assistant gets one of them by weight, instead of the latest published version. The pick is a hash of the experiment and the contact, so a contact keeps the same version for the whole experiment and retries do not switch it; a Talk session is picked by its own id. The first variant is the control of the comparison. The version each call got is recorded on it (`assistant_version`). Only versions published after experiments were introduced can be named; the one published when they were introduced is included. One experiment runs at a time per assistant. Audited as `experiment.start`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant is not in the tenant; 409 when it already has a running experiment; 422 when the weights do not add up to 100, a version is repeated or not published, or the number of variants is wrong; 503 when experiments are not available.","operationId":"startAssistantExperiment","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartExperimentRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or experiment."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The experiment is in another state."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Experiments are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Split the traffic of an assistant between published versions","tags":["experiments"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/experiments/{experiment_id}":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. Per version, over the calls made while the experiment ran (real calls and the completed attempts of simulated campaigns; Talk test sessions are left out): `calls`, `answered`, `answer_rate`, `avg_duration_seconds`, `outcomes` (the distribution by outcome) and `avg_cost_usd` when calls report a cost. `success_rate` is `null` until post-call analysis is available. `significance` compares each version against the first one on the answered rate with a two-proportion z-test (`z`, `p_value`, `significant`, `enough_data`); it is indicative, see its `note`. The numbers are live while the experiment runs. 401 when the token is missing, expired or invalid; 404 when the assistant or the experiment is not in the tenant; 503 when experiments are not available.","operationId":"getAssistantExperiment","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"experiment_id","required":true,"schema":{"format":"uuid","title":"Experiment Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentResultsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or experiment."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Experiments are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One experiment with its results","tags":["experiments"],"x-min-role":"viewer"}},"/v1/assistants/{assistant_id}/experiments/{experiment_id}/promote":{"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above ends the experiment (running or stopped) and publishes a copy of the winner's config as the assistant's newest version, so every contact gets it from now on. `version` must be one of the experiment's variants. The new version number is `promoted_version` of the answer. The draft is not touched: if it differs from the winner the assistant shows as having unpublished changes. Audited as `experiment.promote` and `assistant.publish`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant or the experiment is not in the tenant; 409 when it was already promoted; 422 when `version` is not a variant; 503 when experiments are not available.","operationId":"promoteAssistantExperiment","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"experiment_id","required":true,"schema":{"format":"uuid","title":"Experiment Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteExperimentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or experiment."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The experiment is in another state."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Experiments are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Make the winning version the assistant's published version","tags":["experiments"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/experiments/{experiment_id}/stop":{"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above ends a running experiment without choosing a winner: new attempts and sessions get the latest published version again. Its results stay. Audited as `experiment.stop`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant or the experiment is not in the tenant; 409 when it already ended; 503 when experiments are not available.","operationId":"stopAssistantExperiment","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"experiment_id","required":true,"schema":{"format":"uuid","title":"Experiment Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or experiment."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The experiment is in another state."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Experiments are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Stop an experiment","tags":["experiments"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/publish":{"post":{"description":"An `editor` or above snapshots the current draft into a new immutable version: `latest_version` goes up by one, `published_version_id` is the new version and `status` becomes `published`. The agent worker resolves that version by its id and a published version never changes. The change is written to the audit log as `assistant.publish` with the version numbers, never the content. The version records the author and the optional `change_note` (up to 500 characters after trimming whitespace). 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 409 when the draft is the published version, so there is nothing new to publish, or with a code: `assistant_archived` (the assistant is archived), `tests_failing` (a test case gating the publication fails or has not run on this draft), `mcp_tool_changed` (an MCP tool changed or is no longer allowed since it was approved), `mcp_server_unreachable` (an MCP server could not be checked) or `draft_changed` (the draft changed while publishing: try again); 422 when the id or body is invalid; 503 when assistants are not available.","operationId":"publishAssistant","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PublishAssistantRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDetail"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Nothing new to publish, or a code of the description."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Publish the draft as a new version","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/restore":{"post":{"description":"An `editor` or above makes an archived assistant appear again in the list and the pickers, as it was. Restoring an assistant that is not archived answers 200 and changes nothing. Written to the audit log as `assistant.restore`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 503 when assistants are not available.","operationId":"restoreAssistant","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSummary"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Bring an archived assistant back","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/talk-sessions":{"post":{"description":"An `editor` or above opens a test session: the control plane creates a LiveKit room, sends the agent worker to it and returns what the browser needs to join: `livekit_url` (the public wss URL), a `token` (a LiveKit JWT for that room only: it can publish the microphone and subscribe, and expires after `expires_in` seconds, 900), `room` and `session_id`. By default the agent runs the published version of the assistant; `use_draft` `true` runs the current draft instead, which is sent to the worker with the session and never becomes a version. An assistant that was never published is `409` unless `use_draft` is `true`. `variables` are the test values of the `{{name}}` the prompts use (up to 50, each `string`, `money`, `date` or `phone` as in a call dispatch); a variable the prompts need and the session does not give ends the session with an error event, as a refused call. The call result of the session is reported like any call, with `source` `talk`. Each organization may open a bounded number of sessions per minute; above it the answer is `429` with `Retry-After`. The session is audited as `talk_session.create` with ids only, never variable values. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the assistant does not exist in the caller's tenant; 409 when there is no published version and `use_draft` is not set; 413 when the draft is too large to send; 422 when the body is invalid; 503 when Talk is not configured or the media server cannot be reached.","operationId":"createTalkSession","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTalkSessionRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TalkSessionResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Never published and `use_draft` is false."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The draft is too large to send."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many sessions; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before the next session.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Talk is unavailable, or no voice worker starts within the assignment deadline (code: voice_capacity_unavailable)."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Start a test conversation with an assistant in the browser","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/test-calls":{"post":{"description":"An `editor` or above makes the assistant call `phone_number` (E.164) for real, to try it before a campaign. The call goes out through the platform's outbound trunk showing `caller_id_id` (one of the organization's caller IDs; the oldest when omitted). With telephony-managed ANI, caller-ID selection is ignored and telephony selects the ANI. Like Talk, it runs the published version, or the current draft when `use_draft` is `true`, and `variables` are the test values of the `{{name}}` the prompts use. The answer is `202` with the `call_id` and `status` `dialing`: the phone is dialed in the background and the agent joins once it is answered. Read the progress with `GET /v1/assistants/{assistant_id}/test-calls/{call_id}`. The call is recorded like any call (channel `sip`, direction `outbound`, `test` true in the call log) and its usage is metered, but it belongs to no campaign and is left out of the metrics. A number on the organization's do-not-call list is refused. Each organization, and each number, may place a bounded number per minute; above it the answer is `429` with `Retry-After`. The call is audited as `test_call.create` with the last four digits, never the number. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; `outbound_trunk_id` optionally selects a usable assigned organization trunk; otherwise the organization default is used. Foreign or unusable selections return 422 `invalid_outbound_trunk`. 404 when the assistant does not exist in the caller's tenant; 409 with code `not_published` (never published and `use_draft` is not set), `no_outbound_trunk`, `no_caller_id` or `number_do_not_call`; 413 when the draft is too large to send; 422 when the body is invalid or the code is `caller_id_not_found`; 503 `call_test_unavailable`.","operationId":"createCallTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCallTestRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTestResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or test call."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`not_published`, `no_outbound_trunk`, `no_caller_id` or `number_do_not_call`."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The draft is too large to send."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many calls; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before the next call.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `call_test_unavailable`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Call a phone to try an assistant","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/test-calls/{call_id}":{"get":{"description":"An `editor` or above. `status` is `dialing` while the phone rings, `in_progress` once it was answered, `completed` when the call ended and `failed` with a `failure_reason` when nobody took it (`no_answer`, `busy`, `rejected`, `unavailable`, `timeout`). The detail of the conversation, once it exists, is `GET /v1/calls/{call_id}`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the test call does not exist for that assistant in the caller's tenant; 503 `call_test_unavailable`.","operationId":"getCallTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"call_id","required":true,"schema":{"format":"uuid","title":"Call Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTestResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or test call."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `call_test_unavailable`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Progress of a test call","tags":["assistants"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/tests":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. Each case carries `last_run`, its newest run on any target, or `null` when it never ran. 401 when the token is missing, expired or invalid; 404 when the assistant is not in the tenant; 503 when tests are not available.","operationId":"listAssistantTests","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the test cases of an assistant","tags":["tests"],"x-min-role":"viewer"},"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. A test case plays the assistant against a simulated caller: `persona` says who the caller is, what they want and how they behave (for example \"cannot pay, gets angry, asks for a person\"); `variables` are the values of the `{{name}}` the prompts use; `max_turns` (1 to 40, default 12) bounds the conversation. `assertions` are checked after the conversation: `criterion` (`text`, a success criterion in plain language judged by an LLM, with a rationale), `tool_called` (`name`, optional `arguments` that must match, `match` `equals`, `contains` or `regex`), `tool_not_called`, `reached_step` (a step of the conversation tree), `ended_with` (`completed`, `transferred`, `caller_hangup` or `max_turns`), `said` and `not_said` (a phrase the assistant said, ignoring case). `tool_mocks` give a tool a canned `response` (or an error) so no real API is called: a mock names the `tool` and may require `arguments` to match; with `tool_mode` `mock` (default) a tool without a mock answers a stub, with `live` the real tool is called. A knowledge search is mocked by the name `search_kb_<first 8 hex of the base id>`. An assistant has up to 100 cases. Audited as `assistant_test.create`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant is not in the tenant; 409 when it has the most cases; 422 when the body is invalid; 503 when tests are not available.","operationId":"createAssistantTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create a test case for an assistant","tags":["tests"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/tests/runs":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. Filter by `test_id`, `batch_id` (the runs of one \"run all\"), `status` (`queued`, `running`, `passed`, `failed` or `error`) or `config_hash`. `limit` is at most 200 (default 50). 401 when the token is missing, expired or invalid; 404 when the assistant is not in the tenant; 503 when tests are not available.","operationId":"listAssistantTestRuns","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"query","name":"test_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Test Id"}},{"in":"query","name":"batch_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Batch Id"}},{"in":"query","name":"status","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunStatus-Input"},{"type":"null"}],"title":"Status"}},{"in":"query","name":"config_hash","required":false,"schema":{"anyOf":[{"maxLength":64,"minLength":64,"type":"string"},{"type":"null"}],"title":"Config Hash"}},{"in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The runs of an assistant's tests, newest first","tags":["tests"],"x-min-role":"viewer"},"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. Queues one run for each case in `test_ids`, or for every case of the assistant when it is left out. `target` `draft` (default) plays the current draft, which is what a publish would ship; `published` plays the live version (`409` when it was never published). The runs share a `batch_id` and are played asynchronously by the simulation runner: poll `GET .../tests/runs?batch_id=` until no run is `queued` or `running`. Each run keeps the config it ran against (`config_hash`), the transcript, the verdict of each assertion, the tool calls, the tree steps, the tokens and the duration. The assistant, the simulated caller and the judge all use the assistant's own provider. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant or a case is not in the tenant; 409 when `published` is asked and there is no published version; 429 when too many runs of the assistant are waiting; 503 when tests are not available.","operationId":"runAssistantTests","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunTestsRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsStarted"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Run the tests of an assistant","tags":["tests"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/tests/runs/{run_id}":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. `result` is `null` until the run is finished. 401 when the token is missing, expired or invalid; 404 when the assistant or the run is not in the tenant; 503 when tests are not available.","operationId":"getAssistantTestRun","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"run_id","required":true,"schema":{"format":"uuid","title":"Run Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One run with its transcript and verdicts","tags":["tests"],"x-min-role":"viewer"}},"/v1/assistants/{assistant_id}/tests/settings":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. 401 when the token is missing, expired or invalid; 404 when the assistant is not in the tenant; 503 when tests are not available.","operationId":"getAssistantTestSettings","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSettingsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Whether publishing needs the tests to pass","tags":["tests"],"x-min-role":"viewer"},"put":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. With `require_pass_before_publish` `true`, `POST /v1/assistants/{id}/publish` answers `409` with code `tests_failing` unless every case has a run that passed on the current draft; the message links the runs to look at. An assistant without cases publishes freely. Audited as `assistant_test.require`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant is not in the tenant; 503 when tests are not available.","operationId":"updateAssistantTestSettings","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSettingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSettingsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Require the tests to pass before publishing","tags":["tests"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/tests/{test_id}":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. 401 when the token is missing, expired or invalid; 404 when the assistant or the case is not in the tenant; 503 when tests are not available.","operationId":"getAssistantTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"test_id","required":true,"schema":{"format":"uuid","title":"Test Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One test case","tags":["tests"],"x-min-role":"viewer"},"put":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above replaces the whole case (same body as create). Runs already made keep the case as it was when they ran. Audited as `assistant_test.update`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant or the case is not in the tenant; 422 when the body is invalid; 503 when tests are not available.","operationId":"updateAssistantTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"test_id","required":true,"schema":{"format":"uuid","title":"Test Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Replace a test case","tags":["tests"],"x-min-role":"editor"},"delete":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. Audited as `assistant_test.delete`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant or the case is not in the tenant; 503 when tests are not available.","operationId":"deleteAssistantTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"test_id","required":true,"schema":{"format":"uuid","title":"Test Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a test case and its runs","tags":["tests"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/tests/{test_id}/runs":{"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. Queues a run of the case against `target` (`draft` by default, or `published`); see `runAssistantTests` for how runs are played and read. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the assistant or the case is not in the tenant; 409 when `published` is asked and there is no published version; 429 when too many runs are waiting; 503 when tests are not available.","operationId":"runAssistantTest","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"test_id","required":true,"schema":{"format":"uuid","title":"Test Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunTestRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant, test or run."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tests are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Run one test case","tags":["tests"],"x-min-role":"editor"}},"/v1/assistants/{assistant_id}/versions":{"get":{"description":"List numbered published versions, newest first, including for an archived assistant.","operationId":"listAssistantVersions","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantVersionList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks assistants:read."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or version in this tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List Assistant Versions","tags":["assistants"],"x-api-key-scope":"assistants:read","x-min-role":"viewer"}},"/v1/assistants/{assistant_id}/versions/{version_id}":{"get":{"description":"Read the immutable snapshot of a published version of this assistant.","operationId":"getAssistantVersion","parameters":[{"in":"path","name":"assistant_id","required":true,"schema":{"format":"uuid","title":"Assistant Id","type":"string"}},{"in":"path","name":"version_id","required":true,"schema":{"format":"uuid","title":"Version Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantVersionDetail"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key lacks assistants:read."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such assistant or version in this tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Assistants are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Get Assistant Version","tags":["assistants"],"x-api-key-scope":"assistants:read","x-min-role":"viewer"}},"/v1/audit-log":{"get":{"description":"Append-only record of changes, newest first: the actor (a web `user` or an `api_key`), the action (`<resource>.<verb>`, for example `invitation.create`), the resource, and the snapshots `before` and `after` (null when there was none). Values of secret fields are replaced by `[redacted]` before they are stored. An `admin` or `owner` reads the log of the organization in their access token; there is no way to name another one. Filters are exact matches; `since` is inclusive and `until` exclusive, both with a time zone. Pass `next_cursor` as `cursor` to read the next page. 401 when the token is missing, expired or invalid; 403 when the caller is below `admin`; 422 for an invalid filter, cursor or limit; 503 when the log is not available.","operationId":"listAuditLog","parameters":[{"in":"query","name":"actor_id","required":false,"schema":{"anyOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Actor Id"}},{"in":"query","name":"action","required":false,"schema":{"anyOf":[{"maxLength":100,"minLength":1,"type":"string"},{"type":"null"}],"title":"Action"}},{"in":"query","name":"resource_type","required":false,"schema":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Resource Type"}},{"in":"query","name":"resource_id","required":false,"schema":{"anyOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Resource Id"}},{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":512,"minLength":1,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogPageResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is below `admin`."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"A filter, the cursor or the limit is invalid."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The audit log is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Who changed what in my organization","tags":["audit"],"x-min-role":"admin"}},"/v1/audit-log/export":{"get":{"description":"Every entry of the organization that matches the filters, newest first, as NDJSON: one JSON object per line, each shaped like an item of `listAuditLog`, read page by page so a large log does not sit in memory. The response is a download (`Content-Disposition`). Same access and filters as `listAuditLog`, without `limit` and `cursor`. The last line is always the trailer `{\"complete\": true, \"count\": N}`, where N is the number of entries before it. A file without the trailer, or with a different count, is cut (the status is sent before the first line, so a broken connection cannot change it): read it again. An organization may start a limited number of exports per minute. 401, 403, 422 and 503 as in `listAuditLog`; 429 when the organization exports too often (see `Retry-After`); 503 also when the rate-limit store cannot be reached.","operationId":"exportAuditLog","parameters":[{"in":"query","name":"actor_id","required":false,"schema":{"anyOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Actor Id"}},{"in":"query","name":"action","required":false,"schema":{"anyOf":[{"maxLength":100,"minLength":1,"type":"string"},{"type":"null"}],"title":"Action"}},{"in":"query","name":"resource_type","required":false,"schema":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Resource Type"}},{"in":"query","name":"resource_id","required":false,"schema":{"anyOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Resource Id"}},{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}}],"responses":{"200":{"content":{"application/x-ndjson":{"schema":{"type":"string"}}},"description":"One audit entry per line, then the trailer line."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is below `admin`."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"A filter, the cursor or the limit is invalid."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many exports; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The audit log or the rate-limit store is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Export the audit log","tags":["audit"],"x-min-role":"admin"}},"/v1/caller-ids":{"get":{"description":"Any signed-in member (not an API key). The numbers the organization may show when its campaigns call, oldest first. A campaign chooses among them with its `caller_id` strategy. This is configuration: routing a call over a real trunk with that number needs SIP, which is not live yet. 401 when the token is missing, expired or invalid; 503 until caller IDs are deployed.","operationId":"listCallerIds","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerIdList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Caller IDs are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Caller IDs of my organization","tags":["campaigns"],"x-min-role":"viewer"},"post":{"description":"An `admin` or above (not an API key) adds a number (`phone_e164`, E.164) with a `label` of 1 to 60 characters. An organization has at most 50. Audited as `caller_id.create` with the id and label only, never the number. 401 when the token is missing, expired or invalid; 403 below `admin`; 409 `caller_id_taken` when the organization has the number already, 409 `caller_id_limit` when it has 50; 422 when the body is invalid; 503 until caller IDs are deployed.","operationId":"createCallerId","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCallerIdRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerIdResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`caller_id_taken` (the number exists), `caller_id_limit` (50 reached) or `caller_id_in_use` (a campaign uses it)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Caller IDs are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Add a caller ID","tags":["campaigns"],"x-min-role":"admin"}},"/v1/caller-ids/{caller_id}":{"delete":{"description":"An `admin` or above (not an API key). A number that a draft, running or paused campaign uses as its `fixed` caller ID is `409` `caller_id_in_use`: change or cancel the campaign first. Audited as `caller_id.delete`. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when the number is not the organization's; 503 until caller IDs are deployed.","operationId":"deleteCallerId","parameters":[{"in":"path","name":"caller_id","required":true,"schema":{"format":"uuid","title":"Caller Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such caller ID in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`caller_id_taken` (the number exists), `caller_id_limit` (50 reached) or `caller_id_in_use` (a campaign uses it)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Caller IDs are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Remove a caller ID","tags":["campaigns"],"x-min-role":"admin"}},"/v1/calls":{"get":{"description":"Every call of the organization, real and simulated, newest first. Any signed-in member reads it. Filters: `since` (inclusive) and `until` (exclusive) on the start time, `assistant_id`, `campaign_id`, `outcome` (`answered`, `busy`, `no_answer`, `voicemail`, `failed`, `dnc`), `end_reason`, `direction` and `q`, a text matched against the last digits of the phone number, the start of the call id and, for a campaign call, a value of its contact's file that the reports show as it is (a DNI, a name; part of it, ignoring case; never a phone number or e-mail address the reports redact), `sentiment` (`positive`, `neutral`, `negative`) and `criterion` (the id of a success criterion) with `criterion_result` (`success`, `failure`, `unknown`) from the post-call analysis. Each item has the assistant (id, name when it still exists, version), the immutable `assistant_version_id` when known, the campaign, the outcome, the end reason, the cost estimate, `sentiment` (null when not analyzed) and `phone_last4`, never the full number. `simulated` marks a campaign attempt without a worker call record. Pass `next_cursor` as `cursor` to read the next page; `limit` is at most 200 (default 100). 401 when the token is missing, expired or invalid; 422 for an invalid filter, cursor or limit; 503 when the call log is not available.","operationId":"listCalls","parameters":[{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"assistant_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"}},{"in":"query","name":"campaign_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Campaign Id"}},{"in":"query","name":"outcome","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Outcome"},{"type":"null"}],"title":"Outcome"}},{"in":"query","name":"end_reason","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EndReason"},{"type":"null"}],"title":"End Reason"}},{"in":"query","name":"direction","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Direction"},{"type":"null"}],"title":"Direction"}},{"in":"query","name":"q","required":false,"schema":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Q"}},{"description":"The sentiment of the post-call analysis.","in":"query","name":"sentiment","required":false,"schema":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}],"description":"The sentiment of the post-call analysis.","title":"Sentiment"}},{"description":"Id of a success criterion of the assistant; the call was analyzed.","in":"query","name":"criterion","required":false,"schema":{"anyOf":[{"pattern":"^[a-z][a-z0-9_]{0,39}$","type":"string"},{"type":"null"}],"description":"Id of a success criterion of the assistant; the call was analyzed.","title":"Criterion"}},{"description":"How `criterion` was judged. Needs `criterion`.","in":"query","name":"criterion_result","required":false,"schema":{"anyOf":[{"enum":["success","failure","unknown"],"type":"string"},{"type":"null"}],"description":"How `criterion` was judged. Needs `criterion`.","title":"Criterion Result"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"minLength":1,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallPage"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"A filter, the cursor or the limit is invalid."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The call log is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The call log of my organization","tags":["calls"],"x-min-role":"viewer"}},"/v1/calls/{call_id}":{"get":{"description":"Any signed-in member. The fields of the list item plus `timeline` (the stored events in order: the call start, the answer, answering machine detection, each turn, tool calls, transfers, tree transitions and decisions, the end), `latencies` per turn, `tree_path`, `cost` (usage and the estimate; `components` is empty when the cost was reported as one total), and the result: `structured_output` and `guardrail_violations`, redacted like the `call.result` event. Only what is stored is shown: events carry no text and the assistant's tool arguments and the caller's data are not kept. `transcript` is what was said (`role`, `text`, `started_at_ms`, `ended_at_ms`, `interrupted`, `step`), read from the private transcripts bucket, with `transcript_info` (language, whether the call was cut, expiry); both are null when there is none, it expired (90 days by default) or transcripts are not configured. `recording` is the audio recording (`status`, `duration_seconds`, `bytes`, `expires_at`; never a link, see `GET /v1/calls/{call_id}/recording`); null when the call was not recorded, it expired (90 days by default) or recordings are not configured. `analysis` is the post-call analysis: `summary`, one result with `rationale` per success criterion and the `sentiment`; null when the assistant has none. Reading a call that has a transcript is audited as `transcript.view` (ids only); a viewer sees the transcript here, while exporting it is `downloadCallTranscript`, editors only. A simulated call has none of these. 401 when the token is missing, expired or invalid; 404 when the call is not in the caller's organization; 503 when the call log is not available.","operationId":"getCall","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"format":"uuid","title":"Call Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetailResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such call in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The call log is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One call with its timeline","tags":["calls"],"x-min-role":"viewer"}},"/v1/calls/{call_id}/recording":{"get":{"description":"An `editor` or above. Returns a presigned URL (valid 5 minutes by default) the browser plays or downloads straight from the private recordings bucket; nothing is proxied. `download=true` signs it as an attachment. Audited as `recording.read` before the URL is made (ids only, never the URL). 401 when the token is missing, expired or invalid; 403 for a `viewer`; 404 when the call has no ready recording in the caller's organization; 429 above the export rate; 503 when recordings are not available.","operationId":"getCallRecording","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"format":"uuid","title":"Call Id","type":"string"}},{"in":"query","name":"download","required":false,"schema":{"default":false,"title":"Download","type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingLinkResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The member's role is too low."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No ready recording for that call (not recorded, still uploading, failed, expired or deleted)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Links are requested too often.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Recordings are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"A short-lived link to the audio of a call","tags":["calls"],"x-min-role":"editor"},"delete":{"description":"An `admin` or above. Removes the object from the bucket and its pointer; the call stays. Audited as `recording.delete` (ids only) before anything is removed. 204 on success; 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when the call has no recording; 503 when recordings are not available.","operationId":"deleteCallRecording","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"format":"uuid","title":"Call Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The member's role is too low."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No ready recording for that call (not recorded, still uploading, failed, expired or deleted)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Recordings are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete the audio recording of a call","tags":["calls"],"x-min-role":"admin"}},"/v1/calls/{call_id}/transcript":{"get":{"description":"An `editor` or above: viewing the transcript inside `getCall` is audited as `transcript.view` and open to any member, exporting the file is not. `format=txt` (default) is plain text, one line per turn (`[mm:ss] Role: text`); `format=json` is the stored document (`schema_version`, `call_id`, `source`, `language`, `truncated`, `omitted_turns` and `turns`). Sent as an attachment. Audited as `transcript.read` before the first byte; the text is never logged. 401 when the token is missing, expired or invalid; 403 for a `viewer`; 404 when the call has no transcript in the caller's organization; 429 above the export rate; 503 when transcripts are not available.","operationId":"downloadCallTranscript","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"format":"uuid","title":"Call Id","type":"string"}},{"in":"query","name":"format","required":false,"schema":{"default":"txt","enum":["txt","json"],"title":"Format","type":"string"}}],"responses":{"200":{"content":{"application/json":{},"text/plain":{}},"description":"The transcript file."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The member's role is too low."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No transcript for that call (never stored, expired or deleted)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Downloads are too frequent.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Transcripts are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Download the transcript of a call","tags":["calls"],"x-min-role":"editor"},"delete":{"description":"An `admin` or above. Removes the object from the bucket and its pointer; the call and its timeline stay. Audited as `transcript.delete` (ids only) before anything is removed. 204 on success; 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when the call has no transcript; 503 when transcripts are not available.","operationId":"deleteCallTranscript","parameters":[{"in":"path","name":"call_id","required":true,"schema":{"format":"uuid","title":"Call Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The member's role is too low."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No transcript for that call (never stored, expired or deleted)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Transcripts are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete the transcript of a call","tags":["calls"],"x-min-role":"admin"}},"/v1/campaigns":{"get":{"description":"Any signed-in member of the tenant, or an API key with `campaigns:read`. Each item is a campaign with its configuration and `counters`, newest first. `status` keeps one status. Pass `next_cursor` of a page as `cursor` to get the next one; it is `null` on the last page and the cursor is opaque. `limit` is at most 200 (default 100). 401 when the token is missing, expired or invalid; 422 when a parameter is out of range or the cursor is not one we issued; 503 until campaigns are deployed.","operationId":"listCampaigns","parameters":[{"in":"query","name":"status","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CampaignStatus"},{"type":"null"}],"title":"Status"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPage"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the campaigns of my organization","tags":["campaigns"],"x-api-key-scope":"campaigns:read","x-min-role":"viewer"},"post":{"description":"An `editor` or above creates a campaign as a `draft` from a `completed` contact import of the tenant. `outbound_trunk_id` selects an owned Eco trunk UUID; null follows the organization default, and a foreign or unknown selection is 422 `invalid_outbound_trunk`. The import's accepted contacts (phone and variables) are copied into the campaign at this moment, so later changes to the import or the do-not-call list do not edit the list, although the do-not-call list is checked again before every call. `assistant_id` must identify a non-archived assistant in the tenant with a published version. `schedule` has the allowed `weekdays` (ISO, 1 Monday to 7 Sunday) and a daily window `window_start` to `window_end` (`HH:MM`, local, start before end) in which a call may start. `extra_windows` (up to 6) add ranges: each has its own `weekdays`, `start` and `end`, so a day can have two ranges (9 to 13 and 15 to 20) and another weekday its own; ranges on one weekday must not overlap. `skip_dates` (up to 100 dates, `YYYY-MM-DD`) are days without calls, and `skip_holidays` skips the national holidays of `holiday_country` (`AR`, calendar 2026 and 2027, default off). `max_attempts_per_day` (1 to 10) caps the attempts per contact in a local day and `daily_call_cap` the attempts of the whole campaign in a day of its time zone. The windows are read in the contact's own time zone when the import had a `timezone` variable with an IANA name (for example `America/Argentina/Cordoba`), and in the campaign's `timezone` otherwise (default `America/Argentina/Buenos_Aires`). `retry`: a contact is tried at most `max_attempts` times (1 to 10, default 3), waiting `retry_delay_minutes` (1 to 1440, default 60) after an attempt that ended in one of `retry_on` (`busy`, `no_answer`, `voicemail`, `failed`; default `busy` and `no_answer`). `retry.rules` (up to 4, one per outcome) override that per outcome: `delay_minutes` (1 to 10,080; 1440 is the next day) and an optional `max_attempts` for attempts that ended that way (busy every 15 minutes up to 3 times, no answer every 2 hours up to 4, voicemail the next day). A `failed` call that the dialer reports as `permanent` is never retried. `priority` (1 to 10, default 5) weights the share of the free call slots a campaign gets when several of the organization run at once. `caller_id` (default `{strategy: none}`) sets the number shown to the contact: `fixed` with `caller_id_id`, `round_robin` over the organization's caller IDs, or `area_code` (the number closest to the contact's area code). The selected caller ID is used for real SIP calls. `422` when `caller_id_id` is not one of the organization's. `recording` (default null) overrides the assistant version's audio recording setting for this campaign: true records, false does not, null follows the assistant. `cps` (1 to 50, default 1) is how many calls start per second and `max_concurrency` (1 to 200, default 10) how many calls are open at once. Calls go out through the organization's outbound trunk; without one, start answers 409 `no_outbound_trunk`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 409 when the import does not exist in the tenant, is not `completed` or accepted no contact; 422 when the body is invalid, `timezone` is not a known IANA name (`invalid_timezone`) or the assistant does not exist in the tenant or has never been published (`assistant_not_published`) or is archived (`assistant_archived`); 503 until campaigns are deployed.","operationId":"createCampaign","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The campaign is not in a state for this."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create a campaign draft","tags":["campaigns"],"x-api-key-scope":"campaigns:write","x-min-role":"editor"}},"/v1/campaigns/{campaign_id}":{"get":{"description":"Any signed-in member of the tenant, or an API key with `campaigns:read`. `counters` has the contacts by state (`pending`, `in_progress`, `done`), the done contacts by the outcome that closed them, the closed attempts by outcome and `progress`, `contacts_done` over `contacts_total`. A campaign is `completed` when every contact is done. 401 when the token is missing, expired or invalid; 404 when the campaign does not exist in the caller's tenant; 503 until campaigns are deployed.","operationId":"getCampaign","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One campaign with its counters","tags":["campaigns"],"x-api-key-scope":"campaigns:read","x-min-role":"viewer"}},"/v1/campaigns/{campaign_id}/attempts":{"get":{"description":"Any signed-in member of the tenant, or an API key with `campaigns:read`. Attempts are newest first. `outcome` keeps the attempts that ended with it (`answered`, `busy`, `no_answer`, `voicemail`, `failed`, `dnc`). An attempt still on the line has `status` `in_progress` and no `outcome`. Released dispatches remain visible without an outcome filter. `dispatch_sequence` counts every dispatch per contact; `attempt_number` is the retry-budget position. `failure_kind` preserves the recorded failure classification. `assistant_version` and `assistant_version_id` identify the assigned snapshot when known. `phone_last4` is the end of the number; the number itself is not returned. Paging as in `GET /v1/campaigns`. 401 when the token is missing, expired or invalid; 404 when the campaign does not exist in the caller's tenant; 422 when a parameter is invalid; 503 until campaigns are deployed.","operationId":"listCampaignAttempts","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"query","name":"outcome","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Outcome"},{"type":"null"}],"title":"Outcome"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptPage"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Call attempts of a campaign","tags":["campaigns"],"x-api-key-scope":"campaigns:read","x-min-role":"viewer"}},"/v1/campaigns/{campaign_id}/cancel":{"post":{"description":"An `editor` or above cancels a `draft`, `running` or `paused` campaign for good: no new call starts, calls in progress finish and are not retried. Answers the campaign. Statuses move `draft` to `running`, `running` to `paused` and back, and any of those to `cancelled`; `completed` is reached when the last contact is done. Every change is written to the audit log. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the campaign does not exist in the caller's tenant; 409 when the campaign is not in a status that allows it, or, to start or resume, `no_outbound_trunk` (the campaign has no usable owned outbound trunk on the media server) or `no_caller_id` (the organization has no caller ID); 503 until campaigns are deployed.","operationId":"cancelCampaign","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The campaign is not in a state for this."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Cancel a campaign","tags":["campaigns","campaigns"],"x-api-key-scope":"campaigns:write","x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/experiment":{"get":{"operationId":"getCampaignExperiment","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignTrialResponse"}}},"description":"Successful Response"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Compare the variants of a campaign version trial","tags":["campaigns"],"x-api-key-scope":"campaigns:read","x-min-role":"viewer"}},"/v1/campaigns/{campaign_id}/optimizer":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. The optimizer is a scheduled agent that reads the campaign's calls and its assistant's A/B experiments and proposes (or, in `auto` mode, applies within `guardrails`) starting, stopping or promoting an experiment, and writes a report each run. Off until an `editor` turns it on; `available` is false when the platform has it off. 401, 404 when the campaign is not in the tenant, 503.","operationId":"getCampaignOptimizer","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The campaign optimizer's settings","tags":["campaigns"],"x-min-role":"viewer"},"put":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. Turned on, the first run is due at once and the next ones every `cadence_minutes`. In `auto` mode the optimizer acts on its own within the `guardrails`, and only stops or promotes experiments it started; every action is audited (actor kind `optimizer`). Audited as `optimizer.settings.update`. 401, 403 below `editor`, 404, 409 `optimizer_unavailable` when turning it on while the platform has it off, 422 for a cadence out of range or guardrails that do not hold together, 503.","operationId":"updateCampaignOptimizer","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOptimizerRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Off for the platform, or already decided."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Turn the campaign optimizer on or off and set its mode and guardrails","tags":["campaigns"],"x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/optimizer/proposals":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member; `status` filters (e.g. `pending`). 401, 404, 503.","operationId":"listCampaignOptimizerProposals","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"query","name":"status","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProposalStatus"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The optimizer's proposals of a campaign, newest first","tags":["campaigns"],"x-min-role":"viewer"}},"/v1/campaigns/{campaign_id}/optimizer/proposals/{proposal_id}/approve":{"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. Starts, stops or promotes the experiment as the caller would from the experiments endpoints, with their rules and audit entries. When the experiments changed since it was proposed the answer is the proposal with status `failed` and the reason in `error` (`experiment_running`, `experiment_closed`, `experiment_not_found` or a validation code). Audited as `optimizer.proposal.approve`. 401, 403, 404, 409 `proposal_closed` when it was already decided, 503.","operationId":"approveCampaignOptimizerProposal","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","title":"Proposal Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Off for the platform, or already decided."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Approve a pending proposal: it is applied as the caller","tags":["campaigns"],"x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/optimizer/proposals/{proposal_id}/reject":{"post":{"description":"Signed-in users only (an API key cannot call it yet). An `editor` or above. Nothing changes. Audited as `optimizer.proposal.reject`. 401, 403, 404, 409 `proposal_closed`, 503.","operationId":"rejectCampaignOptimizerProposal","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"path","name":"proposal_id","required":true,"schema":{"format":"uuid","title":"Proposal Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Off for the platform, or already decided."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Reject a pending proposal","tags":["campaigns"],"x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/optimizer/runs":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. At most `limit` (1 to 50). 401, 404, 503.","operationId":"listCampaignOptimizerRuns","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":20,"maximum":50,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerRunList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The optimizer's runs of a campaign, newest first","tags":["campaigns"],"x-min-role":"viewer"}},"/v1/campaigns/{campaign_id}/optimizer/runs/{run_id}":{"get":{"description":"Signed-in users only (an API key cannot call it yet). Any signed-in member. 401, 404, 503.","operationId":"getCampaignOptimizerRun","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"path","name":"run_id","required":true,"schema":{"format":"uuid","title":"Run Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizerRunDetail"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign, run or proposal."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The optimizer is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One optimizer run with its report and what it proposed","tags":["campaigns"],"x-min-role":"viewer"}},"/v1/campaigns/{campaign_id}/outbound-trunk":{"put":{"description":"An editor or above selects an assigned organization trunk, or null to follow its default. Changes affect future leases only. Foreign or unusable selections return 422 invalid_outbound_trunk. 404 when the campaign is not in the caller's tenant; 503 when campaigns are not available or, `sip_unavailable`, SIP management is not.","operationId":"updateCampaignTrunk","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCampaignTrunkRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `invalid_outbound_trunk`, or the body is invalid."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet, or SIP management is not (`sip_unavailable`)."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Change the outbound trunk of a campaign","tags":["campaigns"],"x-api-key-scope":"campaigns:write","x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/pause":{"post":{"description":"An `editor` or above pauses a `running` campaign: no new call starts; calls in progress finish. Answers the campaign. Statuses move `draft` to `running`, `running` to `paused` and back, and any of those to `cancelled`; `completed` is reached when the last contact is done. Every change is written to the audit log. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the campaign does not exist in the caller's tenant; 409 when the campaign is not in a status that allows it, or, to start or resume, `no_outbound_trunk` (the campaign has no usable owned outbound trunk on the media server) or `no_caller_id` (the organization has no caller ID); 503 until campaigns are deployed.","operationId":"pauseCampaign","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The campaign is not in a state for this."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Pause a running campaign","tags":["campaigns","campaigns"],"x-api-key-scope":"campaigns:write","x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/resume":{"post":{"description":"An `editor` or above resumes a `paused` campaign. Answers the campaign. Statuses move `draft` to `running`, `running` to `paused` and back, and any of those to `cancelled`; `completed` is reached when the last contact is done. Every change is written to the audit log. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the campaign does not exist in the caller's tenant; 409 when the campaign is not in a status that allows it, or, to start or resume, `no_outbound_trunk` (the campaign has no usable owned outbound trunk on the media server) or `no_caller_id` (the organization has no caller ID); 503 until campaigns are deployed.","operationId":"resumeCampaign","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The campaign is not in a state for this."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Resume a paused campaign","tags":["campaigns","campaigns"],"x-api-key-scope":"campaigns:write","x-min-role":"editor"}},"/v1/campaigns/{campaign_id}/start":{"post":{"description":"An `editor` or above starts a `draft` campaign: it becomes `running`, the `campaign.started` event is published in the same transaction, and calls begin inside the window. Answers the campaign. Statuses move `draft` to `running`, `running` to `paused` and back, and any of those to `cancelled`; `completed` is reached when the last contact is done. Every change is written to the audit log. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the campaign does not exist in the caller's tenant; 409 when the campaign is not in a status that allows it, or, to start or resume, `no_outbound_trunk` (the campaign has no usable owned outbound trunk on the media server) or `no_caller_id` (the organization has no caller ID); 503 until campaigns are deployed.","operationId":"startCampaign","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The campaign is not in a state for this."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Start a draft campaign","tags":["campaigns","campaigns"],"x-api-key-scope":"campaigns:write","x-min-role":"editor"}},"/v1/capabilities":{"get":{"description":"Any signed-in member. Tells a client which optional features work in this environment, so it can hide or disable them instead of letting people try and fail. `assistant_builder.available` is `true` when the AI builder (`POST /v1/assistant-builder/messages`) has a model to run on for the caller's organization and `false` when it would answer `503` `builder_not_configured`. Asking does not send a message to the model and does not count against the builder's rate limit or budget. `answering_machine_detection.available` is `true` when the platform's audio detector of answering machines is deployed, so the `audio` voicemail detector of an assistant screens its outbound phone calls; `false` when that detector does nothing. 401 when the token is missing, expired or invalid; 403 with code `organization_suspended` when the organization is suspended; 503 when authentication is not available.","operationId":"getCapabilities","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitiesResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `organization_suspended`: the organization is suspended."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Authentication is not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"What this environment can do for my organization","tags":["identity"]}},"/v1/contact-imports":{"post":{"description":"An `editor` or above declares a CSV or XLSX file (`filename`, `format`, `size_bytes` up to 50 MiB) and which columns hold the phone and the call variables (`column_mapping`: `phone` is a header, `variables` maps a variable name to a header). The answer is the import in `awaiting_upload` and a presigned `upload_url`: send the file to it with an HTTP `PUT`, with exactly `size_bytes` bytes, before `upload_expires_at`. The URL grants one object, in the caller's own tenant, and nothing else; `filename` is a label and never part of the storage path. Then call `POST /v1/contact-imports/{id}/complete`. The tenant is the one in the caller's access token. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the body is invalid or `size_bytes` is over the limit; 503 until contact imports are deployed (clients must not be built against this operation before then).","operationId":"createContactImport","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactImportRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportCreatedResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Contact imports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Start importing a contact file","tags":["contacts"],"x-api-key-scope":"contacts:write","x-min-role":"editor"}},"/v1/contact-imports/{import_id}":{"get":{"description":"Any signed-in member of the tenant, or an API key with `contacts:read`. `status` is `awaiting_upload`, `processing`, `completed` or `failed`. `total_rows`, `accepted`, `rejected` and `rejected_by_reason` are `null` until the import is `completed`; `rejected` is the sum of `rejected_by_reason` and `total_rows` is `accepted` plus `rejected`. `failure` is set only when the status is `failed` (`unreadable_file`, `too_many_rows` over 1,000,000 rows, `mapping_mismatch` when a mapped header is not in the file, `internal_error`). A bad row never fails the import, it is a rejected row. 401 when the token is missing, expired or invalid; 404 when the import does not exist in the caller's tenant; 503 until contact imports are deployed.","operationId":"getContactImport","parameters":[{"in":"path","name":"import_id","required":true,"schema":{"format":"uuid","title":"Import Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such import in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Contact imports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Status and counts of one contact import","tags":["contacts"],"x-api-key-scope":"contacts:read","x-min-role":"viewer"}},"/v1/contact-imports/{import_id}/complete":{"post":{"description":"An `editor` or above says the file is uploaded. The control plane checks that the object exists and has the declared size, moves the import to `processing` and publishes the `contact_import.uploaded` event (`events/catalog.json`), in one transaction. 202 means accepted, not processed: poll `GET /v1/contact-imports/{id}`. Calling it again on an import that is already `processing`, `completed` or `failed` returns the import and publishes nothing. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the import does not exist in the caller's tenant; 409 when the file is not uploaded yet, has another size than declared, or the upload URL expired (upload it again, or start a new import if it expired); 503 until contact imports are deployed.","operationId":"completeContactImport","parameters":[{"in":"path","name":"import_id","required":true,"schema":{"format":"uuid","title":"Import Id","type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactImportResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such import in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The uploaded file is missing, has another size, or the URL expired."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Contact imports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Tell us the contact file is uploaded","tags":["contacts"],"x-api-key-scope":"contacts:write","x-min-role":"editor"}},"/v1/contact-imports/{import_id}/rejected-rows":{"get":{"description":"An `editor` or above, the same roles that can upload the file: the report holds the raw rows of the file (names, phones, amounts). The answer is a presigned `download_url` (HTTP `GET`, valid until `download_expires_at`) of a CSV report. Columns: `row_number` (the row in the uploaded file, where the header row is row 1), `reason_code`, then the original columns of the row. `reason_code` is one of `missing_phone`, `invalid_phone`, `not_ar_number`, `duplicate_in_file` (the first row with a number is kept), `duplicate_existing` (no longer emitted: each import keeps its own contacts, so a number from an earlier import is not a duplicate), `do_not_call`, `missing_variable`, `invalid_variable`. A cell that starts with `=`, `+`, `-` or `@` is written with a leading `'`, so a spreadsheet does not run it as a formula. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the import does not exist in the caller's tenant; 409 until the import is `completed`, and when it rejected no row; 503 until contact imports are deployed.","operationId":"getContactImportRejectedRows","parameters":[{"in":"path","name":"import_id","required":true,"schema":{"format":"uuid","title":"Import Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectedRowsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such import in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The import is not completed, or it rejected no row."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Contact imports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Download the rows an import rejected","tags":["contacts"],"x-api-key-scope":"contacts:write","x-min-role":"editor"}},"/v1/credit":{"get":{"description":"Any signed-in member, or an API key with the scope `credit:read`. The organization's credit account, in signed integer USD micros: `balance`, `credit_limit` (0 when prepaid), `reserved` (held by calls in progress) and `available`, which is `balance + credit_limit - reserved`. `mode` is `off`, `shadow` (what would be denied is recorded, nothing is) or `enforce`; `low_balance` is true when `available` is below the organization's threshold. An organization created after credit control began gets its account the first time it is read. 401 when the token is missing, expired or invalid; 503 when credit is not available.","operationId":"getCredit","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Credit is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"My organization's credit","tags":["credit"],"x-api-key-scope":"credit:read","x-min-role":"viewer"}},"/v1/credit/ledger":{"get":{"description":"Any signed-in member, or an API key with the scope `credit:read`. The append-only ledger of the organization's credit, newest first, `limit` (1 to 100, default 50) per page; pass `next_cursor` as `cursor` for older entries. Each entry has its `kind` (`grant`, `limit_change`, `charge`, `adjustment`, `provisional_charge` or `reconciliation`), `amount_micros` and `balance_after_micros` in signed integer USD micros, an opaque `reference` and, for calls, the `call_id`. 401 when the token is missing, expired or invalid; 403 for an API key without `credit:read`; 422 for an invalid cursor or limit; 503 when credit is not available.","operationId":"listCreditLedger","parameters":[{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":512,"minLength":1,"type":"string"},{"type":"null"}],"title":"Cursor"}},{"in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Credit is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"My organization's credit ledger","tags":["credit"],"x-api-key-scope":"credit:read","x-min-role":"viewer"}},"/v1/dialer/settings":{"get":{"description":"Any signed-in member of the tenant, or an API key with `campaigns:read`. `max_concurrency` is the number of calls that may be open at once across every running campaign of the organization, or `null` when only each campaign's own limit applies. 401 when the token is missing, expired or invalid; 503 until campaigns are deployed.","operationId":"getDialerSettings","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DialerSettingsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Dialer limits of my organization","tags":["campaigns"],"x-api-key-scope":"campaigns:read","x-min-role":"viewer"},"put":{"description":"An `admin` or above (not an API key). `max_concurrency` (1 to 1,000, or `null` for no cap) limits the calls open at once across every running campaign of the organization; the free slots are shared between the running campaigns by their `priority`. The change is written to the audit log. 401 when the token is missing, expired or invalid; 403 below `admin`; 422 when the body is invalid; 503 until campaigns are deployed.","operationId":"updateDialerSettings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DialerSettingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DialerSettingsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Campaigns are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Set the dialer limits of my organization","tags":["campaigns"],"x-min-role":"admin"}},"/v1/do-not-call":{"get":{"description":"Any signed-in member of the tenant, or an API key with `contacts:read`. Pages are ordered by number; pass `next_cursor` of a page as `cursor` to get the next one. `next_cursor` is `null` on the last page. The cursor is opaque and never carries a number in clear; do not build or change it. `limit` is at most 500 (default 100). 401 when the token is missing, expired or invalid; 422 when `limit` is out of range or the cursor is not one we issued; 503 until the list is deployed.","operationId":"listDoNotCall","parameters":[{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":500,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoNotCallPage"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The do-not-call list is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the do-not-call numbers of my organization","tags":["contacts"],"x-api-key-scope":"contacts:read","x-min-role":"viewer"},"post":{"description":"An `editor` or above puts a number on the tenant's own do-not-call list. The number travels in the body, not the path, so it does not reach access logs. It is idempotent: a number already on the list returns its entry, with its original `created_at`. Contact imports reject rows with a number on this list (`do_not_call`). The list is per tenant and is not shared. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the number is not E.164; 503 until the list is deployed.","operationId":"addDoNotCall","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoNotCallRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoNotCallEntry"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The do-not-call list is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Put a number on the do-not-call list","tags":["contacts"],"x-api-key-scope":"contacts:write","x-min-role":"editor"}},"/v1/do-not-call/remove":{"post":{"description":"An `admin` or above takes a number off the tenant's list; this is stricter than adding because the list is a compliance control. The number travels in the body, not the path, so it does not reach access logs. It is idempotent: 204 whether or not the number was on the list. 401 when the token is missing, expired or invalid; 403 when the caller is below `admin`; 422 when the number is not E.164; 503 until the list is deployed.","operationId":"removeDoNotCall","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoNotCallRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The do-not-call list is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Take a number off the do-not-call list","tags":["contacts"],"x-min-role":"admin"}},"/v1/health":{"get":{"description":"Returns ok while the API is serving requests.","operationId":"getHealth","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"Successful Response"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"summary":"Service health","tags":["system"]}},"/v1/invitations":{"post":{"description":"An `admin` or `owner` invites an email address to their own organization with a role (`owner`, `admin`, `editor`, `viewer`); the identity provider sends the email. The organization is the one in the caller's access token. A role above the caller's own is 403, so only an `owner` can invite an `owner`. 401 when the token is missing, expired or invalid; 403 when the caller is below `admin` or asks for a role above their own; 409 when the email already has a pending invitation or is already a member (permanent, do not retry); 422 when the email or role is invalid; 429 when the organization sends too many invitations (see `Retry-After`); 503 when no identity provider, audit log or audit key is configured, or the provider cannot be reached (retry later). The invitation is recorded in the audit log as `invitation.create`, with the role; the email is not stored, only a keyed hash of it.","operationId":"inviteMember","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role too low, or role above the caller's."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Already invited or already a member; do not retry."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many invitations; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Identity provider, audit log or audit key not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Invite someone to my organization","tags":["identity"],"x-min-role":"admin"}},"/v1/knowledge-bases":{"get":{"description":"Any signed-in member, or an API key with `knowledge:read`. The tenant's knowledge bases, newest first. `status` is `empty` (no documents), `processing` (a document is not done yet), `ready` (at least one document is searchable) or `failed` (every document failed). 401 when the token is missing, expired or invalid; 503 until knowledge bases are deployed.","operationId":"listKnowledgeBases","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseListResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the knowledge bases","tags":["knowledge"],"x-api-key-scope":"knowledge:read","x-min-role":"viewer"},"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) creates an empty knowledge base with a `name` (1 to 120 characters) and an optional `description` (up to 1,000). Audited as `knowledge_base.create` with the id and name only. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the body is invalid; 503 until knowledge bases are deployed.","operationId":"createKnowledgeBase","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeBaseRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create a knowledge base","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}":{"get":{"description":"Any signed-in member, or an API key with `knowledge:read`. 401 when the token is missing, expired or invalid; 404 when the base is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"getKnowledgeBase","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One knowledge base","tags":["knowledge"],"x-api-key-scope":"knowledge:read","x-min-role":"viewer"},"put":{"description":"An `editor` or above (or an API key with `knowledge:write`) replaces the `name` and `description`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base is not one of the caller's tenant; 422 when the body is invalid; 503 until knowledge bases are deployed.","operationId":"updateKnowledgeBase","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKnowledgeBaseRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Rename a knowledge base","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"},"delete":{"description":"An `editor` or above (or an API key with `knowledge:write`) deletes the base, its documents and, in the background, their vectors and files. Assistants that still list the base keep its id; their search tool answers that nothing was found. Audited as `knowledge_base.delete`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"deleteKnowledgeBase","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a knowledge base and everything in it","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/documents":{"get":{"description":"Any signed-in member, or an API key with `knowledge:read`. Newest first. `status` is `awaiting_upload`, `uploaded`, `processing`, `ready` or `failed`; a `failed` document says why in `error_code`. 401 when the token is missing, expired or invalid; 404 when the base is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"listKnowledgeDocuments","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the documents of a knowledge base","tags":["knowledge"],"x-api-key-scope":"knowledge:read","x-min-role":"viewer"},"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) declares a file (`filename`, `size_bytes` up to 25 MiB; the extension picks the format: pdf, docx, txt, md, csv or html). The answer is the document in `awaiting_upload` and a presigned `upload_url`: send the file to it with an HTTP `PUT`, with exactly `size_bytes` bytes, before `upload_expires_at`. The URL grants one object of the caller's own tenant and nothing else. Then call `POST /v1/knowledge-bases/{id}/documents/{document_id}/complete`. Audited as `document.create` with ids and the file name only. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base is not one of the caller's tenant; 422 when the body is invalid or the extension is not supported (`unsupported_format`); 503 until knowledge bases are deployed.","operationId":"createKnowledgeDocument","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCreatedResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Start uploading a document","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/documents/{document_id}":{"put":{"description":"An `editor` or above (or an API key with `knowledge:write`) replaces the file of a document with a new version. Same contract as `POST .../documents`: the answer is the document back in `awaiting_upload` and a presigned `upload_url` for exactly `size_bytes` bytes; then call `POST .../documents/{document_id}/complete`. The old version keeps answering searches until the new one is indexed. Tags are kept. Audited as `document.replace`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or document is not one of the caller's tenant; 409 `source_managed` for a page of a URL source (sync the source instead); 422 when the body is invalid or the extension is not supported (`unsupported_format`); 503 until knowledge bases are deployed.","operationId":"replaceKnowledgeDocument","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"format":"uuid","title":"Document Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceDocumentRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCreatedResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`source_managed`."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Upload a new version of a document","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"},"patch":{"description":"An `editor` or above (or an API key with `knowledge:write`) replaces the `tags` of a document: up to 20 labels of 1 to 40 characters, lower cased, without `:` or `,`. A search (and an assistant's attachment) can be limited to documents with a tag. Takes effect at once, without reindexing. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or document is not one of the caller's tenant; 422 when the tags are not valid (`invalid_tags`); 503 until knowledge bases are deployed.","operationId":"updateKnowledgeDocumentTags","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"format":"uuid","title":"Document Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentTagsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Set the tags of a document","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"},"delete":{"description":"An `editor` or above (or an API key with `knowledge:write`) deletes the document; its vectors and file are removed in the background. Audited as `document.delete`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or document is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"deleteKnowledgeDocument","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"format":"uuid","title":"Document Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a document and its vectors","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/documents/{document_id}/complete":{"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) says the file is uploaded. The control plane checks that the object exists and has the declared size, moves the document to `uploaded` and queues its ingestion: it is parsed, split into chunks, embedded and indexed in the background (`processing`, then `ready` or `failed`). 202 means accepted, not indexed: poll `GET /v1/knowledge-bases/{id}/documents`. Calling it again on a document that moved on returns the document. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or document is not one of the caller's tenant; 409 when the file is not uploaded yet, has another size than declared, or the upload URL expired; 503 until knowledge bases are deployed.","operationId":"completeKnowledgeDocument","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"format":"uuid","title":"Document Id","type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The uploaded file is missing or differs."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Tell us the document is uploaded","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/documents/{document_id}/retry":{"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) queues the ingestion of a `failed` document again, from its stored file. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or document is not one of the caller's tenant; 409 `not_failed` when the document did not fail; 503 until knowledge bases are deployed.","operationId":"retryKnowledgeDocument","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"document_id","required":true,"schema":{"format":"uuid","title":"Document Id","type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`not_failed`."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Index a failed document again","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/reindex":{"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) queues a reindex: every document is read again from its stored file (or stored page text) and indexed with the embedding model and index layout the service has now. If the model changed, the old vectors are dropped first and searches return nothing until the documents are indexed again; otherwise the old ones keep answering. The service queues it by itself when `EMBEDDINGS_PROVIDER` or the model changed; this is the manual trigger. `reindexing` is true while it is queued or running; a second call meanwhile changes nothing. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"reindexKnowledgeBase","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Index every document of a base again","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/search":{"post":{"description":"Any signed-in member, or an API key with `knowledge:read`. Searches the base with `query` (1 to 500 characters) and returns up to `top_k` (1 to 10) chunks, best first, each with its `score`, `document_name`, `position` in the document, `heading`, `source_url` and the retrievers that found it (`matched_by`). `top_k`, `hybrid`, `rerank` and `score_threshold` default to the base's search settings; `tags` limits the search to documents with at least one of them. `mode` says how it ran. It is what the assistant's search tool does during a call. A base with no indexed document returns no hits. 401 when the token is missing, expired or invalid; 404 when the base is not one of the caller's tenant; 409 with code `reindex_required` while the base waits for a reindex after an embedding model change; 422 when the body is invalid or a tag is not valid (`invalid_tags`); 503 until knowledge bases are deployed or while the search service is down (`knowledge_unavailable`).","operationId":"searchKnowledgeBase","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchKnowledgeRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`reindex_required`."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Test a search in a knowledge base","tags":["knowledge"],"x-api-key-scope":"knowledge:read","x-min-role":"viewer"}},"/v1/knowledge-bases/{knowledge_base_id}/search-settings":{"patch":{"description":"An `editor` or above (or an API key with `knowledge:write`) changes the search settings of the base; only the fields sent change. `top_k` (1 to 10, default 4) is how many chunks a search returns; `score_threshold` (0 to 1, default none; send null to remove it) is the minimum cosine similarity of the dense retriever, and a chunk only the keyword retriever found is kept; `hybrid` (default true) adds a BM25 keyword retriever and fuses both with reciprocal rank fusion; `rerank` (default false) re-scores the best candidates with a cross-encoder, which finds better chunks and adds latency, and has no effect when the service has no reranker. The assistant's search tool uses these settings. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base is not one of the caller's tenant; 422 when the body is invalid; 503 until knowledge bases are deployed.","operationId":"updateKnowledgeSearchSettings","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSearchSettingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Change how a knowledge base is searched","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/sources":{"get":{"description":"Any signed-in member, or an API key with `knowledge:read`. Newest first, each with its schedule and what the last run did (`pages_added`, `pages_changed`, `pages_removed`, `pages_unchanged`, `pages_skipped`, `pages_failed`), how far an open sync got (`progress`: `found`, `fetched`, `indexed`, `failed`) and `stalled` when it has shown no sign of life for five minutes. 401 when the token is missing, expired or invalid; 404 when the base is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"listKnowledgeSources","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceListResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the URL sources of a knowledge base","tags":["knowledge"],"x-api-key-scope":"knowledge:read","x-min-role":"viewer"},"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) adds a source and queues its first sync. `kind` is `url` (one page), `sitemap` (the pages a sitemap lists; `url` is the sitemap) or `crawl` (follow links from `url`, up to `max_depth` 0 to 5 and `max_pages` 1 to 500, `same_domain` default true). The service fetches only public http(s) hosts (private, loopback and link-local addresses are refused, redirects are checked hop by hop), obeys `robots.txt` for the `ecoBot` agent, caps the size and time of every page and extracts the main content as markdown. Each page becomes a document with its `source_url` and `title`. `refresh_interval` is `off`, `daily` or `weekly`. Audited as `knowledge_source.create`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base is not one of the caller's tenant; 422 when the body is invalid or the URL is not a public http(s) address (`url_not_allowed`); 503 until knowledge bases are deployed.","operationId":"createKnowledgeSource","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSourceRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Add a URL, sitemap or crawl as a source","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/sources/{source_id}":{"patch":{"description":"An `editor` or above (or an API key with `knowledge:write`) sets `refresh_interval` (`off`, `daily`, `weekly`); the next automatic sync is that long from now. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or source is not one of the caller's tenant; 422 when the body is invalid; 503 until knowledge bases are deployed.","operationId":"updateKnowledgeSource","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"source_id","required":true,"schema":{"format":"uuid","title":"Source Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSourceRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Change the refresh schedule of a source","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"},"delete":{"description":"An `editor` or above (or an API key with `knowledge:write`) deletes the source, its documents and, in the background, their vectors and files. Audited as `knowledge_source.delete`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or source is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"deleteKnowledgeSource","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"source_id","required":true,"schema":{"format":"uuid","title":"Source Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a source and its pages","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/knowledge-bases/{knowledge_base_id}/sources/{source_id}/events":{"get":{"description":"Any signed-in member, or an API key with `knowledge:read`. The last 50 things the sync of this source did, newest first: when it started, how many pages it fetched, why a page or the whole run failed (`dns_failure`, `tls_error`, `timeout`, `http_error`, `robots_disallowed`, `blocked_address`, `timed_out`, `sync_lost`). Each event has a `code`, an optional `detail` (a host name or a short reason, never page contents) and an optional `count`. 401 when the token is missing, expired or invalid; 404 when the base or source is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"listKnowledgeSourceEvents","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"source_id","required":true,"schema":{"format":"uuid","title":"Source Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceEventListResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Read the activity log of a source","tags":["knowledge"],"x-api-key-scope":"knowledge:read","x-min-role":"viewer"}},"/v1/knowledge-bases/{knowledge_base_id}/sources/{source_id}/sync":{"post":{"description":"An `editor` or above (or an API key with `knowledge:write`) queues a re-sync: the pages are fetched again, compared by content hash, only the changed ones are indexed again, new pages are added and pages that disappeared (404 or no longer linked) are removed. 202 means accepted: poll `GET /v1/knowledge-bases/{id}/sources` for `status` `idle` and the counters. A second call while a healthy sync is open changes nothing; when the open sync is `stalled` the call replaces it with a new one (the retry). 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the base or source is not one of the caller's tenant; 503 until knowledge bases are deployed.","operationId":"syncKnowledgeSource","parameters":[{"in":"path","name":"knowledge_base_id","required":true,"schema":{"format":"uuid","title":"Knowledge Base Id","type":"string"}},{"in":"path","name":"source_id","required":true,"schema":{"format":"uuid","title":"Source Id","type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not found in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Knowledge bases are not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Fetch a source again","tags":["knowledge"],"x-api-key-scope":"knowledge:write","x-min-role":"editor"}},"/v1/mcp-servers":{"get":{"description":"An `editor` or above, as a user. `items` are the remote MCP servers of the tenant by name, each with the tools of its last discover and which of them are allowed. An assistant attaches allowed tools in `config.mcp`. Header values and the URL are secrets of the customer: header values are stored sealed and never returned (a header shows its `name` and a `value_mask`). 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 503 when MCP servers are not available.","operationId":"listMcpServers","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the MCP servers of my organization","tags":["mcp"],"x-min-role":"editor"},"post":{"description":"An `admin` or above. `name` (1 to 120 characters; its first 16 letters and digits become the prefix of the tool names the model sees, `mcp_<prefix>__<tool>`), `description`, `url` (`https` only, no credentials, not a private address; treat it as a secret), `transport` (`streamable_http`) and `headers` (up to 20, for example `Authorization: Bearer ...`). No tool is allowed until `discover` and the allowlist. Header values and the URL are secrets of the customer: header values are stored sealed and never returned (a header shows its `name` and a `value_mask`). Written to the audit log as `mcp_server.create`. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 409 when the name is taken; 422 when a field is invalid; 503 when MCP servers are not available.","operationId":"createMcpServer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another MCP server has this name."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Connect an MCP server","tags":["mcp"],"x-min-role":"admin"}},"/v1/mcp-servers/{server_id}":{"get":{"description":"An `editor` or above. Header values and the URL are secrets of the customer: header values are stored sealed and never returned (a header shows its `name` and a `value_mask`). 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the server is not in the caller's tenant; 503 when MCP servers are not available.","operationId":"getMcpServer","parameters":[{"in":"path","name":"server_id","required":true,"schema":{"format":"uuid","title":"Server Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such MCP server in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One MCP server","tags":["mcp"],"x-min-role":"editor"},"put":{"description":"An `admin` or above. The body is the same as for creating and replaces the server. A header sent with no `value` keeps the value stored under that name; a header left out is removed. A new `url` clears the discovered tools and the allowlist: discover again. Written to the audit log as `mcp_server.update`. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 404 when the server is not in the caller's tenant; 409 when the name is taken; 422 when a field is invalid; 503 when MCP servers are not available.","operationId":"updateMcpServer","parameters":[{"in":"path","name":"server_id","required":true,"schema":{"format":"uuid","title":"Server Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such MCP server in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another MCP server has this name."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Replace an MCP server","tags":["mcp"],"x-min-role":"admin"},"delete":{"description":"An `admin` or above. Assistants that attach its tools can no longer be published until they drop them; published versions keep their frozen schemas but their calls to it fail. Written to the audit log as `mcp_server.delete`. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 404 when the server is not in the caller's tenant; 503 when MCP servers are not available.","operationId":"deleteMcpServer","parameters":[{"in":"path","name":"server_id","required":true,"schema":{"format":"uuid","title":"Server Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such MCP server in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete an MCP server","tags":["mcp"],"x-min-role":"admin"}},"/v1/mcp-servers/{server_id}/allowlist":{"put":{"description":"An `admin` or above. `tools` replaces the allowlist: each `name` must be a tool of the last discover (up to 50). `requires_confirmation` is a flag kept for the tool (metadata for now: a voice call has no one to ask). Written to the audit log as `mcp_server.allowlist`. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 404 when the server is not in the caller's tenant; 422 when a name is not a discovered tool; 503 when MCP servers are not available.","operationId":"setMcpAllowlist","parameters":[{"in":"path","name":"server_id","required":true,"schema":{"format":"uuid","title":"Server Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpAllowlistRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such MCP server in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Choose which tools of an MCP server assistants may use","tags":["mcp"],"x-min-role":"admin"}},"/v1/mcp-servers/{server_id}/discover":{"post":{"description":"An `admin` or above. The control plane connects to the server (https, public addresses only, no redirects, 10 seconds, 1 MiB of answer), lists its tools and keeps the snapshot (name, description and input schema). `added`, `changed` and `removed` name the differences from the previous snapshot; a `changed` tool is no longer allowed and an admin has to approve it again. Tools whose name or schema cannot be offered to a model are counted in `skipped`. Written to the audit log as `mcp_server.discover`. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 404 when the server is not in the caller's tenant; 502 (`mcp_unreachable`) when the server cannot be reached or does not speak MCP; 503 when MCP servers are not available.","operationId":"discoverMcpServer","parameters":[{"in":"path","name":"server_id","required":true,"schema":{"format":"uuid","title":"Server Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpDiscoveryResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such MCP server in the caller's tenant."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The MCP server could not be used."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"MCP servers are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the tools of an MCP server","tags":["mcp"],"x-min-role":"admin"}},"/v1/me":{"get":{"description":"Send the identity provider's access token as `Authorization: Bearer <token>`. Returns the member's subject, tenant and role (`owner`, `admin`, `editor`, `viewer`) taken from the token's `sub`, `tenant_id` and `role` claims, and `organization_name`: the name of the member's organization (null when it is not known); `platform_admin`: whether the member is an admin of the platform (an owner or admin of the organization flagged `platform` in the identity provider). `can_view_costs` follows the membership’s signed `costs:read` permission. 401 when the token is missing, expired or invalid; 403 with code `organization_suspended` when the organization is suspended (every `/v1` call of its members and API keys answers so); 503 when no identity provider is configured or it cannot be reached.","operationId":"getMe","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `organization_suspended`: the organization is suspended."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Identity provider not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The signed-in member","tags":["identity"]}},"/v1/metrics":{"get":{"description":"Any signed-in member. Over `since` (inclusive) to `until` (exclusive), by default the last 7 days, for real and simulated calls, optionally of one `assistant_id` or `campaign_id`: `kpis` (calls, answered and the answered rate, average duration, total minutes, cost estimate and `promises`, the calls whose structured output has a `promise_date` or `fecha_promesa`, null when no call has a structured output), `series` per `granularity` (`day`, up to 366 days, or `hour`, up to 31 days; buckets start at midnight or the hour of `timezone`, an IANA name, UTC by default; empty buckets are not listed), the calls by end reason and by outcome, the average duration per assistant, the cost per component (empty when calls were reported with a single total), `criteria` (the success rate of each success criterion over the analyzed calls) and `sentiment` (analyzed calls by sentiment). 401 when the token is missing, expired or invalid; 422 for an empty or too long range, an unknown time zone or another invalid parameter; 503 when metrics are not available.","operationId":"getMetrics","parameters":[{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"granularity","required":false,"schema":{"default":"day","pattern":"^(day|hour)$","title":"Granularity","type":"string"}},{"in":"query","name":"timezone","required":false,"schema":{"default":"UTC","maxLength":64,"minLength":1,"title":"Timezone","type":"string"}},{"in":"query","name":"assistant_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"}},{"in":"query","name":"campaign_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Campaign Id"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The range or a parameter is invalid."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Metrics are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Call metrics of my organization","tags":["metrics"],"x-min-role":"viewer"}},"/v1/organizations":{"post":{"description":"Sign-up: the signed-in user (a valid access token, which does not need a `tenant_id` yet) creates an organization and becomes its `owner`. The response carries the new tenant id; sign in again so the access token picks up `tenant_id` and `role`. After a 503 it is safe to send the same name again: the same user gets the same tenant id and no second organization is created. 401 when the token is missing, expired or invalid; 422 when the name is empty or longer than 120 characters; 429 when the caller signs up too often, or when too many sign-ups come from one client address (see `Retry-After`); 503 when no identity provider is configured or it cannot be reached, or when the rate-limit store cannot be reached.","operationId":"createOrganization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many sign-ups from this account or this client address; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Identity provider or rate-limit store not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create my organization","tags":["identity"]}},"/v1/outbound-trunks":{"get":{"description":"Any signed-in member, or an API key with `campaigns:read`. Lists the outbound trunks assigned to the organization and marks its default (`is_default`). 401 when the token is missing, expired or invalid; 503 `sip_unavailable` when SIP management is not available.","operationId":"listOutboundTrunks","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundTrunkOptions"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"SIP management is not available (`sip_unavailable`)."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the outbound trunks of the organization","tags":["campaigns"],"x-api-key-scope":"campaigns:read","x-min-role":"viewer"}},"/v1/pricing":{"get":{"description":"A signed-in member with `costs:read`. The read-only price table that usage is priced with: per provider and model, USD per million tokens (text, audio and cached parts), per minute of audio or per million characters, with the public pricing page each rate was read from. `version` is the date the prices were read; every stored usage row keeps the version it was priced with. A model that is not listed has no price and its cost is null. Estimates ignore volume discounts and taxes. 401 when the token is missing, expired or invalid.","operationId":"getPricing","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Cost permission required."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"The prices behind the cost estimates","tags":["usage"],"x-min-role":"viewer"}},"/v1/pronunciation-dictionaries":{"get":{"description":"Any signed-in member. Each rule replaces the written form `grapheme` (a whole word or phrase, never part of a word) with `alias`, how it is said, in the text sent to the voice (pipeline assistants only). Case is ignored unless `case_sensitive`. Phonemes (IPA, CMU) are not supported. An assistant attaches dictionaries by id in `config.pronunciation.dictionary_ids`. 401 when the token is missing, expired or invalid; 503 when dictionaries are not available.","operationId":"listPronunciationDictionaries","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Dictionaries are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the pronunciation dictionaries of my organization","tags":["pronunciation"],"x-min-role":"viewer"},"post":{"description":"An `editor` or above. `name` (up to 80, unique in the organization), optional `language` (a tag such as `es-AR`) and up to 500 `rules`; up to 100 dictionaries per organization. Each rule replaces the written form `grapheme` (a whole word or phrase, never part of a word) with `alias`, how it is said, in the text sent to the voice (pipeline assistants only). Case is ignored unless `case_sensitive`. Phonemes (IPA, CMU) are not supported. Written to the audit log as `pronunciation_dictionary.create` (counts only, never the rules). 401 when the token is missing, expired or invalid; 403 below `editor`; 409 when the name is taken or the organization is at the limit; 422 when a field is invalid; 503 when dictionaries are not available.","operationId":"createPronunciationDictionary","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another dictionary has this name."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Dictionaries are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create a pronunciation dictionary","tags":["pronunciation"],"x-min-role":"editor"}},"/v1/pronunciation-dictionaries/{dictionary_id}":{"get":{"description":"Any signed-in member. 401 when the token is missing, expired or invalid; 404 when the dictionary is not in the caller's organization; 503 when dictionaries are not available.","operationId":"getPronunciationDictionary","parameters":[{"in":"path","name":"dictionary_id","required":true,"schema":{"format":"uuid","title":"Dictionary Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such dictionary in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Dictionaries are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One pronunciation dictionary","tags":["pronunciation"],"x-min-role":"viewer"},"put":{"description":"An `editor` or above. Replaces the name, language and every rule. The change applies to calls that start after it. Audited as `pronunciation_dictionary.update`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the dictionary is not in the caller's organization; 409 when the name is taken; 422 when a field is invalid; 503 when dictionaries are not available.","operationId":"updatePronunciationDictionary","parameters":[{"in":"path","name":"dictionary_id","required":true,"schema":{"format":"uuid","title":"Dictionary Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationDictionaryResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such dictionary in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another dictionary has this name."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Dictionaries are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Replace a pronunciation dictionary","tags":["pronunciation"],"x-min-role":"editor"},"delete":{"description":"An `editor` or above. An assistant version that still names it keeps working (the dictionary is skipped); a draft that names it cannot be saved. Audited as `pronunciation_dictionary.delete`. 401 when the token is missing, expired or invalid; 403 below `editor`; 404 when the dictionary is not in the caller's organization; 503 when dictionaries are not available.","operationId":"deletePronunciationDictionary","parameters":[{"in":"path","name":"dictionary_id","required":true,"schema":{"format":"uuid","title":"Dictionary Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such dictionary in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Dictionaries are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a pronunciation dictionary","tags":["pronunciation"],"x-min-role":"editor"}},"/v1/provider-credentials":{"get":{"description":"An `admin` or above, as a user. `items` always has the eleven providers (`openai`, `azure_openai`, `anthropic`, `google`, `deepgram`, `elevenlabs`, `cartesia`, `azure_speech`, `groq`, `cerebras`, `typesafe`), configured or not. `platform_keys_allowed` says whether a platform admin lets this organization fall back on the keys of eco when a provider has no credential of its own. Keys are write-only: they are stored sealed and never returned; a provider shows `configured` and a `key_mask` with the last four characters. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 503 when provider credentials are not available.","operationId":"listProviderCredentials","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderCredentialList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below `admin`, or an API key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `provider_credentials_unavailable`: not deployed."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the provider credentials of my organization","tags":["provider-credentials"],"x-min-role":"admin"}},"/v1/provider-credentials/{provider}":{"put":{"description":"An `admin` or above, as a user. Stores the credential of `provider` for the organization. A secret field (`api_key`, `service_account_json`) left out or null keeps the stored value; the plain fields (`base_url`, `endpoint`, `api_version`, `region`) are replaced by the body. The first call needs `api_key`; `azure_openai` needs `endpoint` and `azure_speech` needs `region`; `service_account_json` (a JSON object, up to 64 KiB) is for `google` only, and the plain fields a provider does not have are rejected. URLs are `https`. Keys are write-only: they are stored sealed and never returned; a provider shows `configured` and a `key_mask` with the last four characters. Written to the audit log as `provider_credential.set` with the provider and the plain fields, never a secret. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 422 when a field is invalid or missing; 503 when provider credentials are not available.","operationId":"setProviderCredential","parameters":[{"in":"path","name":"provider","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderCredentialUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderCredential"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below `admin`, or an API key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `provider_credentials_unavailable`: not deployed."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Set the credential of a provider","tags":["provider-credentials"],"x-min-role":"admin"},"delete":{"description":"An `admin` or above, as a user. Removes the credential of `provider`; deleting one that is not set is also 204. Written to the audit log as `provider_credential.delete`. 401 when the token is missing, expired or invalid; 403 below `admin` or with an API key; 503 when provider credentials are not available.","operationId":"deleteProviderCredential","parameters":[{"in":"path","name":"provider","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below `admin`, or an API key."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `provider_credentials_unavailable`: not deployed."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete the credential of a provider","tags":["provider-credentials"],"x-min-role":"admin"}},"/v1/reports/calls/export":{"get":{"description":"The calls that match the filters of `listCalls` (without `limit` and `cursor`), newest first, one row per call: id, start, duration, assistant, campaign, direction, outcome, end reason, `phone_last4` and `simulated`. The result of the call adds `result_outcome`, `structured_output` as JSON text, and one `result.<key>` column for each top-level key of the structured outputs (a list or an object as JSON text). The `include_costs` and `include_internal` options require `costs:read` and add the cost estimate and captured values respectively. Streamed, never held in memory. Needs an `editor` or above. Never has a full phone number. A text that starts with `=`, `+`, `-` or `@` is prefixed with `'` so a spreadsheet does not run it. At most 100,000 rows: a larger result is refused with 422, narrow the filters. Every export is audited as `report.export` (filter names only, never values). An organization may start a limited number of exports per minute. 401, 422 and 503 as in `listCalls`; 403 for a `viewer`; 429 when the organization exports too often (see `Retry-After`).","operationId":"exportCalls","parameters":[{"in":"query","name":"format","required":false,"schema":{"default":"csv","pattern":"^csv$","title":"Format","type":"string"}},{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"assistant_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"}},{"in":"query","name":"campaign_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Campaign Id"}},{"in":"query","name":"outcome","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Outcome"},{"type":"null"}],"title":"Outcome"}},{"in":"query","name":"end_reason","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EndReason"},{"type":"null"}],"title":"End Reason"}},{"in":"query","name":"direction","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Direction"},{"type":"null"}],"title":"Direction"}},{"in":"query","name":"q","required":false,"schema":{"anyOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Q"}},{"description":"The sentiment of the post-call analysis.","in":"query","name":"sentiment","required":false,"schema":{"anyOf":[{"enum":["positive","neutral","negative"],"type":"string"},{"type":"null"}],"description":"The sentiment of the post-call analysis.","title":"Sentiment"}},{"description":"Id of a success criterion of the assistant; the call was analyzed.","in":"query","name":"criterion","required":false,"schema":{"anyOf":[{"pattern":"^[a-z][a-z0-9_]{0,39}$","type":"string"},{"type":"null"}],"description":"Id of a success criterion of the assistant; the call was analyzed.","title":"Criterion"}},{"description":"How `criterion` was judged. Needs `criterion`.","in":"query","name":"criterion_result","required":false,"schema":{"anyOf":[{"enum":["success","failure","unknown"],"type":"string"},{"type":"null"}],"description":"How `criterion` was judged. Needs `criterion`.","title":"Criterion Result"}},{"in":"query","name":"include_costs","required":false,"schema":{"default":false,"title":"Include Costs","type":"boolean"}},{"in":"query","name":"include_internal","required":false,"schema":{"default":false,"title":"Include Internal","type":"boolean"}}],"responses":{"200":{"content":{"text/csv":{"schema":{"type":"string"}}},"description":"A CSV file."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller lacks the required role or permission."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"A filter is invalid or the result too big."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many exports; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Reports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Export the call log as CSV","tags":["reports"],"x-min-role":"editor"}},"/v1/reports/campaigns/{campaign_id}":{"get":{"description":"Any signed-in member. `summary` (status, dates, contacts, attempts, minutes), `contactability` (contacts reached, those with an answered attempt, over contacts), `attempts_per_contact` (how many contacts took 0, 1, 2... attempts), `outcomes` of the closed attempts (`answered_responded` when an answered call has a transcribed caller turn; older calls without this signal remain `answered`), `best_hours` (attempts and answered by local hour of the campaign's time zone, only the hours with attempts), `dnc_skipped` (contacts closed by the do-not-call list) and `completion`. Reports include real and simulated campaign calls. 401 when the token is missing, expired or invalid; 404 when the campaign is not in the caller's organization; 503 when reports are not available.","operationId":"getCampaignReport","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignReportResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Reports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"How a campaign went","tags":["reports"],"x-min-role":"viewer"}},"/v1/reports/campaigns/{campaign_id}/export":{"get":{"description":"One row per contact: id, `phone_last4`, state, attempts, the last outcome (`answered_responded` when caller speech was transcribed), `last_call_at` (start of the last completed attempt, in the campaign's time zone) and the seconds of the contact's completed attempts: `seconds_total`, `seconds_effective` (answered attempts) and `seconds_not_effective` (the rest). Then one `file.<header>` column for each other column of the contact file (in file order, at most 100), as the client uploaded it, followed by exportable result columns. The legacy layout uses the last completed attempt. Select `view=contact` or `view=attempt` for the configured dashboard layout and filters. An explicit request for costs or internal fields requires `costs:read`. Never the full phone number. Streamed, never held in memory. Needs an `editor` or above. At most 100,000 contacts: a larger campaign is refused with 422. Every export is audited as `report.export`. An organization may start a limited number of exports per minute. 401, 403, 429 and 503 as in `exportCalls`; 404 when the campaign is not in the caller's organization.","operationId":"exportCampaignReport","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"query","name":"format","required":false,"schema":{"default":"csv","pattern":"^csv$","title":"Format","type":"string"}},{"in":"query","name":"include_costs","required":false,"schema":{"default":false,"title":"Include Costs","type":"boolean"}},{"in":"query","name":"include_internal","required":false,"schema":{"default":false,"title":"Include Internal","type":"boolean"}},{"in":"query","name":"outcome","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReportAttemptOutcome"},{"type":"null"}],"title":"Outcome"}},{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"view","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReportView"},{"type":"null"}],"title":"View"}}],"responses":{"200":{"content":{"text/csv":{"schema":{"type":"string"}}},"description":"A CSV file."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller lacks the required role or permission."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the caller's tenant."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The format is invalid or the campaign too big."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many exports; retry later.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Reports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Export a campaign as CSV","tags":["reports"],"x-min-role":"editor"}},"/v1/reports/campaigns/{campaign_id}/rows":{"get":{"description":"Contacts show all completed outcomes and the best and latest dispatch. Attempt mode expands individual dispatches. Outcome and UTC date filters select matching rows without altering a contact's totals. Standard reports omit cost and captured variables. The include_costs and include_internal options require costs:read.","operationId":"listCampaignReportRows","parameters":[{"in":"path","name":"campaign_id","required":true,"schema":{"format":"uuid","title":"Campaign Id","type":"string"}},{"in":"query","name":"include_costs","required":false,"schema":{"default":false,"title":"Include Costs","type":"boolean"}},{"in":"query","name":"include_internal","required":false,"schema":{"default":false,"title":"Include Internal","type":"boolean"}},{"in":"query","name":"outcome","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReportAttemptOutcome"},{"type":"null"}],"title":"Outcome"}},{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"view","required":false,"schema":{"$ref":"#/components/schemas/ReportView","default":"contact"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRowsResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Insufficient role or full report permission."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the organization."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Reports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Page through the contacts or call attempts of a campaign","tags":["reports"],"x-min-role":"editor"}},"/v1/reports/config":{"get":{"operationId":"getReportConfig","parameters":[{"in":"query","name":"include_internal","required":false,"schema":{"default":false,"title":"Include Internal","type":"boolean"}},{"in":"query","name":"campaign_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Campaign Id"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConfig"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Insufficient role or full report permission."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the organization."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Reports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Read the organization's campaign report settings","tags":["reports"],"x-min-role":"editor"},"put":{"operationId":"replaceReportConfig","parameters":[{"in":"query","name":"campaign_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Campaign Id"}},{"in":"query","name":"include_internal","required":false,"schema":{"default":false,"title":"Include Internal","type":"boolean"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConfig"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConfig"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Insufficient role or full report permission."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such campaign in the organization."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Protected settings require costs:read."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Reports are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Replace the organization's campaign report settings","tags":["reports"],"x-min-role":"admin"}},"/v1/sip-numbers":{"get":{"description":"Any signed-in member (not an API key). The numbers eco assigned to the organization, oldest assignment first, each with the assistant that answers its calls (null: nobody answers, the caller is hung up). Carrier configuration and trunk credentials remain private; outbound choices are listed separately. 401 when the token is missing, expired or invalid; 503 `sip_unavailable`.","operationId":"listSipNumbers","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipNumberList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `sip_unavailable`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Phone numbers of my organization","tags":["sip-numbers"],"x-min-role":"viewer"}},"/v1/sip-numbers/{number_id}/assistant":{"put":{"description":"An `admin` or above (not an API key). Sets the assistant of one of the organization's numbers, or clears it with `assistant_id` null. A call to the number runs the latest published version of the assistant at the moment it arrives; an assistant that has never been published is accepted, and calls to the number are hung up until it is. Audited as `sip_number.set_assistant`. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when the number is not the organization's or the assistant does not exist in it; 422 `assistant_archived` when the assistant is archived (clearing the number is always allowed); 503 `sip_unavailable`.","operationId":"setSipNumberAssistant","parameters":[{"in":"path","name":"number_id","required":true,"schema":{"format":"uuid","title":"Number Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSipNumberAssistantRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipNumber"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such number or assistant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `sip_unavailable`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Choose the assistant that answers a number","tags":["sip-numbers"],"x-min-role":"admin"}},"/v1/test-calls/readiness":{"get":{"description":"An `editor` or above. Says what a test call needs: `outbound_trunk` (the organization has a usable default outbound SIP trunk) and the organization's `caller_ids` with the `default_caller_id` a request without one uses (the oldest). `caller_id_required` is false with telephony-managed ANI; caller IDs are then empty and the default is null. A UI disables the call and explains what is missing. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 503 `call_test_unavailable`.","operationId":"getCallTestReadiness","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTestReadinessResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The caller is a `viewer`."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Code `call_test_unavailable`."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Can the organization place test calls?","tags":["assistants"],"x-min-role":"editor"}},"/v1/tools":{"get":{"description":"Any signed-in member, as a user. `items` are the webhook tools of the tenant by name; `built_in` names the tools every assistant has without being defined (`end_call`, `transfer_call`). Header values are secrets: they are stored for the call and never returned; a header shows its `name` and a `value_mask`. An assistant attaches them by id in `config.tools.api`. 401 when the token is missing, expired or invalid; 403 when called with an API key; 503 when tools are not available.","operationId":"listTools","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tools are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the tools of my organization","tags":["tools"],"x-min-role":"viewer"},"post":{"description":"An `editor` or above. A webhook tool is a function the assistant may call during a call: `name` (letters, digits and `_`, starting with a letter, up to 64; `end_call` and `transfer_call` are taken), `description` (what it does and when to call it), `parameters` (a JSON Schema object of up to 20 properties of type `string`, `number`, `integer` or `boolean`; `required` lists names of properties), `url` (`https` only, no credentials, not a private address), `method` (default `POST`), `headers` (up to 20), `timeout_seconds` (1 to 30, default 10), `waiting_message` (what the assistant says while it waits) and `failure_message` (what it says when the call fails). `url` and `body_template` may use `{{name}}` placeholders of `parameters`: in the path or query of the URL (percent-encoded) and in a JSON body template (a value that is only a placeholder keeps its type); arguments not used in the URL are sent as the query (`GET`) or the JSON body. `async` makes the call fire and forget and `sensitive` (default `true`) keeps the arguments out of what Talk shows. Header values are secrets: they are stored for the call and never returned; a header shows its `name` and a `value_mask`. Written to the audit log as `tool.create`. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 409 when the name is taken; 422 when a field is invalid; 503 when tools are not available.","operationId":"createTool","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another tool has this name."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tools are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Create a webhook tool","tags":["tools"],"x-min-role":"editor"}},"/v1/tools/{tool_id}":{"get":{"description":"Any signed-in member, as a user. Header values are secrets: they are stored for the call and never returned; a header shows its `name` and a `value_mask`. 401 when the token is missing, expired or invalid; 403 when called with an API key; 404 when the tool is not in the caller's tenant; 503 when tools are not available.","operationId":"getTool","parameters":[{"in":"path","name":"tool_id","required":true,"schema":{"format":"uuid","title":"Tool Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such tool in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tools are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One tool","tags":["tools"],"x-min-role":"viewer"},"put":{"description":"An `editor` or above. The body is the same as for creating and replaces the tool. A header sent with no `value` keeps the value stored under that name; a header left out is removed. Written to the audit log as `tool.update`. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the tool is not in the caller's tenant; 409 when the name is taken; 422 when a field is invalid; 503 when tools are not available.","operationId":"updateTool","parameters":[{"in":"path","name":"tool_id","required":true,"schema":{"format":"uuid","title":"Tool Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such tool in the caller's tenant."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Another tool has this name."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tools are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Replace a tool","tags":["tools"],"x-min-role":"editor"},"delete":{"description":"An `editor` or above. Written to the audit log as `tool.delete`. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the tool is not in the caller's tenant; 503 when tools are not available.","operationId":"deleteTool","parameters":[{"in":"path","name":"tool_id","required":true,"schema":{"format":"uuid","title":"Tool Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such tool in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tools are not available."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a tool","tags":["tools"],"x-min-role":"editor"}},"/v1/tools/{tool_id}/test":{"post":{"description":"An `editor` or above. The control plane calls the tool's URL with `args` (the query for `GET`, a JSON body otherwise) and the stored headers, and answers what came back: `ok` (a 2xx answer), `status_code`, `duration_ms` and the start of the body in `response_body` (`truncated` when cut). A failed call is still a 200 with `error`: `request` shows what was sent (method, URL with placeholders filled, body and header names, never values). `blocked_address` (the host resolves to a private, loopback or link-local address, which is never called), `dns_failure`, `timeout`, `connection_failed`. Redirects are not followed, the wait is at most 10 seconds and 64 KiB of the answer are read. At most 20 tests per minute per organization (`TOOL_TESTS_PER_MINUTE`), shared by tool and webhook tests and counted across replicas when Redis is set. 401 when the token is missing, expired or invalid; 403 below `editor` or with an API key; 404 when the tool is not in the caller's tenant; 422 when `args` is too large; 429 when called too often (see `Retry-After`); 503 when tools are not available or the rate limiter is unavailable.","operationId":"testTool","parameters":[{"in":"path","name":"tool_id","required":true,"schema":{"format":"uuid","title":"Tool Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestToolRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolTestResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such tool in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many test calls; see `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Tools are not available, or the rate limiter is unavailable."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Call a tool with sample arguments","tags":["tools"],"x-min-role":"editor"}},"/v1/usage":{"get":{"description":"Any signed-in member, or an API key with the scope `usage:read`. The consumption recorded between `since` (inclusive) and `until` (exclusive), by default from the start of the current month (UTC) until now, up to 366 days. `group_by` is `component` (llm, realtime, stt, tts, embeddings, telephony), `provider`, `model`, `assistant`, `campaign`, `day` (midnight of `timezone`, an IANA name, UTC by default) or `source` (call, talk, ingest, search, builder, decider); `then_by` splits each group once more by any of them. Filters: `assistant_id`, `campaign_id`, `component`, `provider`, `model` and `source`; usage that belongs to no call (knowledge ingestion and search) has no assistant or campaign. Each group has its quantities (tokens with the cached, reasoning, audio and text parts, audio seconds, characters, requests) and `cost_usd`, an estimate at the prices of `GET /v1/pricing`: the sum of the rows that have a price, with `unpriced_rows` counting the ones that do not. At most 500 groups (`truncated`). 401 when the token is missing, expired or invalid; 422 for an empty or too long range, an unknown time zone or another invalid parameter; 503 when usage is not available.","operationId":"getUsage","parameters":[{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}},{"in":"query","name":"group_by","required":false,"schema":{"$ref":"#/components/schemas/GroupBy","default":"component"}},{"in":"query","name":"then_by","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/GroupBy"},{"type":"null"}],"title":"Then By"}},{"in":"query","name":"timezone","required":false,"schema":{"default":"UTC","maxLength":64,"minLength":1,"title":"Timezone","type":"string"}},{"in":"query","name":"assistant_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Assistant Id"}},{"in":"query","name":"campaign_id","required":false,"schema":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"title":"Campaign Id"}},{"in":"query","name":"component","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Component"},{"type":"null"}],"title":"Component"}},{"in":"query","name":"provider","required":false,"schema":{"anyOf":[{"maxLength":100,"minLength":1,"type":"string"},{"type":"null"}],"title":"Provider"}},{"in":"query","name":"model","required":false,"schema":{"anyOf":[{"maxLength":200,"minLength":1,"type":"string"},{"type":"null"}],"title":"Model"}},{"in":"query","name":"source","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/UsageSource"},{"type":"null"}],"title":"Source"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The range or a parameter is invalid."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The API key went over its requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Usage is not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"What my organization consumed, with cost estimates","tags":["usage"],"x-api-key-scope":"usage:read","x-min-role":"viewer"}},"/v1/voices":{"get":{"description":"Any signed-in member. The providers' libraries plus the voices the tenant designed or cloned (`owned`, newest first, on the first page only). The `id` is the provider's voice id: use it as the `voice_id` of an ElevenLabs or Cartesia TTS config. `language` (`es`), `accent` (an `id` of `GET /v1/voices/accents`), `gender` and `q` (a name or description search) are applied by each provider's library, so they work across the whole catalog; `provider` limits it to one. `scope` is `owned` (only the tenant's own voices, which carry no language or accent), `library` (no own voices) or `all` (default). A page holds about `limit` voices (default 30, at most 100), split between the providers; `next_cursor` is opaque and goes back as `cursor` for the next page. A voice appears once per provider and id. An ElevenLabs voice with `library_owner_id` is from the shared library and must be added with `POST /v1/voices/shared` before use. Without any provider key the library is empty and `library_configured` is `false`. 401 when the token is missing, expired or invalid; 422 for an invalid parameter or cursor (`invalid_cursor`); 503 until voices are deployed.","operationId":"listVoices","parameters":[{"in":"query","name":"provider","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Provider"},{"type":"null"}],"title":"Provider"}},{"in":"query","name":"gender","required":false,"schema":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Gender"}},{"in":"query","name":"accent","required":false,"schema":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Accent"}},{"in":"query","name":"language","required":false,"schema":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Language"}},{"in":"query","name":"q","required":false,"schema":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"title":"Q"}},{"in":"query","name":"scope","required":false,"schema":{"$ref":"#/components/schemas/VoiceScope","default":"all"}},{"in":"query","name":"limit","required":false,"schema":{"default":30,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":400,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceListResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the voices I can use","tags":["voices"],"x-min-role":"viewer"},"post":{"description":"An `editor` or above keeps a preview from `POST /v1/voices/design` as a voice of the tenant, with a `name` (1 to 80 characters). `description` is the one sent to design. Audited as `voice.create`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the body is invalid; 502 when the provider fails; 503 with code `voices_not_configured` when the provider key is not set.","operationId":"createVoice","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_provider_error`: the provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Save a designed preview as a voice","tags":["voices"],"x-min-role":"editor"}},"/v1/voices/accents":{"get":{"description":"Any signed-in member. The accents (for Spanish: Argentinian, Peruvian, Chilean, Mexican, Castilian...) of `language` (`es`; all languages when omitted) that the providers' libraries know, each with the `id` to send as the `accent` of `GET /v1/voices`. A provider without a key, or that fails, adds none. 401 when the token is missing, expired or invalid; 503 until voices are deployed.","operationId":"listVoiceAccents","parameters":[{"in":"query","name":"language","required":false,"schema":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Language"}},{"in":"query","name":"provider","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Provider"},{"type":"null"}],"title":"Provider"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccentListResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"List the regional variants a voice can be filtered by","tags":["voices"],"x-min-role":"viewer"}},"/v1/voices/clone":{"post":{"description":"An `editor` or above makes an instant voice clone. `multipart/form-data` with `files` (1 to 5 audio samples of at most 10 MB each: mp3, wav, m4a, webm, ogg or flac), `name` (1 to 80 characters), optional `description`, `consent` (must be `true`) and `consent_statement` (10 to 500 characters: who the voice belongs to and that they agree). Without consent the answer is 422 with code `consent_required` and nothing is sent to the provider. Who attested and when is stored with the voice, and the statement only as a hash; the audio is not stored here. Audited as `voice.clone`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when a field is invalid, consent is missing (`consent_required`) or a sample is empty, too large or not audio (`invalid_sample`); 502 when the provider fails; 503 with code `voices_not_configured` when the provider key is not set.","operationId":"cloneVoice","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CloneVoiceForm"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_provider_error`: the provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Clone a voice from audio samples","tags":["voices"],"x-min-role":"editor"}},"/v1/voices/design":{"post":{"description":"An `editor` or above describes a voice (20 to 1,000 characters) and gets generated previews (ElevenLabs voice design), each with an `id` and base64 audio. `text` (100 to 1,000 characters) is what the previews say; omitted, the provider writes it. Nothing is saved: pass a preview `id` to `POST /v1/voices` to keep it. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the body is invalid; 502 when the provider fails; 503 with code `voices_not_configured` when the provider key is not set.","operationId":"designVoice","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignVoiceRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_provider_error`: the provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Generate voice previews from a description","tags":["voices"],"x-min-role":"editor"}},"/v1/voices/shared":{"post":{"description":"An `editor` or above adds a voice of ElevenLabs' shared library (a listed voice with `library_owner_id`) to the provider account, which an assistant's TTS needs before it can speak with it. Send its `public_owner_id` (the listing's `library_owner_id`), `voice_id` and a `name` (1 to 80 characters). The answer is the voice with the `id` to store in the TTS config; adding it twice is harmless. The voice is not listed as the tenant's own. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 422 when the body is invalid; 502 when the provider fails (it refuses some voices, for example on plans without library access); 503 with code `voices_not_configured` when the provider key is not set.","operationId":"addSharedVoice","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSharedVoiceRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_provider_error`: the provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Make a shared-library voice usable","tags":["voices"],"x-min-role":"editor"}},"/v1/voices/{provider}/{voice_id}/preview":{"get":{"description":"Any signed-in member. The audio of a library voice's preview, fetched with the organization's own provider credential (its own, else the platform's when allowed), for providers whose previews need that credential: today `cartesia`. A voice whose listing has a `preview_url` pointing here has a preview; the browser cannot fetch the provider's file itself. Providers whose `preview_url` is public (`elevenlabs`) answer 404. The body is the audio (`audio/*`), cached privately for an hour, at most 5 MB. 401 when the token is missing, expired or invalid; 404 when the provider has no preview for the voice; 422 when `provider` or `voice_id` is malformed; 502 when the provider fails; 503 with code `voices_not_configured` when the organization has no credential for the provider.","operationId":"getVoicePreview","parameters":[{"in":"path","name":"provider","required":true,"schema":{"$ref":"#/components/schemas/Provider"}},{"in":"path","name":"voice_id","required":true,"schema":{"pattern":"^[A-Za-z0-9_-]{8,64}$","title":"Voice Id","type":"string"}}],"responses":{"200":{"content":{"audio/*":{"schema":{"format":"binary","type":"string"}}},"description":"The preview audio."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The provider has no preview for it."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_provider_error`: the provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Play a library voice's preview","tags":["voices"],"x-min-role":"viewer"}},"/v1/voices/{voice_id}":{"delete":{"description":"An `editor` or above deletes a voice the tenant designed or cloned, at the provider and here. Library voices cannot be deleted (404). Assistants that use the voice keep its id and fail to speak until another voice is chosen. Audited as `voice.delete`. 401 when the token is missing, expired or invalid; 403 when the caller is a `viewer`; 404 when the voice is not one of the tenant's; 502 when the provider fails; 503 with code `voices_not_configured` when the provider key is not set.","operationId":"deleteVoice","parameters":[{"in":"path","name":"voice_id","required":true,"schema":{"pattern":"^[A-Za-z0-9]{10,40}$","title":"Voice Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such voice of the caller's tenant."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_provider_error`: the provider failed."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"`voices_not_configured`: the provider key is not set. Or not deployed yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delete a voice of my organization","tags":["voices"],"x-min-role":"editor"}},"/v1/webhooks":{"get":{"description":"Any signed-in member (not an API key). The https endpoints that receive the organization's events, oldest first. The secret is never listed. 401 when the token is missing, expired or invalid; 503 until webhooks are deployed.","operationId":"listWebhooks","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Result webhooks of my organization","tags":["webhooks"],"x-min-role":"viewer"},"post":{"description":"An `admin` or above (not an API key). `url` must be https, with a public host. `events` are among the events of the catalog marked `webhook` (`campaign.started`, `campaign.completed`, `campaign.attempt.completed`, `call.result`, `call.analyzed`; `packages/contracts/events/catalog.json`). Each delivery is a POST with the event as JSON, signed in `X-eco-Signature` (`v1=` plus the hex HMAC-SHA256 of `{X-eco-Timestamp}.{body}` with the secret; every `X-eco-*` header also goes as `X-Froneus-*`, its name before the rename), and carries the event data: ids, outcome, duration and attempt number (and the last 4 digits of the phone) for campaign events, the extracted result or the analysis for call events. A failed delivery is retried with backoff and is dead after 8 attempts. The `secret` is returned in this response only. An organization has at most 10. 401 when the token is missing, expired or invalid; 403 below `admin`; 409 at the limit; 422 when the body is invalid; 503 until webhooks are deployed.","operationId":"createWebhook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecretResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The organization has 10 webhooks already."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Add a result webhook","tags":["webhooks"],"x-min-role":"admin"}},"/v1/webhooks/{webhook_id}":{"get":{"description":"Any signed-in member (not an API key). 401 when the token is missing, expired or invalid; 404 when it is not the organization's; 503 until webhooks are deployed.","operationId":"getWebhook","parameters":[{"in":"path","name":"webhook_id","required":true,"schema":{"format":"uuid","title":"Webhook Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such webhook in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"One result webhook","tags":["webhooks"],"x-min-role":"viewer"},"patch":{"description":"An `admin` or above (not an API key). Only the fields sent change; `active: false` pauses it, and nothing is queued for it meanwhile. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 422 when the body is invalid; 503 until webhooks are deployed.","operationId":"updateWebhook","parameters":[{"in":"path","name":"webhook_id","required":true,"schema":{"format":"uuid","title":"Webhook Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such webhook in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Change a result webhook","tags":["webhooks"],"x-min-role":"admin"},"delete":{"description":"An `admin` or above (not an API key). Its delivery log goes with it. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 503 until webhooks are deployed.","operationId":"deleteWebhook","parameters":[{"in":"path","name":"webhook_id","required":true,"schema":{"format":"uuid","title":"Webhook Id","type":"string"}}],"responses":{"204":{"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such webhook in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Remove a result webhook","tags":["webhooks"],"x-min-role":"admin"}},"/v1/webhooks/{webhook_id}/deliveries":{"get":{"description":"Any signed-in member (not an API key). Newest first. `status` keeps `pending`, `delivered` or `dead`. Pass `next_cursor` of a page as `cursor` to get the next one; `limit` is at most 200 (default 100). 401 when the token is missing, expired or invalid; 404 when it is not the organization's; 422 when a parameter is out of range or the cursor is not one we issued; 503 until webhooks are deployed.","operationId":"listWebhookDeliveries","parameters":[{"in":"path","name":"webhook_id","required":true,"schema":{"format":"uuid","title":"Webhook Id","type":"string"}},{"in":"query","name":"status","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DeliveryStatus"},{"type":"null"}],"title":"Status"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such webhook in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Delivery log of a result webhook","tags":["webhooks"],"x-min-role":"viewer"}},"/v1/webhooks/{webhook_id}/rotate-secret":{"post":{"description":"An `admin` or above (not an API key). The old secret stops working at once; the new one is in this response only. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 503 until webhooks are deployed.","operationId":"rotateWebhookSecret","parameters":[{"in":"path","name":"webhook_id","required":true,"schema":{"format":"uuid","title":"Webhook Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookWithSecretResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such webhook in the caller's tenant."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not available yet."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Rotate the secret of a result webhook","tags":["webhooks"],"x-min-role":"admin"}},"/v1/webhooks/{webhook_id}/test":{"post":{"description":"An `admin` or above (not an API key). Sends a signed `webhook.test` event now, outside the queue, and says what came back: `ok`, the HTTP `status_code`, an `error` class and the `duration_ms`. The response body of your endpoint is never returned. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 429 when the organization sends too many tests, with `Retry-After` (at most 20 per minute per organization, `TOOL_TESTS_PER_MINUTE`, shared by tool and webhook tests and counted across replicas when Redis is set); 503 until webhooks are deployed or when the rate limiter is unavailable.","operationId":"testWebhook","parameters":[{"in":"path","name":"webhook_id","required":true,"schema":{"format":"uuid","title":"Webhook Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResponse"}}},"description":"Successful Response"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing, expired or invalid token."},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Role below the one this operation needs."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"No such webhook in the caller's tenant."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many tests; see `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhooks are not deployed, or the rate limiter is unavailable."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Default Response"}},"security":[{"HTTPBearer":[]}],"summary":"Send a test event to a result webhook","tags":["webhooks"],"x-min-role":"admin"}}},"servers":[{"url":"https://api.eco-peru.froneus.com"}],"tags":[{"description":"Service status.","name":"system"},{"description":"Who is signed in.","name":"identity"},{"description":"Who changed what.","name":"audit"},{"description":"Contact imports and the do-not-call list.","name":"contacts"},{"description":"Voice assistants: list, create, edit the draft and publish.","name":"assistants"},{"description":"Outbound campaigns and their call attempts.","name":"campaigns"},{"description":"The call log: every call with its timeline.","name":"calls"},{"description":"Call KPIs, series and breakdowns.","name":"metrics"},{"description":"Consumption per provider and component, with costs.","name":"usage"},{"description":"The organization's credit: balance, limit, mode.","name":"credit"},{"description":"Campaign reports and CSV exports.","name":"reports"},{"description":"API keys to call the API from your own systems.","name":"api-keys"},{"description":"Webhook tools an assistant can call during a call.","name":"tools"},{"description":"Signed https webhooks that receive campaign and call events.","name":"webhooks"},{"description":"Remote MCP servers whose tools an assistant can call.","name":"mcp"},{"description":"Voice library, design and cloning.","name":"voices"},{"description":"The organization's own keys for model, speech and voice providers.","name":"provider-credentials"},{"description":"The phone numbers eco assigned to the organization.","name":"sip-numbers"},{"description":"Pronunciation dictionaries: how written forms are said.","name":"pronunciation"},{"description":"Knowledge bases: documents an assistant can search during a call.","name":"knowledge"},{"description":"Scripted tests and simulations of an assistant, and the publish gate.","name":"tests"},{"description":"A/B traffic split between published versions of an assistant.","name":"experiments"}]}