{"openapi":"3.1.0","info":{"title":"Headless Contact Center API","version":"1.0.0","description":"Rate limits: 100 requests per 10 seconds per live API key, 25 per Test key, and 300 per workspace across its keys, with 1000 per IP address in front of them. They count per Cloudflare location and are approximate. Past one, a request gets `429 rate_limited` with `Retry-After`; it does not run, does not use up an `Idempotency-Key`, is not billed and is not on the Logs page."},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (`hcc_live_...` or `hcc_test_...`) created in the dashboard"}},"schemas":{"BillingStatus":{"type":"object","properties":{"enabled":{"type":"boolean"},"exempt":{"type":"boolean"},"plan":{"type":["string","null"],"enum":["build","team","scale",null]},"interval":{"type":["string","null"],"enum":["month","year",null],"description":"How the plan bills. Null: no plan yet"},"status":{"type":"string"},"stopped":{"type":["string","null"],"enum":["billing_required","billing_past_due","billing_disputed","usage_limit_reached","plan_has_no_seats","test_cap_reached",null],"description":"Why new live calls are stopped. Null: they are not"},"seats":{"type":"object","properties":{"paid":{"type":"number"},"counted":{"type":"number"},"minimum":{"type":"number"},"priceCents":{"type":["number","null"],"description":"One seat for the interval, before tax. Null: no seats"}},"required":["paid","counted","minimum","priceCents"]},"nextChargeCents":{"type":["number","null"],"description":"The renewal at today’s seats, before tax and any discount. Null: none coming"},"overageCents":{"type":"number","description":"Past the allowance so far this period"},"currentPeriodEnd":{"type":["string","null"]},"cancelAt":{"type":["string","null"]},"usagePeriodEnd":{"type":["string","null"]},"spendCapCents":{"type":["number","null"]},"usage":{"type":"array","items":{"type":"object","properties":{"meter":{"type":"string","enum":["transcripts","automation","storage","dials","api"]},"name":{"type":"string"},"unit":{"type":"string"},"units":{"type":"number"},"allowance":{"type":"number"},"overage":{"type":"number"},"overageCents":{"type":"number"},"rateCents":{"type":"number","description":"One unit past the allowance"}},"required":["meter","name","unit","units","allowance","overage","overageCents","rateCents"]}}},"required":["enabled","exempt","plan","interval","status","stopped","seats","nextChargeCents","overageCents","currentPeriodEnd","cancelAt","usagePeriodEnd","spendCapCents","usage"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{},"requestId":{"type":"string","description":"The request id, also in the `Request-Id` header. Find the request on the Logs page, or quote it to support.","example":"req_01jbx3k7m9q2w8e4r6t5y7u9i0"}},"required":["code","message","requestId"]}},"required":["error"]},"Call":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","ringing","in_progress","completed","busy","no_answer","failed","canceled"]},"from":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"phoneNumberId":{"type":["string","null"]},"agentId":{"type":["string","null"]},"environment":{"type":"string","enum":["live","test"],"description":"`test` calls run on the simulated carrier and never reach a phone"},"startedAt":{"type":["string","null"],"format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"durationSeconds":{"type":["integer","null"]},"flow":{"type":["string","null"],"description":"The call flow this call runs, if any"},"flowVersion":{"type":["string","null"],"description":"The flow version the call started with"},"disposition":{"type":["string","null"],"description":"Set by the flow's `hangup({ disposition })`, or a rep's wrap-up"},"repId":{"type":["string","null"],"description":"A rep outbound call: the rep it was placed for"},"context":{"description":"A rep outbound call: its `context`"},"outcome":{"type":["string","null"],"enum":["completed","rep_unavailable","busy","no_answer","failed","cancelled","voicemail_left",null],"description":"How a rep outbound call ended: `completed`, `rep_unavailable` (the rep never answered, the customer was not dialed), `busy`, `no_answer`, `failed` or `cancelled`. On a campaign's call: `voicemail_left`, when `onVoicemail` left a message on a machine"}},"required":["id","direction","status","from","to","phoneNumberId","agentId","environment","startedAt","answeredAt","endedAt","durationSeconds","flow","flowVersion","disposition","repId","outcome"]},"CreateCall":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"One of the tenant numbers. Required, except with `repId`: then it defaults to the rep's caller ID, the workspace's, or the first number.","example":"+14155550100"},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","example":"+14155550123"},"recording":{"type":"boolean","enum":[false],"description":"`false`: this call is not recorded, whatever the recording policy says. It can only turn recording off."},"timezone":{"type":"string","maxLength":64,"description":"The callee's IANA time zone, for the calling hours check (8:00 to 21:00). Used when no lead with this number has one: a lead's zone comes first. With neither the call is placed, and audited as not checked. Not with `repId`.","example":"America/New_York"},"instructions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]}]},"minItems":1,"maxItems":50,"description":"Call Instructions to run once the call is answered. Give this or `agentId`."},"agentId":{"type":"string","minLength":1,"description":"Shorthand for `instructions: [{ type: \"connectAgent\", agentId, variables }]`: our `agt_…` id or the platform agent id. Give this or `instructions`.","example":"agt_01jabc"},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Dynamic variables for the agent; only with `agentId`."},"flow":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i","description":"Run this registered call flow: its handlers drive the call. Give this, `instructions` or `agentId`. The API key picks the environment (live or test).","example":"qualify"},"input":{"type":"object","additionalProperties":{},"description":"The flow's input, checked against the schema it registered; only with `flow`.","example":{"leadId":"l_1","name":"Ana"}},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$","description":"Place the call for this rep (click-to-call): the rep's softphone rings first, and the customer is dialed once they answer. Not with `instructions`, `agentId` or `flow`. Refusals: 409 `rep_busy` / `rep_offline`, 422 `caller_id_not_owned`, `no_caller_id`, `do_not_call`, 409 `conflict` (no softphone).","example":"rep_01jabc"},"context":{"description":"With `repId`: up to 4 KB of JSON kept on the call and its events.","example":{"leadId":"l_1"}}},"required":["to"]},"UpdateCallInstructions":{"type":"object","properties":{"instructions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]}]},"minItems":1,"maxItems":50}},"required":["instructions"]},"AiSummarySet":{"type":"object","properties":{"applied":{"type":"boolean","description":"Whether this is now what reps see. Blank text changes nothing."}},"required":["applied"]},"SetAiSummary":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":16384,"description":"What the rep is told of the AI agent's conversation. Cut to 2 KB."}},"required":["text"]},"EmittedCallEvent":{"type":"object","properties":{"id":{"type":"string","description":"The flow event id (stable across our retries)"},"applied":{"type":"boolean","description":"Whether the handler returned actions we applied"}},"required":["id","applied"]},"EmitCallEvent":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9._:-]{0,127}$/i","example":"lead.flagged"},"payload":{}},"required":["name"]},"Consult":{"type":"object","properties":{"id":{"type":"string"},"callId":{"type":"string"},"status":{"type":"string","enum":["dialing","consulting","merged","ended"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string"}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string"}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string"}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string"}},"required":["type","repId"]}]},"repId":{"type":"string"},"targetRepId":{"type":["string","null"]},"transferId":{"type":["string","null"]},"outcome":{"type":["string","null"],"enum":["completed","canceled","target_failed","target_left","caller_left",null]},"reason":{"type":["string","null"],"enum":["busy","no_answer","failed","unavailable","queue_overflow","queue_closed","queue_outside_hours","rep_unavailable",null]},"startedAt":{"type":"string"},"connectedAt":{"type":["string","null"]},"mergedAt":{"type":["string","null"]},"endedAt":{"type":["string","null"]}},"required":["id","callId","status","target","repId","targetRepId","transferId","outcome","reason","startedAt","connectedAt","mergedAt","endedAt"],"description":"A Rep's consult on a call: the customer is on hold while the Rep talks to a Rep, queue or number, then hands over (`complete`), comes back (`cancel`) or brings everyone together (`merge`)."},"StartConsult":{"type":"object","properties":{"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$","description":"The Rep on the call who is consulting"},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"}},"required":["type","repId"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]}]}},"required":["repId","target"]},"PhoneNumber":{"type":"object","properties":{"id":{"type":"string"},"e164":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"provider":{"type":"string"},"defaultAgentId":{"type":["string","null"]},"callWebhookUrl":{"type":["string","null"]},"flow":{"type":["string","null"],"description":"Call flow inbound calls run, if set"},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["id","e164","provider","defaultAgentId","callWebhookUrl","flow","createdAt"]},"Agent":{"type":"object","properties":{"id":{"type":"string","example":"agt_01jabc"},"provider":{"type":"string","description":"Id of the voice-AI integration provider"},"providerAgentId":{"type":"string","description":"The agent's id in the provider"},"name":{"type":"string"},"enabled":{"type":"boolean","description":"Only enabled, non-removed agents are routable"},"removed":{"type":"boolean","description":"The agent no longer exists in the provider"},"metadata":{"type":"object","additionalProperties":{}},"syncedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","provider","providerAgentId","name","enabled","removed","metadata","syncedAt"],"description":"A read-only mirror of an agent in one of your connected AI-agent platforms. Manage agents there."},"Integration":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string","enum":["active","error"]},"agentCount":{"type":"integer","description":"Live (non-removed) agents"},"lastSyncedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["id","provider","status","agentCount","lastSyncedAt","createdAt"],"description":"A connected voice-AI platform account"},"UpdatePhoneNumber":{"type":"object","properties":{"flow":{"type":["string","null"],"pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i","description":"Inbound calls to this number run this call flow; null clears it.","example":"support"}},"required":["flow"]},"Telephony":{"type":"object","properties":{"status":{"type":"string","enum":["not_configured","pending","ready","failed"],"description":"`pending` while managed onboarding runs; `failed` if it did (see the dashboard)."},"ownership":{"type":["string","null"],"enum":["managed","connected",null],"description":"`managed`: created and paid by us. `connected`: your own provider account."},"provider":{"type":["string","null"],"description":"Telephony provider id, e.g. `twilio`"}},"required":["status","ownership","provider"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"type":["string","null"]},"eventTypes":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["id","url","description","eventTypes","enabled","createdAt"]},"Flow":{"type":"object","properties":{"name":{"type":"string","example":"qualify"},"version":{"type":"string","description":"A hash of the flow definition, or the deploy id"},"environment":{"type":"string","enum":["live","test"]},"definition":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"version":{"type":"string","minLength":1,"maxLength":128},"timeoutMs":{"type":"integer","minimum":100,"maximum":5000},"inputSchema":{"type":"object","additionalProperties":{}},"stateSchema":{"type":"object","additionalProperties":{}},"handlers":{"type":"array","items":{"type":"string","enum":["call.answered","call.no_answer","call.voicemail","call.hangup","call.gather","call.agent.tool","call.agent.ended","call.agent.summary","call.custom","call.transfer.failed","call.error"]},"maxItems":11,"default":[]},"customEvents":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._:-]{0,127}$/i"},"maxItems":100,"default":[]},"fallbacks":{"type":"object","properties":{"call.answered":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.no_answer":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.voicemail":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.hangup":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.gather":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.tool":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.ended":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.summary":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.custom":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.transfer.failed":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.error":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50}},"default":{}},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$/i"},"description":{"type":"string","maxLength":1024},"parameters":{"type":"object","additionalProperties":{}},"timeoutMs":{"type":"integer","minimum":100,"maximum":5000},"afterSpeech":{"type":"boolean"}},"required":["name","parameters"]},"maxItems":64,"default":[]},"agents":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$/i"},"agentId":{"type":"string","minLength":1,"maxLength":256},"provider":{"type":"string","minLength":1,"maxLength":64},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64,"default":[]},"testBranch":{"type":"boolean","enum":[true]}},"required":["alias","agentId"]},"maxItems":32,"default":[]}},"required":["name","version"]},"createdAt":{"type":"string","format":"date-time"},"activatedAt":{"type":"string","format":"date-time","description":"Since when new calls run this version"},"lastSeenAt":{"type":"string","format":"date-time","description":"Last time a server reported this version"}},"required":["name","version","environment","definition","createdAt","activatedAt","lastSeenAt"],"description":"A registered call flow version. Calls keep the version they started with; new calls run the active version."},"FlowEndpoint":{"type":"object","properties":{"environment":{"type":"string","enum":["live","test"]},"url":{"type":["string","null"],"description":"Where flow events are POSTed; null until set"},"secret":{"type":"string","description":"Signing secret: `hcc.serve` verifies `Hcc-Signature` with it","example":"whsec_…"}},"required":["environment","url","secret"]},"FlowBindingWarning":{"type":"object","properties":{"code":{"type":"string","enum":["agent_not_routable","tools_not_supported","agent_bound_in_other_environment","test_branch_not_supported","native_transfer_in_test_branch"]},"flow":{"type":"string"},"alias":{"type":"string"},"agentId":{"type":"string","description":"Our `agt_…` id"},"message":{"type":"string"}},"required":["code","flow","alias","agentId","message"]},"RegisterFlows":{"type":"object","properties":{"flows":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"version":{"type":"string","minLength":1,"maxLength":128},"timeoutMs":{"type":"integer","minimum":100,"maximum":5000},"inputSchema":{"type":"object","additionalProperties":{}},"stateSchema":{"type":"object","additionalProperties":{}},"handlers":{"type":"array","items":{"type":"string","enum":["call.answered","call.no_answer","call.voicemail","call.hangup","call.gather","call.agent.tool","call.agent.ended","call.agent.summary","call.custom","call.transfer.failed","call.error"]},"maxItems":11,"default":[]},"customEvents":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._:-]{0,127}$/i"},"maxItems":100,"default":[]},"fallbacks":{"type":"object","properties":{"call.answered":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.no_answer":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.voicemail":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.hangup":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.gather":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.tool":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.ended":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.summary":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.custom":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.transfer.failed":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.error":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50}},"default":{}},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$/i"},"description":{"type":"string","maxLength":1024},"parameters":{"type":"object","additionalProperties":{}},"timeoutMs":{"type":"integer","minimum":100,"maximum":5000},"afterSpeech":{"type":"boolean"}},"required":["name","parameters"]},"maxItems":64,"default":[]},"agents":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$/i"},"agentId":{"type":"string","minLength":1,"maxLength":256},"provider":{"type":"string","minLength":1,"maxLength":64},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64,"default":[]},"testBranch":{"type":"boolean","enum":[true]}},"required":["alias","agentId"]},"maxItems":32,"default":[]}},"required":["name","version"]},"maxItems":100},"mode":{"type":"string","enum":["report","deploy"],"default":"report"},"endpointUrl":{"type":"string","format":"uri","description":"Your `hcc.serve` URL","example":"https://example.com/api/hcc"},"alsoTest":{"type":"boolean","default":false,"description":"Live keys only: also register the same versions in test, with the same endpoint URL, so the simulator can run them. The test copy syncs no tools to agent platforms: test calls play the agent in the simulator."},"toolSync":{"type":"string","enum":["all","test_branches"],"default":"all","description":"Test keys only: `test_branches` syncs tools to test branches and leaves an agent's main alone, which is what `hcc dev` sends on every save."}},"required":["flows"]},"FlowDrift":{"type":"object","properties":{"kind":{"type":"string","enum":["not_deployed","version_differs","binding_differs","not_served"]},"flow":{"type":"string"},"message":{"type":"string"}},"required":["kind","flow","message"]},"ObserveFlows":{"type":"object","properties":{"flows":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"agents":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string"},"agentId":{"type":"string"}},"required":["alias","agentId"]},"maxItems":100}},"required":["name","version","agents"]},"maxItems":100}},"required":["flows"]},"FlowVersionInUse":{"type":"object","properties":{"flow":{"type":"string"},"version":{"type":"string"},"environment":{"type":"string","enum":["live","test"]},"reason":{"type":"string","enum":["active","live_call"],"description":"`active`: new calls run it. `live_call`: a call still going started on it or last ran it"}},"required":["flow","version","environment","reason"]},"SetFlowEndpoint":{"type":"object","properties":{"url":{"type":["string","null"],"format":"uri","description":"Your `hcc.serve` URL","example":"https://example.com/api/hcc"}},"required":["url"]},"Rep":{"type":"object","properties":{"id":{"type":"string","example":"rep_01j…"},"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"enabled":{"type":"boolean"},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10},"description":"Skill name → level 1-10","example":{"english":5,"sales":3}},"maxConcurrentCalls":{"type":"integer"},"defaultCallerId":{"type":["string","null"],"description":"The caller ID of the rep's outbound calls when none is given"},"device":{"type":"string","enum":["softphone","phone"],"description":"Where calls ring: the browser `softphone`, or the rep's own verified `phone` (call screening: they press 1 to take each call)"},"phone":{"$ref":"#/components/schemas/RepPhone"},"state":{"type":"string","enum":["offline","available","on_call","wrap_up","away"]},"reason":{"type":["string","null"],"description":"Why the rep is away, e.g. `lunch`"},"stateSince":{"type":"string","format":"date-time"},"callId":{"type":["string","null"],"description":"The call the rep is on, if any"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","userId","name","email","enabled","skills","maxConcurrentCalls","defaultCallerId","device","phone","state","reason","stateSince","callId","createdAt","updatedAt"],"description":"A human who takes calls: a workspace member enabled as a rep in the dashboard, with skills and a live state. Routing sets `on_call` and `wrap_up`."},"RepPhone":{"type":["object","null"],"properties":{"e164":{"type":"string","description":"E.164; masked to the last 4 digits for members who are not owners or admins","example":"+14155550123"},"label":{"type":["string","null"],"example":"Mobile"},"verified":{"type":"boolean"},"verifiedAt":{"type":["string","null"],"format":"date-time"},"verifiedEnvironment":{"type":["string","null"],"enum":["live","test",null],"description":"`test`: verified on the simulator, so only simulated calls ring it; live calls go to the softphone until it is verified with a live key"}},"required":["e164","label","verified","verifiedAt","verifiedEnvironment"],"description":"The rep's own phone, if registered"},"UpdateRep":{"type":"object","properties":{"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"enabled":{"type":"boolean"},"defaultCallerId":{"type":["string","null"],"pattern":"^\\+[1-9]\\d{1,14}$","description":"One of the tenant numbers, or `null` for the workspace default"},"device":{"type":"string","enum":["softphone","phone"],"description":"`phone` needs a verified phone (409 otherwise)"}}},"SetRepState":{"type":"object","properties":{"state":{"type":"string","enum":["available","away","offline"]},"reason":{"type":["string","null"],"minLength":1,"maxLength":64,"description":"For `away`"}},"required":["state"]},"RepPhoneVerification":{"type":"object","properties":{"verificationId":{"type":"string","example":"rpv_01j…"},"expiresAt":{"type":"string","format":"date-time"},"environment":{"type":"string","enum":["live","test"],"description":"Test keys place the verification call on the simulator"}},"required":["verificationId","expiresAt","environment"]},"SetRepPhone":{"type":"object","properties":{"e164":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"label":{"type":["string","null"],"minLength":1,"maxLength":40,"example":"Mobile"}},"required":["e164"]},"VerifyRepPhone":{"type":"object","properties":{"code":{"type":"string","pattern":"^[0-9]{4,10}$"}},"required":["code"]},"RepWrapUp":{"type":"object","properties":{"callId":{"type":"string","minLength":1},"disposition":{"type":"string","minLength":1,"maxLength":100},"notes":{"type":"string","maxLength":2000}},"required":["callId","disposition"]},"Queue":{"type":"object","properties":{"name":{"type":"string","example":"sales"},"version":{"type":"string","description":"A hash of the definition"},"environment":{"type":"string","enum":["live","test"]},"definition":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"displayName":{"type":"string","minLength":1,"maxLength":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10},"default":{}},"priority":{"type":"integer","minimum":0,"maximum":100,"default":0},"maxWaitSeconds":{"type":"integer","minimum":10,"maximum":86400,"default":300},"holdMusicUrl":{"type":"string","format":"uri"},"announcePositionSeconds":{"type":["integer","null"],"minimum":15,"maximum":600,"default":null},"overflow":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["voicemail"]}},"required":["type"]}]},"wrapUpSeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0},"strategy":{"type":"string","enum":["longest_idle","round_robin"],"default":"longest_idle"},"serviceLevel":{"type":"object","properties":{"seconds":{"type":"integer","minimum":1,"maximum":3600},"target":{"type":"number","minimum":0,"maximum":1}},"required":["seconds","target"]},"recording":{"type":"boolean","enum":[false]},"hours":{"type":"object","properties":{"timezone":{"type":"string"},"weekly":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},"name":{"type":"string","minLength":1,"maxLength":100},"closed":{"type":"boolean","enum":[true]},"open":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"minItems":1,"maxItems":48}},"required":["date"],"additionalProperties":false},"maxItems":366},"atClose":{"type":"string","enum":["drain","turn_away"],"default":"drain"}},"required":["timezone","weekly"]}},"required":["name"]},"hours":{"type":["object","null"],"properties":{"timezone":{"type":"string"},"weekly":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},"name":{"type":"string","minLength":1,"maxLength":100},"closed":{"type":"boolean","enum":[true]},"open":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"minItems":1,"maxItems":48}},"required":["date"],"additionalProperties":false},"maxItems":366},"atClose":{"type":"string","enum":["drain","turn_away"],"default":"drain"}},"required":["timezone","weekly"],"description":"As deployed; `null`: always open"},"open":{"type":"boolean","description":"Within its hours now"},"nextChangeAt":{"type":["string","null"],"format":"date-time","description":"When `open` next flips: `null` without hours, or if nothing changes for 14 days"},"createdAt":{"type":"string","format":"date-time"},"activatedAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"}},"required":["name","version","environment","definition","hours","open","nextChangeAt","createdAt","activatedAt","lastSeenAt"],"description":"A queue declared in code (`defineQueue`): the skills its reps need, how long callers wait, what happens when nobody answers."},"RegisterQueues":{"type":"object","properties":{"queues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"displayName":{"type":"string","minLength":1,"maxLength":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10},"default":{}},"priority":{"type":"integer","minimum":0,"maximum":100,"default":0},"maxWaitSeconds":{"type":"integer","minimum":10,"maximum":86400,"default":300},"holdMusicUrl":{"type":"string","format":"uri"},"announcePositionSeconds":{"type":["integer","null"],"minimum":15,"maximum":600,"default":null},"overflow":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["voicemail"]}},"required":["type"]}]},"wrapUpSeconds":{"type":"integer","minimum":0,"maximum":3600,"default":0},"strategy":{"type":"string","enum":["longest_idle","round_robin"],"default":"longest_idle"},"serviceLevel":{"type":"object","properties":{"seconds":{"type":"integer","minimum":1,"maximum":3600},"target":{"type":"number","minimum":0,"maximum":1}},"required":["seconds","target"]},"recording":{"type":"boolean","enum":[false]},"hours":{"type":"object","properties":{"timezone":{"type":"string"},"weekly":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},"name":{"type":"string","minLength":1,"maxLength":100},"closed":{"type":"boolean","enum":[true]},"open":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"minItems":1,"maxItems":48}},"required":["date"],"additionalProperties":false},"maxItems":366},"atClose":{"type":"string","enum":["drain","turn_away"],"default":"drain"}},"required":["timezone","weekly"]}},"required":["name"]},"maxItems":100},"mode":{"type":"string","enum":["report","deploy"],"default":"report"},"alsoTest":{"type":"boolean","default":false,"description":"Live keys only: also register the same versions in test (the simulator)"}},"required":["queues"]},"QueueStats":{"type":"object","properties":{"name":{"type":"string"},"waiting":{"type":"integer"},"longestWaitSeconds":{"type":"integer"},"repsAvailable":{"type":"integer"},"repsLoggedIn":{"type":"integer","description":"Reps with the skills who are not offline"},"hours":{"type":["object","null"],"properties":{"timezone":{"type":"string"},"weekly":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"maxItems":48}},"additionalProperties":false},"exceptions":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},"name":{"type":"string","minLength":1,"maxLength":100},"closed":{"type":"boolean","enum":[true]},"open":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},{"type":"string","pattern":"^(?:(?:[01][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}]},"minItems":1,"maxItems":48}},"required":["date"],"additionalProperties":false},"maxItems":366},"atClose":{"type":"string","enum":["drain","turn_away"],"default":"drain"}},"required":["timezone","weekly"],"description":"As deployed; `null`: always open"},"open":{"type":"boolean","description":"Within its hours now"},"nextChangeAt":{"type":["string","null"],"format":"date-time","description":"When `open` next flips: `null` without hours, or if nothing changes for 14 days"}},"required":["name","waiting","longestWaitSeconds","repsAvailable","repsLoggedIn","hours","open","nextChangeAt"]},"RecordingPolicy":{"type":"object","properties":{"version":{"type":"string"},"environment":{"type":"string","enum":["live","test"]},"definition":{"type":"object","properties":{"mode":{"type":"string","enum":["record","off"]},"notice":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000,"default":"This call may be recorded and transcribed."},"voice":{"type":"string","minLength":1,"maxLength":64},"language":{"type":"string","minLength":1,"maxLength":16}},"default":{}},"retention":{"type":"object","properties":{"audioDays":{"type":"integer","minimum":1,"maximum":3650,"default":90},"transcriptDays":{"type":"integer","minimum":1,"maximum":3650,"default":365}},"default":{}},"transcribe":{"anyOf":[{"type":"boolean","enum":[false]},{"type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":16},"redact":{"type":"array","items":{"type":"string","enum":["pci","ssn"]},"maxItems":2}}}],"default":false}},"required":["mode"]},"createdAt":{"type":"string"},"activatedAt":{"type":"string"},"lastSeenAt":{"type":"string"}},"required":["version","environment","definition","createdAt","activatedAt","lastSeenAt"],"description":"What `defineRecordingPolicy` declares. Off unless one is deployed."},"RegisterRecordingPolicy":{"type":"object","properties":{"policy":{"type":"object","properties":{"mode":{"type":"string","enum":["record","off"]},"notice":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000,"default":"This call may be recorded and transcribed."},"voice":{"type":"string","minLength":1,"maxLength":64},"language":{"type":"string","minLength":1,"maxLength":16}},"default":{}},"retention":{"type":"object","properties":{"audioDays":{"type":"integer","minimum":1,"maximum":3650,"default":90},"transcriptDays":{"type":"integer","minimum":1,"maximum":3650,"default":365}},"default":{}},"transcribe":{"anyOf":[{"type":"boolean","enum":[false]},{"type":"object","properties":{"language":{"type":"string","minLength":2,"maxLength":16},"redact":{"type":"array","items":{"type":"string","enum":["pci","ssn"]},"maxItems":2}}}],"default":false}},"required":["mode"]},"mode":{"type":"string","enum":["report","deploy"],"default":"report"},"alsoTest":{"type":"boolean","default":false,"description":"Live keys only: also register the same version in test"}},"required":["policy"]},"RecordingPolicyStatus":{"type":"object","properties":{"policy":{"allOf":[{"$ref":"#/components/schemas/RecordingPolicy"},{"type":["object","null"]}]},"suspendedAt":{"type":["string","null"],"description":"When the workspace's stop switch was set; nothing records while it is on"},"suspendedBy":{"type":["string","null"]}},"required":["policy","suspendedAt","suspendedBy"]},"RecordingControlResult":{"type":"object","properties":{"phase":{"type":"string"}},"required":["phase"]},"Recording":{"type":"object","properties":{"id":{"type":"string"},"callId":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"channels":{"type":["integer","null"],"description":"Channels in the file. Two channels do not promise one speaker per channel on calls with a rep."},"durationSeconds":{"type":["integer","null"]},"startedAt":{"type":["string","null"]},"pauses":{"type":"array","items":{"type":"object","properties":{"pausedAt":{"type":"string"},"resumedAt":{"type":["string","null"]}},"required":["pausedAt","resumedAt"]}},"contentType":{"type":["string","null"]},"bytes":{"type":["integer","null"]},"deleteAfter":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","callId","status","source","channels","durationSeconds","startedAt","pauses","contentType","bytes","deleteAfter","deletedAt","createdAt"]},"CallTranscriptSummary":{"type":"object","properties":{"id":{"type":"string"},"callId":{"type":"string"},"recordingId":{"type":"string"},"status":{"type":"string","enum":["pending","processing","ready","partial","failed","deleted"]},"failureReason":{"type":["string","null"],"enum":["no_audio","provider_error","unsupported_audio","not_configured","billing","suspended",null]},"repIds":{"type":"array","items":{"type":"string"}},"language":{"type":["string","null"]},"speakerSeparation":{"type":["string","null"],"enum":["channels","diarized","none",null],"description":"`channels`: speakers come from the file's channels, on a transcript that showed two separate voices. `diarized`: the provider estimated them, as `unknown` with a `speakerTag`. `none`: one voice, unlabeled."},"segmentCount":{"type":"integer"},"deleteAfter":{"type":["string","null"]},"deletedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","callId","recordingId","status","failureReason","repIds","language","speakerSeparation","segmentCount","deleteAfter","deletedAt","createdAt"]},"CallTranscript":{"allOf":[{"$ref":"#/components/schemas/CallTranscriptSummary"},{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","properties":{"startMs":{"type":"integer","minimum":0},"endMs":{"type":"integer","minimum":0},"channel":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[2]},{"type":"null"}]},"speaker":{"type":"string","enum":["rep","customer","supervisor","external","mixed","unknown"]},"speakerTag":{"type":["integer","null"],"minimum":0},"participantId":{"type":["string","null"]},"repId":{"type":["string","null"]},"text":{"type":"string"},"confidence":{"type":["number","null"]}},"required":["startMs","endMs","channel","speaker","speakerTag","participantId","repId","text","confidence"]}}},"required":["segments"]}]},"DncNumber":{"type":"object","properties":{"e164":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","example":"+14155550123"},"reason":{"type":["string","null"]},"source":{"type":"string","enum":["api","dashboard","disposition","import","crm"],"description":"`api`, `dashboard`, `disposition` (a rep recorded a DNC disposition), `import` (a CSV) or `crm` (a revocation in your CRM)"},"createdBy":{"type":["string","null"],"description":"The API key, dashboard user or rep that added it"},"createdAt":{"type":"string","format":"date-time"}},"required":["e164","reason","source","createdBy","createdAt"],"description":"A number on the workspace's internal Do Not Call list: reps' outbound calls to it are refused with 422 `do_not_call`. Scoped to the API key environment."},"AddDncNumber":{"type":"object","properties":{"e164":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","example":"+14155550123"},"reason":{"type":["string","null"],"minLength":1,"maxLength":500}},"required":["e164"]},"Lead":{"type":"object","properties":{"id":{"type":"string","example":"lead_01jbx3k7m9q2w8e4r6t5y7u9i0"},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"name":{"type":["string","null"]},"timezone":{"type":["string","null"]},"source":{"type":"string","enum":["api","csv","crm","dashboard"]},"ref":{"type":["string","null"],"description":"Your id for it, if you gave one"},"crmRef":{"type":["string","null"]},"recordUrl":{"type":["string","null"]},"fields":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","phone","name","timezone","source","ref","crmRef","recordUrl","fields","createdAt","updatedAt"]},"UpsertedLeads":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"},"description":"The leads created or changed"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"skipped":{"type":"integer","description":"Leads that don't match the filter of the campaign you named"}},"required":["data","created","updated","unchanged","skipped"]},"UpsertLeads":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"name":{"type":["string","null"],"minLength":1,"maxLength":200},"timezone":{"type":["string","null"],"maxLength":64},"ref":{"type":["string","null"],"minLength":1,"maxLength":200},"crmRef":{"type":["string","null"],"minLength":1,"maxLength":200},"recordUrl":{"type":["string","null"],"format":"uri"},"fields":{"type":"object","additionalProperties":{}},"consent":{"type":"object","properties":{"type":{"type":"string","enum":["express","express_written","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["human_calls","ai_voice","prerecorded"]},"minItems":1,"maxItems":3},"source":{"type":"string","minLength":1,"maxLength":200},"proofUrl":{"type":["string","null"],"maxLength":2000,"format":"uri"},"proofText":{"type":["string","null"],"minLength":1,"maxLength":2000},"effectiveAt":{"type":"string","format":"date-time"}},"required":["type","scopes","source","effectiveAt"]}},"required":["phone"]},"minItems":1,"maxItems":500},"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i","description":"Goes through this campaign alone, instead of every running one with an `onLead` or an `.enroll`. A lead that doesn't match the campaign's filter is skipped."}},"required":["leads"]},"LeadImport":{"type":"object","properties":{"id":{"type":"string","example":"imp_01jbx3k7m9q2w8e4r6t5y7u9i0"},"fileName":{"type":["string","null"]},"status":{"type":"string","enum":["uploaded","running","completed","failed"],"description":"One whose job dies ends as `failed`, within about 20 minutes. The rows it reached stay."},"rows":{"type":"integer"},"created":{"type":"integer"},"updated":{"type":"integer"},"invalid":{"type":"integer"},"skipped":{"type":"integer","description":"Rows whose lead doesn't match the filter of the campaign this file is for"},"doNotCall":{"type":"integer","description":"Rows whose number is on the Do Not Call list: stored, and no campaign takes them"},"dncAdded":{"type":"integer","description":"Numbers this file added to the Do Not Call list, through its `dnc` column"},"defaultTimezone":{"type":["string","null"]},"errors":{"type":"array","items":{"type":"object","properties":{"line":{"type":"integer"},"message":{"type":"string"}},"required":["line","message"]},"description":"The first rows that could not be read. The rest are in the error file."},"hasErrorFile":{"type":"boolean","description":"Whether `GET /leads/imports/{id}/errors` has a file"},"failure":{"type":["string","null"]},"createdBy":{"type":["string","null"],"description":"The API key or user that uploaded it"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time","description":"Its last sign of life"},"finishedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","fileName","status","rows","created","updated","invalid","skipped","doNotCall","dncAdded","defaultTimezone","errors","hasErrorFile","failure","createdBy","createdAt","updatedAt","finishedAt"]},"LeadImportCheck":{"type":"object","properties":{"created":{"type":"integer","description":"Leads these rows would add"},"updated":{"type":"integer","description":"Existing leads these rows would write to"},"ambiguous":{"type":"integer","description":"Rows that would be refused, as their number is on several leads"},"doNotCall":{"type":["integer","null"],"description":"Rows whose number is on the Do Not Call list. Null without the `dnc:read` scope."},"noTimezone":{"type":"integer","description":"Leads that would still have no zone, so would never be dialed"}},"required":["created","updated","ambiguous","doNotCall","noTimezone"]},"LeadImportCampaign":{"type":"object","properties":{"name":{"type":"string"},"onLead":{"type":"boolean"},"filtered":{"type":"boolean","description":"Whether it has an `.enroll`"},"filterFields":{"type":"array","items":{"type":"string"},"description":"The fields its filter names"},"reenroll":{"type":"boolean","description":"Whether a new value in one of those brings back a lead that left"}},"required":["name","onLead","filtered","filterFields","reenroll"]},"LeadConsent":{"type":"object","properties":{"id":{"type":"string","example":"con_01jbx3k7m9q2w8e4r6t5y7u9i0"},"phone":{"type":"string"},"leadId":{"type":["string","null"],"description":"The lead it came in on. Consent is by number, and outlives the lead."},"kind":{"type":"string","enum":["granted","revoked"]},"type":{"type":"string","enum":["express","express_written","other"]},"scope":{"type":"string","enum":["human_calls","ai_voice","prerecorded"]},"source":{"type":"string"},"proofUrl":{"type":["string","null"]},"proofText":{"type":["string","null"]},"effectiveAt":{"type":"string","format":"date-time"},"ingest":{"type":"string","enum":["api","csv","crm","dnc","dashboard"]},"actor":{"type":["string","null"],"description":"The API key, user or connection"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","phone","leadId","kind","type","scope","source","proofUrl","proofText","effectiveAt","ingest","actor","createdAt"]},"Campaign":{"type":"object","properties":{"id":{"type":"string","example":"cmp_01jbx3k7m9q2w8e4r6t5y7u9i0"},"name":{"type":"string","example":"renewals"},"version":{"type":"string"},"hooks":{"type":"array","items":{"type":"string"},"description":"The hooks this version defines"},"steps":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["call"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["offer"]},"queue":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["flow"]},"flow":{"type":"string","minLength":1}},"required":["type","flow"]},{"type":"object","properties":{"type":{"type":"string","enum":["handler"]}},"required":["type"]}]},"from":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["kind","target"]},{"type":"object","properties":{"kind":{"type":"string","enum":["wait"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},"ms":{"type":"integer","exclusiveMinimum":0}},"required":["kind","ms"]},{"type":"object","properties":{"kind":{"type":"string","enum":["do"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}},"required":["kind"]}]},"description":"The sequence, in order"},"enrollment":{"type":["object","null"],"properties":{"where":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"not":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"in":{"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"minItems":1,"maxItems":100},"gt":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"gte":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"lt":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"lte":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"within":{"type":"string","maxLength":20}},"additionalProperties":false}]},"default":{}},"reenroll":{"type":"boolean","default":true}},"additionalProperties":false,"description":"Its `.enroll`: which leads it takes by itself, and whether a lead that left can start over"},"status":{"type":"string","enum":["running","paused"]},"pausedReason":{"type":["string","null"],"enum":["manual","not_started","hook_failing","needs_deploy","needs_deploy_held","billing",null]},"counts":{"type":"object","additionalProperties":{"type":"number"},"description":"Leads per state, `dials`, and `exit_<reason>` for how leads left. Kept as counters, so reading it is cheap."},"warnings":{"type":"array","items":{"type":"string"},"description":"On a deploy: what this change does to leads mid-sequence."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","version","hooks","steps","enrollment","status","pausedReason","counts","createdAt","updatedAt"]},"RegisterCampaigns":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},"version":{"type":"string","minLength":1,"maxLength":128},"hooks":{"type":"array","items":{"type":"string","enum":["onLead","call","do","goal","exit","afterCall","screenPop","onAnswer","onVoicemail","onNoAnswer","onError"]},"maxItems":11},"steps":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["call"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["offer"]},"queue":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["flow"]},"flow":{"type":"string","minLength":1}},"required":["type","flow"]},{"type":"object","properties":{"type":{"type":"string","enum":["handler"]}},"required":["type"]}]},"from":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["kind","target"]},{"type":"object","properties":{"kind":{"type":"string","enum":["wait"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},"ms":{"type":"integer","exclusiveMinimum":0}},"required":["kind","ms"]},{"type":"object","properties":{"kind":{"type":"string","enum":["do"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}},"required":["kind"]}]},"minItems":1,"maxItems":100,"default":[{"kind":"call","target":{"type":"queue"}}]},"enrollment":{"type":"object","properties":{"where":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"not":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"in":{"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"minItems":1,"maxItems":100},"gt":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"gte":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"lt":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"lte":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"within":{"type":"string","maxLength":20}},"additionalProperties":false}]},"default":{}},"reenroll":{"type":"boolean","default":true}},"additionalProperties":false},"flow":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"version":{"type":"string","minLength":1,"maxLength":128},"timeoutMs":{"type":"integer","minimum":100,"maximum":5000},"inputSchema":{"type":"object","additionalProperties":{}},"stateSchema":{"type":"object","additionalProperties":{}},"handlers":{"type":"array","items":{"type":"string","enum":["call.answered","call.no_answer","call.voicemail","call.hangup","call.gather","call.agent.tool","call.agent.ended","call.agent.summary","call.custom","call.transfer.failed","call.error"]},"maxItems":11,"default":[]},"customEvents":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._:-]{0,127}$/i"},"maxItems":100,"default":[]},"fallbacks":{"type":"object","properties":{"call.answered":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.no_answer":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.voicemail":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.hangup":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.gather":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.tool":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.ended":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.agent.summary":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.custom":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.transfer.failed":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50},"call.error":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"fallback":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["play"]},"url":{"type":"string","format":"uri"},"loop":{"type":"integer","minimum":1,"maximum":100}},"required":["type","url"]},{"type":"object","properties":{"type":{"type":"string","enum":["pause"]},"seconds":{"type":"integer","minimum":1,"maximum":60}},"required":["type","seconds"]},{"type":"object","properties":{"type":{"type":"string","enum":["connectAgent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["dial"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"record":{"type":"boolean"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["enqueue"]},"queue":{"type":"string","minLength":1}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]},"minItems":1},"numDigits":{"type":"integer","minimum":1,"maximum":32},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":60},"prompt":{"type":"object","properties":{"type":{"type":"string","enum":["say"]},"text":{"type":"string","minLength":1},"voice":{"type":"string"},"language":{"type":"string"}},"required":["type","text"]},"tag":{"type":"string","maxLength":128},"sensitive":{"type":"boolean"}},"required":["type","input"]},{"type":"object","properties":{"type":{"type":"string","enum":["record"]},"maxLengthSeconds":{"type":"integer","minimum":1,"maximum":14400}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["hangup"]},"disposition":{"type":"string","minLength":1,"maxLength":64},"callbackAt":{"type":"integer","exclusiveMinimum":0}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["connect"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["transfer"]},"target":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"agentId":{"type":"string","minLength":1},"provider":{"type":"string","minLength":1},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["type","agentId"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"]},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","to"]},{"type":"object","properties":{"type":{"type":"string","enum":["sip"]},"uri":{"type":"string","pattern":"^sips?:\\S+$/i"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["type","uri"]},{"type":"object","properties":{"type":{"type":"string","enum":["queue"]},"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},"priority":{"type":"integer","minimum":0,"maximum":100},"skills":{"type":"object","additionalProperties":{"type":"integer","minimum":1,"maximum":10}},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","queue"]},{"type":"object","properties":{"type":{"type":"string","enum":["rep"]},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$"},"context":{},"aiSummary":{"anyOf":[{"type":"string"},{"type":"boolean","enum":[false]}]}},"required":["type","repId"]}]},"timeoutSeconds":{"type":"integer","minimum":5,"maximum":600},"callerId":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"}},"required":["type","target"]}]},"minItems":1,"maxItems":20}},"required":["type","target"]},{"type":"object","properties":{"type":{"type":"string","enum":["enterFlow"]},"flow":{"type":"string","minLength":1,"maxLength":100},"input":{}},"required":["type","flow"]}]},"minItems":1,"maxItems":50}},"default":{}},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$/i"},"description":{"type":"string","maxLength":1024},"parameters":{"type":"object","additionalProperties":{}},"timeoutMs":{"type":"integer","minimum":100,"maximum":5000},"afterSpeech":{"type":"boolean"}},"required":["name","parameters"]},"maxItems":64,"default":[]},"agents":{"type":"array","items":{"type":"object","properties":{"alias":{"type":"string","pattern":"^[a-z][a-z0-9_-]{0,63}$/i"},"agentId":{"type":"string","minLength":1,"maxLength":256},"provider":{"type":"string","minLength":1,"maxLength":64},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":64,"default":[]},"testBranch":{"type":"boolean","enum":[true]}},"required":["alias","agentId"]},"maxItems":32,"default":[]}},"required":["name","version"]}},"required":["name","version","hooks","flow"]},"minItems":1,"maxItems":100},"mode":{"type":"string","enum":["report","deploy"],"default":"report"},"endpointUrl":{"type":"string","format":"uri"},"alsoTest":{"type":"boolean","default":false}},"required":["campaigns"]},"CampaignBackfill":{"type":"object","properties":{"id":{"type":"string","example":"bkf_01jbx3k7m9q2w8e4r6t5y7u9i0"},"campaign":{"type":"string","example":"renewals"},"status":{"type":"string","enum":["running","done","failed","cancelled"],"description":"`failed` means the flow endpoint kept failing and it stopped early: retry goes on from where it was. A `done` run can still have `failed` leads, which a retry sends again."},"where":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","properties":{"not":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"in":{"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"minItems":1,"maxItems":100},"gt":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"gte":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"lt":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"lte":{"anyOf":[{"type":"number"},{"type":"string","maxLength":40}]},"within":{"type":"string","maxLength":20}},"additionalProperties":false}]},"description":"The campaign's filter when it started"},"leadsInScope":{"type":"integer","description":"How many leads the environment had when it started. The count stops at 1,000,000: see `leadsInScopeCapped`."},"leadsInScopeCapped":{"type":"boolean"},"scanned":{"type":"integer","description":"Leads walked, matching the filter or not"},"checked":{"type":"integer","description":"Leads that matched. `enrolled` + `skipped` + `failed` reaches this once nothing is on its way."},"enrolled":{"type":"integer","description":"Leads new to the campaign"},"skipped":{"type":"integer","description":"Already in it, left for good, on your Do Not Call list, or `onLead` said no"},"failed":{"type":"integer","description":"Leads with no answer, after retries"},"failure":{"type":["string","null"],"description":"Why the latest batch was given up on"},"retryReason":{"type":["string","null"],"description":"What it can't do just now and keeps trying. Only while it's `running`"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","campaign","status","where","leadsInScope","leadsInScopeCapped","scanned","checked","enrolled","skipped","failed","failure","retryReason","createdAt","updatedAt","finishedAt"]},"CampaignBackfillRequest":{"type":"object","properties":{},"additionalProperties":false,"description":"Nothing: the filter is in the campaign, in your code."},"EnrollLeads":{"type":"object","properties":{"leadIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":500},"priority":{"type":"integer","minimum":0,"maximum":1000}},"required":["leadIds"]},"CampaignLead":{"type":"object","properties":{"leadId":{"type":"string"},"phone":{"type":"string"},"name":{"type":["string","null"]},"state":{"type":"string","enum":["queued","waiting","needs_timezone","needs_consent","claimed","in_call","acting","deciding","step_failed","done"]},"priority":{"type":"integer"},"attempts":{"type":"integer"},"nextAttemptAt":{"type":"string","format":"date-time"},"lastOutcome":{"type":["string","null"]},"step":{"type":"integer","description":"Where it is in the sequence, or what is next"},"stepName":{"type":["string","null"]},"exitReason":{"type":["string","null"],"enum":["goal","exit","finished","removed","do_not_call",null],"description":"Why it left, once it has"}},"required":["leadId","phone","name","state","priority","attempts","nextAttemptAt","lastOutcome","step","stepName","exitReason"]},"Floor":{"type":"object","properties":{"environment":{"type":"string","enum":["live","test"]},"at":{"type":"string","format":"date-time"},"queues":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"displayName":{"type":"string"},"waiting":{"type":"integer"},"oldestWaitingSince":{"type":["string","null"],"format":"date-time"},"available":{"type":"integer"},"onCall":{"type":"integer"},"loggedIn":{"type":"integer"},"serviceLevel":{"type":"object","properties":{"seconds":{"type":"integer"},"target":{"type":"number"},"value":{"type":["number","null"],"description":"Today's share answered within `seconds`; `null` before the first call"},"status":{"type":"string","enum":["ok","amber","red"]}},"required":["seconds","target","value","status"]},"answeredToday":{"type":"integer"},"abandonedToday":{"type":"integer"},"outsideHours":{"type":"integer","description":"Today's visits its business hours turned away"},"open":{"type":"boolean","description":"Within its business hours now"},"nextChangeAt":{"type":["string","null"],"format":"date-time","description":"When `open` next flips; the Floor sends nothing at that moment"},"timezone":{"type":["string","null"],"description":"The zone of its hours; `null`: it has no hours"}},"required":["name","displayName","waiting","oldestWaitingSince","available","onCall","loggedIn","serviceLevel","answeredToday","abandonedToday","outsideHours","open","nextChangeAt","timezone"]}},"reps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"state":{"type":"string","enum":["offline","available","on_call","wrap_up","away"]},"reason":{"type":["string","null"]},"since":{"type":"string","format":"date-time"},"skills":{"type":"object","additionalProperties":{"type":"number"}},"queues":{"type":"array","items":{"type":"string"}},"call":{"type":["object","null"],"properties":{"callId":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"remote":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"queue":{"type":["string","null"]},"simulated":{"type":"boolean"}},"required":["callId","direction","remote","startedAt","queue","simulated"]},"help":{"type":["object","null"],"properties":{"callId":{"type":"string"},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["callId","note","at"]},"pendingState":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["offline","available","on_call","wrap_up","away"]},"reason":{"type":["string","null"]}},"required":["state","reason"]},"dialing":{"type":["object","null"],"properties":{"callId":{"type":"string"},"remote":{"type":"string"},"since":{"type":"string"},"simulated":{"type":"boolean"}},"required":["callId","remote","since","simulated"],"description":"Kept for a campaign's dial. The rep's own desk doesn't show this."}},"required":["id","name","state","reason","since","skills","queues","call","help","pendingState","dialing"]}},"calls":{"type":"array","items":{"type":"object","properties":{"callId":{"type":"string"},"repId":{"type":["string","null"]},"repName":{"type":["string","null"]},"agentId":{"type":["string","null"]},"direction":{"type":"string","enum":["inbound","outbound"]},"from":{"type":"string"},"to":{"type":"string"},"remote":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"queue":{"type":["string","null"]},"simulated":{"type":"boolean"},"help":{"type":["object","null"],"properties":{"callId":{"type":"string"},"note":{"type":["string","null"]},"at":{"type":"string","format":"date-time"}},"required":["callId","note","at"]},"monitors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"supervisorId":{"type":["string","null"]},"supervisorName":{"type":["string","null"]},"mode":{"type":"string","enum":["listen","whisper","barge"],"description":"`listen` (muted), `whisper` (only the rep hears) or `barge`"},"muted":{"type":"boolean"},"status":{"type":"string","enum":["connecting","active","ended"]}},"required":["id","supervisorId","supervisorName","mode","muted","status"]}},"handledBy":{"type":["object","null"],"properties":{"supervisorId":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["supervisorId","name"]},"monitorable":{"type":"boolean","description":"Only calls with a rep on them can be monitored"},"consult":{"type":"object","properties":{"id":{"type":"string"},"peer":{"type":"string"},"status":{"type":"string","enum":["dialing","consulting","merged","ended"]}},"required":["id","peer","status"],"description":"A consult under way on this call"}},"required":["callId","repId","repName","direction","from","to","remote","startedAt","queue","simulated","help","monitors","handledBy","monitorable"]}},"queued":{"type":"array","items":{"type":"object","properties":{"callId":{"type":"string"},"queue":{"type":["string","null"]},"displayName":{"type":["string","null"]},"from":{"type":"string"},"priority":{"type":"integer"},"enqueuedAt":{"type":"string","format":"date-time"},"context":{},"offeredTo":{"type":["string","null"]},"simulated":{"type":"boolean"}},"required":["callId","queue","displayName","from","priority","enqueuedAt","offeredTo","simulated"]}}},"required":["environment","at","queues","reps","calls","queued"],"description":"The live floor of the key's environment: queues with today's service level, reps, calls and queued calls. The dashboard wallboard shows the same picture."},"MonitorSession":{"type":"object","properties":{"id":{"type":"string","example":"mon_01j…"},"callId":{"type":"string"},"supervisorId":{"type":["string","null"],"description":"The supervising member; `null` when an API key started it"},"supervisorName":{"type":["string","null"]},"repId":{"type":"string"},"participantId":{"type":"string","description":"The supervisor's participant on the call"},"mode":{"type":"string","enum":["listen","whisper","barge"],"description":"`listen` (muted), `whisper` (only the rep hears) or `barge`"},"to":{"type":"string","description":"Where the monitor leg rings"},"muted":{"type":"boolean"},"status":{"type":"string","enum":["connecting","active","ended"]},"endReason":{"type":["string","null"],"enum":["ended","hangup","failed","rep_left","call_ended","took_over",null]},"createdAt":{"type":"string","format":"date-time"},"joinedAt":{"type":["string","null"],"format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"changes":{"type":"array","items":{"type":"object","properties":{"mode":{"type":"string","enum":["listen","whisper","barge"],"description":"`listen` (muted), `whisper` (only the rep hears) or `barge`"},"at":{"type":"string","format":"date-time"}},"required":["mode","at"]}}},"required":["id","callId","supervisorId","supervisorName","repId","participantId","mode","to","muted","status","endReason","createdAt","joinedAt","endedAt","changes"],"description":"A supervisor's leg on a rep's call. The mode is the leg's participant flags: listen is muted, whisper coaches the rep, barge is heard by everyone."},"StartMonitor":{"type":"object","properties":{"mode":{"type":"string","enum":["listen","whisper","barge"],"default":"listen","description":"`listen` (muted), `whisper` (only the rep hears) or `barge`"},"to":{"type":"string","minLength":1,"maxLength":64,"description":"The supervisor's phone (E.164), or `client:<identity>` for a softphone","example":"+14155550142"}},"required":["to"]},"UpdateMonitor":{"type":"object","properties":{"mode":{"type":"string","enum":["listen","whisper","barge"],"description":"`listen` (muted), `whisper` (only the rep hears) or `barge`"},"muted":{"type":"boolean","description":"The supervisor mutes themselves"}}},"QueueCallReassigned":{"type":"object","properties":{"callId":{"type":"string"},"transferId":{"type":"string"},"fromQueue":{"type":["string","null"]},"toQueue":{"type":["string","null"]},"repId":{"type":["string","null"]}},"required":["callId","transferId","fromQueue","toQueue","repId"]},"ReassignQueueCall":{"type":"object","properties":{"queue":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i","description":"Move it to this queue"},"repId":{"type":"string","pattern":"^rep_[0-9a-z]+$","description":"Or offer it to this rep, who must be free"},"priority":{"type":"integer","minimum":0,"maximum":100}}},"ApiRequest":{"type":"object","properties":{"id":{"type":"string","description":"The request id: the `Request-Id` header of its response","example":"req_01jbx3k7m9q2w8e4r6t5y7u9i0"},"environment":{"type":"string","enum":["live","test"]},"apiKeyId":{"type":["string","null"],"description":"The API key that made it"},"method":{"type":"string","example":"POST"},"route":{"type":["string","null"],"description":"The route pattern","example":"/v1/calls/:id"},"path":{"type":"string","example":"/v1/calls/call_01jbx3k7m9"},"status":{"type":"integer","example":404},"durationMs":{"type":"integer"},"errorCode":{"type":["string","null"],"example":"not_found"},"errorMessage":{"type":["string","null"]},"idempotencyKey":{"type":["string","null"]},"sdkVersion":{"type":["string","null"],"description":"From `User-Agent: hcc-sdk-js/<version>`"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","environment","apiKeyId","method","route","path","status","durationMs","errorCode","errorMessage","idempotencyKey","sdkVersion","createdAt"],"description":"One request your API keys made in this environment, kept for 30 days. Never its body, headers or key."},"RepReport":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RepReportRow"}},"totals":{"type":"object","properties":{"handled":{"type":"integer","description":"Calls connected: inbound + outbound"},"inbound":{"type":"integer","description":"Queue calls the rep answered"},"outbound":{"type":"integer","description":"The rep's outbound calls the customer answered"},"talkSeconds":{"type":"number","description":"Connect to hang-up, hold included"},"wrapUpSeconds":{"type":"number","description":"Wrap-up after the handled calls"},"ahtSeconds":{"type":["number","null"],"description":"Average handle time: (talk + wrap-up) ÷ handled"},"avgWrapUpSeconds":{"type":["number","null"]},"missedOffers":{"type":"integer","description":"Offers the rep let expire"},"occupancy":{"type":["number","null"],"minimum":0,"maximum":1,"description":"(on call + wrap-up) ÷ (available + on call + wrap-up)"},"states":{"$ref":"#/components/schemas/RepStateSeconds"}},"required":["handled","inbound","outbound","talkSeconds","wrapUpSeconds","ahtSeconds","avgWrapUpSeconds","missedOffers","occupancy","states"]},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","totals","range"]},"RepReportRow":{"type":"object","properties":{"repId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"handled":{"type":"integer","description":"Calls connected: inbound + outbound"},"inbound":{"type":"integer","description":"Queue calls the rep answered"},"outbound":{"type":"integer","description":"The rep's outbound calls the customer answered"},"talkSeconds":{"type":"number","description":"Connect to hang-up, hold included"},"wrapUpSeconds":{"type":"number","description":"Wrap-up after the handled calls"},"ahtSeconds":{"type":["number","null"],"description":"Average handle time: (talk + wrap-up) ÷ handled"},"avgWrapUpSeconds":{"type":["number","null"]},"missedOffers":{"type":"integer","description":"Offers the rep let expire"},"occupancy":{"type":["number","null"],"minimum":0,"maximum":1,"description":"(on call + wrap-up) ÷ (available + on call + wrap-up)"},"states":{"$ref":"#/components/schemas/RepStateSeconds"}},"required":["repId","name","email","handled","inbound","outbound","talkSeconds","wrapUpSeconds","ahtSeconds","avgWrapUpSeconds","missedOffers","occupancy","states"],"description":"One rep. Rep states (occupancy, missed offers, `states`) are workspace-wide: a rep is one person across live and test."},"RepStateSeconds":{"type":"object","properties":{"available":{"type":"number"},"on_call":{"type":"number"},"wrap_up":{"type":"number"},"away":{"type":"number"},"offline":{"type":"number"},"awayByReason":{"type":"object","additionalProperties":{"type":"number"},"description":"Away seconds per reason; `missed_offer` is set by routing"}},"required":["available","on_call","wrap_up","away","offline","awayByReason"],"description":"Seconds in each rep state within the range"},"ReportRange":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"timezone":{"type":"string","description":"The workspace's time zone: buckets use it"},"environment":{"type":"string","enum":["live","test"]}},"required":["from","to","timezone","environment"]},"QueueReport":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QueueReportRow"}},"totals":{"type":"object","properties":{"offered":{"type":"integer","description":"Visits that entered the queue, leaving out `outsideHours`"},"answered":{"type":"integer"},"abandoned":{"type":"integer","description":"The caller hung up while waiting"},"abandonmentRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"abandoned ÷ offered"},"overflowed":{"type":"integer","description":"Left by overflow, or nobody was on"},"outsideHours":{"type":"integer","description":"Turned away by the queue's business hours: in no other count"},"answeredWithin":{"type":"integer","description":"Answered within the threshold"},"serviceLevel":{"type":["number","null"],"minimum":0,"maximum":1,"description":"answeredWithin ÷ (answered + abandoned + overflowed)"},"asaSeconds":{"type":["number","null"],"description":"Average speed of answer"},"longestWaitSeconds":{"type":["number","null"]}},"required":["offered","answered","abandoned","abandonmentRate","overflowed","outsideHours","answeredWithin","serviceLevel","asaSeconds","longestWaitSeconds"]},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","totals","range"]},"QueueReportRow":{"type":"object","properties":{"queue":{"type":"string"},"offered":{"type":"integer","description":"Visits that entered the queue, leaving out `outsideHours`"},"answered":{"type":"integer"},"abandoned":{"type":"integer","description":"The caller hung up while waiting"},"abandonmentRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"abandoned ÷ offered"},"overflowed":{"type":"integer","description":"Left by overflow, or nobody was on"},"outsideHours":{"type":"integer","description":"Turned away by the queue's business hours: in no other count"},"answeredWithin":{"type":"integer","description":"Answered within the threshold"},"serviceLevel":{"type":["number","null"],"minimum":0,"maximum":1,"description":"answeredWithin ÷ (answered + abandoned + overflowed)"},"asaSeconds":{"type":["number","null"],"description":"Average speed of answer"},"longestWaitSeconds":{"type":["number","null"]},"serviceLevelSeconds":{"type":"integer","description":"The queue's threshold (`serviceLevel.seconds`, default 20)"},"serviceLevelTarget":{"type":"number"}},"required":["queue","offered","answered","abandoned","abandonmentRate","overflowed","outsideHours","answeredWithin","serviceLevel","asaSeconds","longestWaitSeconds","serviceLevelSeconds","serviceLevelTarget"]},"OutboundReport":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OutboundReportRow"}},"totals":{"type":"object","properties":{"dials":{"type":"integer","description":"Dial attempts placed"},"connects":{"type":"integer","description":"Placed calls the customer answered"},"connectRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"connects ÷ dials"},"avgTalkSeconds":{"type":["number","null"]},"blockedDnc":{"type":"integer","description":"Refused: on the Do Not Call list"},"refused":{"type":"integer","description":"All refused dials"},"dispositions":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["dials","connects","connectRate","avgTalkSeconds","blockedDnc","refused","dispositions"]},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","totals","range"]},"OutboundReportRow":{"type":"object","properties":{"repId":{"type":["string","null"]},"name":{"type":["string","null"]},"noRep":{"type":"boolean","description":"The row of calls placed through the API with no rep. Another row with a null `repId` is dials whose rep is gone, or a campaign's that no rep ended up on."},"dials":{"type":"integer","description":"Dial attempts placed"},"connects":{"type":"integer","description":"Placed calls the customer answered"},"connectRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"connects ÷ dials"},"avgTalkSeconds":{"type":["number","null"]},"blockedDnc":{"type":"integer","description":"Refused: on the Do Not Call list"},"refused":{"type":"integer","description":"All refused dials"},"dispositions":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["repId","name","noRep","dials","connects","connectRate","avgTalkSeconds","blockedDnc","refused","dispositions"]},"CampaignReport":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CampaignReportRow"}},"totals":{"type":"object","properties":{"dials":{"type":"integer","description":"Dial attempts placed in the range"},"connects":{"type":"integer","description":"Dialed calls answered, and not by a machine"},"connectRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"connects ÷ dials"},"rightPartyConversations":{"type":"integer","description":"Connects that were a real conversation: not ones that found no rep. A machine nobody asked the carrier about counts, so a flow with no `onVoicemail` can overstate this"},"machine":{"type":"integer","description":"Dialed calls a machine answered"},"voicemailsLeft":{"type":"integer","description":"The machines `onVoicemail` left a message on: part of `machine`"},"noAnswer":{"type":"integer","description":"Dialed calls nobody answered"},"avgTalkSeconds":{"type":["number","null"],"description":"Connect to the call's end, per connect"},"dispositions":{"type":"object","additionalProperties":{"type":"integer"},"description":"The dispositions of the range's dialed calls"},"leadsLeft":{"type":"integer","description":"Leads that left in the range"},"exitReasons":{"type":"object","properties":{"goal":{"type":"integer"},"exit":{"type":"integer"},"finished":{"type":"integer"},"removed":{"type":"integer"},"do_not_call":{"type":"integer"}},"required":["goal","exit","finished","removed","do_not_call"],"description":"Leads that left in the range, per reason"},"conversions":{"type":"integer","description":"Leads that left with reason `goal`"},"goalRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"conversions ÷ leadsLeft"}},"required":["dials","connects","connectRate","rightPartyConversations","machine","voicemailsLeft","noAnswer","avgTalkSeconds","dispositions","leadsLeft","exitReasons","conversions","goalRate"]},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","totals","range"]},"CampaignReportRow":{"type":"object","properties":{"campaign":{"type":"string"},"dials":{"type":"integer","description":"Dial attempts placed in the range"},"connects":{"type":"integer","description":"Dialed calls answered, and not by a machine"},"connectRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"connects ÷ dials"},"rightPartyConversations":{"type":"integer","description":"Connects that were a real conversation: not ones that found no rep. A machine nobody asked the carrier about counts, so a flow with no `onVoicemail` can overstate this"},"machine":{"type":"integer","description":"Dialed calls a machine answered"},"voicemailsLeft":{"type":"integer","description":"The machines `onVoicemail` left a message on: part of `machine`"},"noAnswer":{"type":"integer","description":"Dialed calls nobody answered"},"avgTalkSeconds":{"type":["number","null"],"description":"Connect to the call's end, per connect"},"dispositions":{"type":"object","additionalProperties":{"type":"integer"},"description":"The dispositions of the range's dialed calls"},"leadsLeft":{"type":"integer","description":"Leads that left in the range"},"exitReasons":{"type":"object","properties":{"goal":{"type":"integer"},"exit":{"type":"integer"},"finished":{"type":"integer"},"removed":{"type":"integer"},"do_not_call":{"type":"integer"}},"required":["goal","exit","finished","removed","do_not_call"],"description":"Leads that left in the range, per reason"},"conversions":{"type":"integer","description":"Leads that left with reason `goal`"},"goalRate":{"type":["number","null"],"minimum":0,"maximum":1,"description":"conversions ÷ leadsLeft"}},"required":["campaign","dials","connects","connectRate","rightPartyConversations","machine","voicemailsLeft","noAnswer","avgTalkSeconds","dispositions","leadsLeft","exitReasons","conversions","goalRate"]},"DispositionReport":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DispositionReportRow"}},"totals":{"type":"object","properties":{"count":{"type":"integer"},"byDisposition":{"type":"object","additionalProperties":{"type":"number"}}},"required":["count","byDisposition"]},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","totals","range"]},"DispositionReportRow":{"type":"object","properties":{"disposition":{"type":"string"},"repId":{"type":["string","null"],"description":"Who recorded it, or the call’s rep"},"name":{"type":["string","null"]},"queue":{"type":["string","null"],"description":"The call's last queue"},"count":{"type":"integer"}},"required":["disposition","repId","name","queue","count"]},"Timeseries":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TimeseriesPoint"}},"metric":{"type":"string","enum":["calls","service_level","wait_time","handled","dials","states"]},"interval":{"type":"string","enum":["hour","day"]},"target":{"type":"number","description":"`service_level`: the queues’ (lowest) target"},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","metric","interval","range"]},"TimeseriesPoint":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time","description":"The bucket's start"}},"required":["bucket"],"additionalProperties":{"type":["number","null"]},"description":"One bucket. `calls`: inbound, outbound. `service_level`: serviceLevel, answeredWithin, left. `wait_time`: asaSeconds, longestWaitSeconds. `handled`: inbound, outbound, talkSeconds. `dials`: dials, connects, connectRate. `states`: seconds per rep state."},"ReportSummary":{"type":"object","properties":{"data":{"type":"object","properties":{"current":{"$ref":"#/components/schemas/ReportKpis"},"previous":{"$ref":"#/components/schemas/ReportKpis"},"previousRange":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["from","to"]}},"required":["current","previous","previousRange"]},"range":{"$ref":"#/components/schemas/ReportRange"}},"required":["data","range"]},"ReportKpis":{"type":"object","properties":{"calls":{"type":"integer"},"serviceLevel":{"type":["number","null"],"minimum":0,"maximum":1},"abandonmentRate":{"type":["number","null"],"minimum":0,"maximum":1},"asaSeconds":{"type":["number","null"]},"ahtSeconds":{"type":["number","null"]},"connectRate":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["calls","serviceLevel","abandonmentRate","asaSeconds","ahtSeconds","connectRate"]},"SimulatorInfo":{"type":"object","properties":{"simulatedNumber":{"type":"string"},"numbers":{"type":"array","items":{"type":"object","properties":{"e164":{"type":"string"},"label":{"type":["string","null"]}},"required":["e164","label"]}},"flows":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]}},"limits":{"type":"object","properties":{"concurrentCalls":{"type":"integer"},"maxCallMinutes":{"type":"number"},"timelineHours":{"type":"number"}},"required":["concurrentCalls","maxCallMinutes","timelineHours"]}},"required":["simulatedNumber","numbers","flows","limits"]},"SimulatedCall":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"from":{"type":"string"},"to":{"type":"string"},"status":{"type":"string","enum":["queued","ringing","in_progress","completed","busy","no_answer","failed","canceled"]},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"legs":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedLeg"}},"prompt":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["gather"]},"input":{"type":"array","items":{"type":"string","enum":["dtmf","speech"]}},"numDigits":{"type":["integer","null"]},"text":{"type":["string","null"]},"tag":{"type":["string","null"]},"leg":{"type":"string"},"timeoutAt":{"type":"string"}},"required":["kind","input","numDigits","text","tag","leg","timeoutAt"],"description":"The open gather the far end is asked to answer"},"agent":{"type":["object","null"],"properties":{"alias":{"type":["string","null"]},"agentId":{"type":["string","null"]},"name":{"type":["string","null"]},"leg":{"type":"string"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"parameters":{"type":"object","additionalProperties":{}}},"required":["name","description","parameters"]}},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["alias","agentId","name","leg","tools"],"description":"The simulated AI agent on the call, which you play"}},"required":["id","direction","from","to","status","startedAt","endedAt","legs","prompt","agent"]},"SimulatedLeg":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["caller","callee","rep","agent","supervisor"]},"to":{"type":["string","null"]},"repId":{"type":["string","null"]},"status":{"type":"string","enum":["queued","ringing","in_progress","completed","busy","no_answer","failed","canceled"]},"inConference":{"type":"boolean"},"held":{"type":"boolean"},"muted":{"type":"boolean"},"coaching":{"type":["string","null"],"description":"The leg this one whispers to (a supervisor whispering)"}},"required":["id","role","to","repId","status","inConference","held","muted","coaching"]},"StartSimulatedCall":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"One of your numbers, or the simulated number"},"from":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"The caller; a fixed test number by default"},"flow":{"type":"string","minLength":1,"maxLength":64,"description":"A flow deployed to test; by default the number’s flow, or the only one"}},"required":["to"]},"SimulatorTimelineEntry":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"at":{"type":"string"},"actor":{"type":"string","enum":["hcc","caller","callee","agent","rep","supervisor","system"]},"kind":{"type":"string"},"text":{"type":"string"},"data":{},"leg":{"type":["string","null"]}},"required":["id","seq","at","actor","kind","text","leg"]},"SimulatedDigits":{"type":"object","properties":{"digits":{"type":"string","pattern":"^[0-9*#]{1,32}$"}},"required":["digits"]},"SimulatedSpeech":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":500}},"required":["text"]},"SimulatedLegAction":{"type":"object","properties":{"leg":{"type":"string","minLength":1,"maxLength":64,"description":"The leg to act on (`SC…`); by default the far end"}}},"SimulatedToolCall":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"arguments":{"type":"object","additionalProperties":{},"default":{}}},"required":["name"]},"SimulatedAgentSay":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["text"]},"SimulatedAgentEnd":{"type":"object","properties":{"outcome":{"type":"string","minLength":1,"maxLength":64,"default":"completed"},"order":{"type":"string","enum":["webhook_first","stream_first"]}}},"SimulatedAgentReport":{"type":"object","properties":{"summary":{"type":"string","minLength":1,"maxLength":16384},"startedAt":{"type":"string","format":"date-time"}},"required":["summary"]},"DevSession":{"type":"object","properties":{"id":{"type":"string","example":"ds_01h…"},"connectUrl":{"type":"string","description":"The WebSocket to open, with `token` in the `hcc-dev-token` header"},"token":{"type":"string","description":"One-time; opens the socket within 60 s"},"expiresAt":{"type":"string","description":"When `token` stops working"},"webhookSecret":{"type":"string","description":"Signs the copies of test Events the session forwards"},"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"flowEndpoint":{"type":"object","properties":{"url":{"type":["string","null"]}},"required":["url"]}},"required":["id","connectUrl","token","expiresAt","webhookSecret","workspace","flowEndpoint"]},"CreateDevSession":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":255,"description":"The machine `hcc dev` runs on, shown on the dashboard’s banner"}}}},"parameters":{}},"paths":{"/v1/health":{"get":{"tags":["Health"],"summary":"Liveness and database connectivity","responses":{"200":{"description":"Healthy","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"db":{"type":"boolean"}},"required":["ok","db"]}},"required":["data"]}}}},"503":{"description":"Database unreachable","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"db":{"type":"boolean"}},"required":["ok","db"]}},"required":["data"]}}}}}}},"/v1/billing":{"get":{"tags":["Billing"],"security":[{"bearerAuth":[]}],"summary":"Your plan, seats, usage this period, and whether new calls are stopped","x-hcc-scope":"billing:read","responses":{"200":{"description":"The billing status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingStatus"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Place an outbound call","description":"Every call is checked before anything rings, and audited. A number on the Do Not Call list is a 422 `do_not_call`. Without `repId`, a call outside 8:00 to 21:00 in the time zone of the number's lead, or else the `timezone` you give, is a 422 `outside_calling_hours`. With neither zone the call is placed, and audited as not checked.","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCall"}}}},"responses":{"201":{"description":"Call created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Call"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connectAgent target is disabled or removed, or `idempotency_key_reused`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"List calls, newest first","description":"Calls in this API key's environment. Every filter is optional; they combine with AND. The cursor pages through the same filters.","x-hcc-scope":"calls:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","description":"Calls started at or after this time, ISO 8601","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Calls started at or after this time, ISO 8601","name":"from","in":"query"},{"schema":{"type":"string","description":"Calls started before this time, ISO 8601","example":"2026-10-08T00:00:00Z"},"required":false,"description":"Calls started before this time, ISO 8601","name":"to","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"anyOf":[{"type":"string","enum":["queued","ringing","in_progress","completed","busy","no_answer","failed","canceled"]},{"type":"array","items":{"type":"string","enum":["queued","ringing","in_progress","completed","busy","no_answer","failed","canceled"]}},{"type":"string"}],"description":"Any of these statuses (queued, ringing, in_progress, completed, busy, no_answer, failed, canceled): repeat the parameter, use `status[]`, or separate with commas"},"required":false,"description":"Any of these statuses (queued, ringing, in_progress, completed, busy, no_answer, failed, canceled): repeat the parameter, use `status[]`, or separate with commas","style":"form","explode":true,"name":"status","in":"query"},{"schema":{"type":"string","description":"The from or to number: an E.164 prefix (`+1415`), or digits that start the number after its + or end it (`0100`). Spaces, dashes and brackets are ignored","example":"+1415"},"required":false,"description":"The from or to number: an E.164 prefix (`+1415`), or digits that start the number after its + or end it (`0100`). Spaces, dashes and brackets are ignored","name":"number","in":"query"},{"schema":{"type":"string","description":"Calls the rep (`rep_…`) placed, answered from a queue, or recorded the disposition of"},"required":false,"description":"Calls the rep (`rep_…`) placed, answered from a queue, or recorded the disposition of","name":"repId","in":"query"},{"schema":{"type":"string","description":"Calls that visited this queue, by name"},"required":false,"description":"Calls that visited this queue, by name","name":"queue","in":"query"},{"schema":{"type":"string","description":"Calls with this disposition"},"required":false,"description":"Calls with this disposition","name":"disposition","in":"query"},{"schema":{"type":"string","description":"Calls that ran this call flow, by name"},"required":false,"description":"Calls that ran this call flow, by name","name":"flow","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true`: only calls on the simulated carrier (test mode); `false`: only real ones"},"required":false,"description":"`true`: only calls on the simulated carrier (test mode); `false`: only real ones","name":"simulated","in":"query"}],"responses":{"200":{"description":"A page of calls","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}":{"get":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Get a call","x-hcc-scope":"calls:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The call","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Call"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/hangup":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Hang up a live call","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"responses":{"200":{"description":"Hangup requested","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Call"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/instructions":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Replace the instructions of a live call","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCallInstructions"}}}},"responses":{"200":{"description":"Call redirected","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Call"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connectAgent target is disabled or removed, or `idempotency_key_reused`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/ai-summary":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Say what a rep is told of the AI agent's conversation","description":"Shown on the offer, the call and the wrap-up, from the answer on: a desk that has the call fills in. A flow's outbound call has no session until it's answered, and before that this is refused (409). It beats the agent platform's own summary. For agents with no post-call report, such as SIP, this and `aiSummary` on a transfer are the only way one gets to a rep.","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAiSummary"}}}},"responses":{"200":{"description":"Set","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AiSummarySet"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/events":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Send a custom event to a live call's flow","description":"Delivers `{ name, payload }` to the call flow's `.on(name)` handler, synchronously within the flow's timeout. Actions the handler returns are applied to the call.","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmitCallEvent"}}}},"responses":{"202":{"description":"Delivered","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EmittedCallEvent"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call has no flow or has ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/consults":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Start a consult: the customer goes on hold while the target rings","description":"`repId` must be a Rep on the call (409 otherwise). A queue must be registered (404), and a number on the Do Not Call list is refused (409). While a consult is live, a second consult, a transfer, hold, keypad tones and a supervisor taking over are refused (409).","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConsult"}}}},"responses":{"201":{"description":"The consult","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or consult is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/consults/{id}":{"get":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Read a consult","x-hcc-scope":"calls:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The consult","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/consults/{id}/complete":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Hand over: the customer comes off hold, then the Rep leaves","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The consult","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or consult is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/consults/{id}/cancel":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Back to the caller: the target leaves, the customer comes off hold","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The consult","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or consult is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/consults/{id}/merge":{"post":{"tags":["Calls"],"security":[{"bearerAuth":[]}],"summary":"Bring everyone together: the customer comes off hold, and nobody leaves","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The consult","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Consult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or consult is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/numbers":{"get":{"tags":["Numbers"],"security":[{"bearerAuth":[]}],"summary":"List phone numbers, newest first","x-hcc-scope":"numbers:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of phone numbers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumber"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents":{"get":{"tags":["Agents"],"security":[{"bearerAuth":[]}],"summary":"List AI agents","description":"Agents come from your connected AI-agent platforms (synced, read-only); manage them there.","x-hcc-scope":"agents:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Include agents that no longer exist in their provider"},"required":false,"description":"Include agents that no longer exist in their provider","name":"includeRemoved","in":"query"}],"responses":{"200":{"description":"A page of AI agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations":{"get":{"tags":["Integrations"],"security":[{"bearerAuth":[]}],"summary":"List connected voice-AI integrations, newest first","x-hcc-scope":"agents:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of integrations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/numbers/{id}":{"get":{"tags":["Numbers"],"security":[{"bearerAuth":[]}],"summary":"Get a phone number","x-hcc-scope":"numbers:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Phone number","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PhoneNumber"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Numbers"],"security":[{"bearerAuth":[]}],"summary":"Set the call flow of a phone number","description":"Inbound calls to the number run this flow from the live environment, instead of its call webhook. The flow must be registered. Live keys only.","x-hcc-scope":"numbers:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneNumber"}}}},"responses":{"200":{"description":"Phone number","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PhoneNumber"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Numbers"],"security":[{"bearerAuth":[]}],"summary":"Release a phone number","description":"Managed numbers are released at the provider. Numbers in your own connected account are never released: their previous webhook configuration is restored and they are unlinked. Live keys only.","x-hcc-scope":"numbers:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Released or unlinked"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/telephony":{"get":{"tags":["Telephony"],"security":[{"bearerAuth":[]}],"summary":"Get the telephony account status","x-hcc-scope":"numbers:read","responses":{"200":{"description":"Telephony account","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Telephony"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}":{"get":{"tags":["Agents"],"security":[{"bearerAuth":[]}],"summary":"Get an AI agent","x-hcc-scope":"agents:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"AI agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Agent"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints":{"get":{"tags":["Webhook endpoints"],"security":[{"bearerAuth":[]}],"summary":"List webhook endpoints, newest first","x-hcc-scope":"webhooks:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of webhook endpoints","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhook endpoints"],"security":[{"bearerAuth":[]}],"summary":"Create a webhook endpoint (returns its signing secret once)","description":"Live keys only: an endpoint receives Events from both environments.","x-hcc-scope":"webhooks:write","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"eventTypes":{"type":"array","items":{"type":"string","enum":["call.initiated","call.ringing","call.answered","call.status.changed","call.completed","call.gather.completed","call.recording.ready","call.recording.started","call.recording.paused","call.recording.resumed","call.recording.stopped","call.transcript.ready","call.transcript.failed","call.flow.fallback","call.transfer.started","call.transfer.completed","call.transfer.failed","call.participant.joined","call.participant.left","call.participant.held","call.participant.unheld","rep.state.changed","rep.help.requested","rep.offer.missed","rep.phone.verified","queue.call.entered","queue.call.answered","queue.call.abandoned","queue.call.reassigned","call.monitor.started","call.monitor.changed","call.monitor.ended","call.monitor.took_over","call.consult.started","call.consult.connected","call.consult.merged","call.consult.ended","billing.dials_stopped","billing.dials_resumed","billing.payment_failed","campaign.paused","campaign.lead_exited","lead.consent.recorded","lead.consent.revoked","disposition.recorded","call.ai_summary.set","conversation.transcript.ready","webhook.test"]},"default":[]},"description":{"type":["string","null"],"maxLength":500}},"required":["url"]}}}},"responses":{"201":{"description":"Webhook endpoint created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}":{"delete":{"tags":["Webhook endpoints"],"security":[{"bearerAuth":[]}],"summary":"Delete a webhook endpoint","description":"Live keys only.","x-hcc-scope":"webhooks:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows":{"put":{"tags":["Flows"],"security":[{"bearerAuth":[]}],"summary":"Register call flow versions","description":"`hcc.serve` calls this on startup (`mode: \"report\"`) and `hcc.flows.deploy` from CI (`mode: \"deploy\"`). The API key picks the environment (`hcc_live_` or `hcc_test_`). Returns the environment flow endpoint, creating its signing secret on first use. With a live key, `alsoTest: true` registers the same versions in test too. Every bound agent must be yours (422 `unknown_agent`) and every bound tool declared. When a version becomes active, its bound tools are synced to agents whose platform keeps tools on the agent.","x-hcc-scope":"flows:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterFlows"}}}},"responses":{"200":{"description":"Registered versions and the flow endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}},"endpoint":{"$ref":"#/components/schemas/FlowEndpoint"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/FlowBindingWarning"},"description":"Agent binding problems that do not block the deploy, e.g. a disabled agent, or an agent bound in both environments on a platform that keeps one tool set per agent"},"test":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}},"endpoint":{"$ref":"#/components/schemas/FlowEndpoint"}},"required":["data","endpoint"],"description":"With `alsoTest`: the versions registered in test, and its endpoint"}},"required":["data","endpoint","warnings"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Flows"],"security":[{"bearerAuth":[]}],"summary":"List the environment's flows (active versions)","x-hcc-scope":"flows:read","responses":{"200":{"description":"Flows","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/observe":{"post":{"tags":["Flows"],"security":[{"bearerAuth":[]}],"summary":"Report what a server serves, and read how it differs from what is deployed","description":"A server built with `handler()` sends this once on a cold start. It activates nothing. The report is stored on the flow endpoint and the Flows page shows the same differences.","x-hcc-scope":"flows:read","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObserveFlows"}}}},"responses":{"200":{"description":"How the server differs","content":{"application/json":{"schema":{"type":"object","properties":{"drift":{"type":"array","items":{"$ref":"#/components/schemas/FlowDrift"}}},"required":["drift"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flows/in-use":{"get":{"tags":["Flows"],"security":[{"bearerAuth":[]}],"summary":"List the flow versions still in use","description":"`hcc deploy --live` removes frozen versions that are not in this list. With a live key, `alsoTest=true` includes the test environment.","x-hcc-scope":"flows:read","parameters":[{"schema":{"type":"string","enum":["true","false"],"description":"Live keys only: test as well"},"required":false,"description":"Live keys only: test as well","name":"alsoTest","in":"query"}],"responses":{"200":{"description":"Versions in use","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowVersionInUse"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/flow-endpoint":{"get":{"tags":["Flows"],"security":[{"bearerAuth":[]}],"summary":"Get the environment's flow endpoint and signing secret","x-hcc-scope":"flows:read","responses":{"200":{"description":"Flow endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlowEndpoint"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Flows"],"security":[{"bearerAuth":[]}],"summary":"Set the environment's flow endpoint URL","x-hcc-scope":"flows:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetFlowEndpoint"}}}},"responses":{"200":{"description":"Flow endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlowEndpoint"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reps":{"get":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"List reps, newest first","x-hcc-scope":"reps:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of reps","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Rep"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reps/{id}":{"get":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Get a rep","x-hcc-scope":"reps:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The rep","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rep"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Update a rep's skills, caller ID or device, or enable / disable them","description":"A disabled rep goes offline and is offered no calls. Skills, `enabled` and the caller ID also apply to live calls, so they need a live key; a test key can only change `device`, and not on a phone verified with a real call.","x-hcc-scope":"reps:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRep"}}}},"responses":{"200":{"description":"The updated rep","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rep"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reps/{id}/state":{"put":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Set a rep's state: available, away or offline","description":"Refused (409) while the rep is on a call. Leaving `wrap_up` this way ends it.","x-hcc-scope":"reps:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRepState"}}}},"responses":{"200":{"description":"The rep","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rep"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reps/{id}/phone":{"put":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Register a rep's own phone and call it with a verification code","description":"Replaces any phone the rep had (it is unverified again, and `device` goes back to `softphone`). We call the number and read a 6-digit code, valid for 10 minutes; at most 5 calls an hour (429 after). With a test key the call runs on the simulator, whose timeline shows the code, and the phone then only rings simulated calls. A test key can not replace a phone verified with a real call.","x-hcc-scope":"reps:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetRepPhone"}}}},"responses":{"202":{"description":"The verification call was placed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RepPhoneVerification"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Remove a rep's own phone","description":"Calls ring the softphone again (`device` goes back to `softphone`). A test key can not remove a phone verified with a real call.","x-hcc-scope":"reps:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The rep","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rep"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A test key (`live_mode_only`): this change needs a live API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reps/{id}/phone/verify":{"post":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Verify a rep's phone with the code the call read out","description":"Emits `rep.phone.verified`. 422 `invalid_code`, `code_expired` or `too_many_attempts` (5 wrong codes) otherwise; the last two need a new call (`PUT /v1/reps/{id}/phone`).","x-hcc-scope":"reps:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRepPhone"}}}},"responses":{"200":{"description":"The rep","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rep"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reps/{id}/wrap-up":{"put":{"tags":["Reps"],"security":[{"bearerAuth":[]}],"summary":"Record the disposition of a rep's call and end their wrap-up","description":"What the desk does when the rep picks a disposition, for reps who take calls on their own phone without the desk open. A disposition in the workspace's DNC list adds the other party to Do Not Call. 409 unless it is the rep's current or last call.","x-hcc-scope":"reps:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepWrapUp"}}}},"responses":{"200":{"description":"The rep","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Rep"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/queues":{"put":{"tags":["Queues"],"security":[{"bearerAuth":[]}],"summary":"Register queue definitions","description":"Like `PUT /v1/flows`: `hcc.serve` reports its queues on startup (`mode: \"report\"` only activates versions never seen before) and `hcc.queues.deploy` activates them from CI. With a live key, `alsoTest: true` registers them in test too.","x-hcc-scope":"flows:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterQueues"}}}},"responses":{"200":{"description":"Registered versions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Queue"}},"test":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Queue"}}},"required":["data"],"description":"With `alsoTest`: the versions registered in test"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Queues"],"security":[{"bearerAuth":[]}],"summary":"List the environment's queues (active versions)","x-hcc-scope":"flows:read","responses":{"200":{"description":"Queues","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Queue"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/queues/{name}/stats":{"get":{"tags":["Queues"],"security":[{"bearerAuth":[]}],"summary":"Live numbers of a queue","x-hcc-scope":"flows:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"Queue stats","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueueStats"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/recording-policy":{"put":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"Register the recording policy","description":"Like `PUT /v1/queues`: `hcc.serve` reports it on startup (`mode: \"report\"` only activates a version never seen before) and `hcc.recording.deploy` activates it from CI. A redeploy does not clear the workspace's stop switch.","x-hcc-scope":"flows:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRecordingPolicy"}}}},"responses":{"200":{"description":"The registered version","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecordingPolicy"},"test":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecordingPolicy"}},"required":["data"],"description":"With `alsoTest`: the version registered in test"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"The environment's recording policy, and the stop switch","x-hcc-scope":"flows:read","responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecordingPolicyStatus"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/recording-policy/suspension":{"delete":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"Clear the workspace's stop switch","description":"The dashboard can only stop recording. Starting it again is this deliberate call, with a live key that has the `recording:manage` scope, which only an owner or admin can grant. Calls already in progress stay unrecorded; new calls follow the policy.","x-hcc-scope":"recording:manage","responses":{"204":{"description":"Cleared"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recording/pause":{"post":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"Pause a call's recording","description":"What is said while paused is not in the file. 409 when nothing is being recorded yet.","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Applied","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecordingControlResult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recording/resume":{"post":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"Resume a call's recording","description":"Picks up after a pause. 409 when nothing is being recorded.","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Applied","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RecordingControlResult"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recordings":{"get":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"A call's recordings","description":"Metadata only: start time, duration, channels, status and when it is deleted.","x-hcc-scope":"calls:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Recordings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Recording"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"Delete a call's recordings","description":"Stops one being made, then removes the audio from storage and from the provider, and the transcripts' text. The rows stay, saying there was a recording and when it went. The audio's removal runs in the background.","x-hcc-scope":"calls:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Removal started","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Recording"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/transcripts":{"get":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"A call's rep transcripts","description":"Without their text. AI agent conversations come as `conversation.transcript.ready`.","x-hcc-scope":"calls:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Transcripts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallTranscriptSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/transcripts/{transcriptId}":{"get":{"tags":["Recording"],"security":[{"bearerAuth":[]}],"summary":"One rep transcript, with its text","description":"The `transcriptId` of `call.transcript.ready`, which carries no text itself.","x-hcc-scope":"calls:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"transcriptId","in":"path"}],"responses":{"200":{"description":"Transcript","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallTranscript"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dnc":{"get":{"tags":["Do Not Call"],"security":[{"bearerAuth":[]}],"summary":"List the Do Not Call list, newest first","x-hcc-scope":"dnc:read","parameters":[{"schema":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"Look up one number"},"required":false,"description":"Look up one number","name":"e164","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of numbers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DncNumber"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Do Not Call"],"security":[{"bearerAuth":[]}],"summary":"Add a number to the Do Not Call list","description":"Idempotent: a number already on the list is returned as it is (200).","x-hcc-scope":"dnc:write","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDncNumber"}}}},"responses":{"200":{"description":"Already on the list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DncNumber"}},"required":["data"]}}}},"201":{"description":"Added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DncNumber"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dnc/{e164}":{"delete":{"tags":["Do Not Call"],"security":[{"bearerAuth":[]}],"summary":"Remove a number from the Do Not Call list","description":"Idempotent: removing a number that is not on the list also answers 204.","x-hcc-scope":"dnc:write","parameters":[{"schema":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","example":"+14155550123"},"required":true,"name":"e164","in":"path"}],"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads":{"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Add a lead, or update the one with the same `ref`","x-hcc-scope":"leads:write","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},"name":{"type":["string","null"],"minLength":1,"maxLength":200},"timezone":{"type":["string","null"],"maxLength":64},"ref":{"type":["string","null"],"minLength":1,"maxLength":200},"crmRef":{"type":["string","null"],"minLength":1,"maxLength":200},"recordUrl":{"type":["string","null"],"format":"uri"},"fields":{"type":"object","additionalProperties":{}},"consent":{"type":"object","properties":{"type":{"type":"string","enum":["express","express_written","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["human_calls","ai_voice","prerecorded"]},"minItems":1,"maxItems":3},"source":{"type":"string","minLength":1,"maxLength":200},"proofUrl":{"type":["string","null"],"maxLength":2000,"format":"uri"},"proofText":{"type":["string","null"],"minLength":1,"maxLength":2000},"effectiveAt":{"type":"string","format":"date-time"}},"required":["type","scopes","source","effectiveAt"]},"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i","description":"Goes through this campaign alone, instead of every running one with an `onLead` or an `.enroll`. A lead that doesn't match the campaign's filter is skipped."},"ifExists":{"type":"string","enum":["update","refuse"],"description":"`update`, the default, adds the lead or overwrites the one with the same `ref`, or with the same number if you give no `ref`. `refuse` writes nothing and answers 409 `lead_exists`, with the leads in `error.details.leads`, if a lead has this `ref`, or, with no `ref`, if any lead has this number, a CRM lead included. A new `ref` on a number that has leads adds a second lead, as people share lines. The leads are ids alone without the `leads:read` scope."}},"required":["phone"],"description":"A person to call. Leads are unique per environment by `ref`; without one, by phone number. A lead with no `timezone` is never dialed, because calling hours are in its own time."}}}},"responses":{"200":{"description":"Already known: updated if anything changed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Lead"}},"required":["data"]}}}},"201":{"description":"Added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Lead"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`lead_exists`, with `ifExists: \"refuse\"`: nothing was written. Or `idempotency_key_in_use`: a request with this key is still in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"List leads, newest first","x-hcc-scope":"leads:read","parameters":[{"schema":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"The leads with this number"},"required":false,"description":"The leads with this number","name":"phone","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of leads","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/batch":{"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Add or update up to 500 leads","description":"One statement for the whole batch. For anything larger, upload a file to `/leads/imports`.","x-hcc-scope":"leads:write","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertLeads"}}}},"responses":{"200":{"description":"What changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertedLeads"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/imports":{"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Import leads from a CSV file","description":"The body is the file (`text/csv`, at most 64 MB). It goes to storage and a job upserts it in batches, so this answers at once; follow it at `GET /leads/imports/{id}`. The file is deleted once read, and only the mapped columns are kept.\n\nA row with a `ref` is the lead with that ref. If the ref is new, it goes on a lead with that number and no ref, and otherwise makes a new lead: people can share a line. A row with no `ref` is the lead with its number, which is read as a US number, and is refused if that number is on several leads, as nothing says which it means. A missing column or a blank cell keeps what the lead holds, and `fields` adds to what it has. New leads enter running campaigns with an `onLead` or an `.enroll`, and updated ones are told as changed, so a new value in a field a filter names can bring back a lead that left (`reenroll: false` stops that). Numbers on the Do Not Call list are stored and counted, and no campaign takes them.","x-hcc-scope":"leads:write","parameters":[{"schema":{"type":"string","description":"The phone column. Default `phone`"},"required":false,"description":"The phone column. Default `phone`","name":"phone","in":"query"},{"schema":{"type":"string","description":"The name column. Default `name`. Empty: not read, whatever the file has"},"required":false,"description":"The name column. Default `name`. Empty: not read, whatever the file has","name":"name","in":"query"},{"schema":{"type":"string","description":"The time zone column. Default `timezone`. Empty: not read, whatever the file has"},"required":false,"description":"The time zone column. Default `timezone`. Empty: not read, whatever the file has","name":"timezone","in":"query"},{"schema":{"type":"string","description":"The column with your id. Default `ref`. Empty: not read, whatever the file has"},"required":false,"description":"The column with your id. Default `ref`. Empty: not read, whatever the file has","name":"ref","in":"query"},{"schema":{"type":"string","description":"The link column. Default `record_url`. Empty: not read, whatever the file has"},"required":false,"description":"The link column. Default `record_url`. Empty: not read, whatever the file has","name":"recordUrl","in":"query"},{"schema":{"type":"string","description":"Columns to keep in `fields`, as one CSV row: put a name with a comma in double quotes. Nothing else in the file is stored."},"required":false,"description":"Columns to keep in `fields`, as one CSV row: put a name with a comma in double quotes. Nothing else in the file is stored.","name":"fields","in":"query"},{"schema":{"type":"string","description":"A column of numbers to add to the Do Not Call list: `yes`, `true`, `1` or `x` adds it, and a blank, `no`, `false` or `0` does nothing. It never takes a number off. Anything else refuses the row. Needs the `dnc:write` scope. Not read unless you name it."},"required":false,"description":"A column of numbers to add to the Do Not Call list: `yes`, `true`, `1` or `x` adds it, and a blank, `no`, `false` or `0` does nothing. It never takes a number off. Anything else refuses the row. Needs the `dnc:write` scope. Not read unless you name it.","name":"dnc","in":"query"},{"schema":{"type":"string","description":"A column saying what each number agreed to. `yes`, `true`, `1`, `x` or `granted` is a grant, which needs its date in `consentDate`. `revoked`, `stop` or `opt out` is a revocation. A blank or a `no` records nothing. What cannot be read in these columns never refuses the row: the lead is imported and the line reported in `errors`, with no grant recorded, while a revocation still counts, dated at import if its date cannot be read. This keeps evidence: it is not legal clearance. Needs the `consent:write` scope. Not read unless you name it."},"required":false,"description":"A column saying what each number agreed to. `yes`, `true`, `1`, `x` or `granted` is a grant, which needs its date in `consentDate`. `revoked`, `stop` or `opt out` is a revocation. A blank or a `no` records nothing. What cannot be read in these columns never refuses the row: the lead is imported and the line reported in `errors`, with no grant recorded, while a revocation still counts, dated at import if its date cannot be read. This keeps evidence: it is not legal clearance. Needs the `consent:write` scope. Not read unless you name it.","name":"consent","in":"query"},{"schema":{"type":"string","description":"The column with the date consent was given or revoked."},"required":false,"description":"The column with the date consent was given or revoked.","name":"consentDate","in":"query"},{"schema":{"type":"string","description":"The column with the type: `express`, `express_written` or `other`."},"required":false,"description":"The column with the type: `express`, `express_written` or `other`.","name":"consentType","in":"query"},{"schema":{"type":"string","description":"The column with what it covers: any of `human_calls`, `ai_voice` and `prerecorded`. On a grant, a blank means `human_calls` only. On a revocation, every scope, which also adds the number to the Do Not Call list."},"required":false,"description":"The column with what it covers: any of `human_calls`, `ai_voice` and `prerecorded`. On a grant, a blank means `human_calls` only. On a revocation, every scope, which also adds the number to the Do Not Call list.","name":"consentScopes","in":"query"},{"schema":{"type":"string","description":"The column saying where it came from: the form, the page or the rep."},"required":false,"description":"The column saying where it came from: the form, the page or the rep.","name":"consentSource","in":"query"},{"schema":{"type":"string","description":"The column with a link to the proof."},"required":false,"description":"The column with a link to the proof.","name":"consentProofUrl","in":"query"},{"schema":{"type":"string","description":"The column with the wording the person agreed to."},"required":false,"description":"The column with the wording the person agreed to.","name":"consentProofText","in":"query"},{"schema":{"type":"string","maxLength":64,"description":"The zone you say blank rows are in, as an IANA name. It goes on new leads and on leads with no zone, never over a zone a lead holds. A lead with no zone is never dialed.","example":"America/New_York"},"required":false,"description":"The zone you say blank rows are in, as an IANA name. It goes on new leads and on leads with no zone, never over a zone a lead holds. A lead with no zone is never dialed.","name":"defaultTimezone","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"What to call this file in the import history"},"required":false,"description":"What to call this file in the import history","name":"fileName","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadImport"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"List CSV imports, newest first","x-hcc-scope":"leads:read","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of imports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadImport"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/imports/check":{"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"See what importing some rows would do, writing nothing","description":"Up to 1000 rows at a time, already read: send each lead once. For a preview, so its numbers can be a little stale. `doNotCall` needs the `dnc:read` scope, and is null without it.","x-hcc-scope":"leads:read","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":32},"ref":{"type":["string","null"],"minLength":1,"maxLength":200},"timezone":{"type":["string","null"],"maxLength":64}},"required":["phone"]},"minItems":1,"maxItems":1000}},"required":["rows"]}}}},"responses":{"200":{"description":"What it would do","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadImportCheck"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/imports/campaigns":{"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"The running campaigns new leads would enter","description":"Those with an `onLead` or an `.enroll`. One with a filter also hears of a lead that changes.","x-hcc-scope":"campaigns:read","responses":{"200":{"description":"The campaigns","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadImportCampaign"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/imports/{id}":{"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"How a CSV import went","x-hcc-scope":"leads:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The import","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LeadImport"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/imports/{id}/errors":{"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"The rows of an import that could not be read, as a CSV file","description":"The line and the reason of each, and never a cell of your file. Capped: the import says how many there were in all. There is a file when `hasErrorFile` is true.","x-hcc-scope":"leads:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A CSV of `line` and `reason`","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/{id}":{"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Get a lead","x-hcc-scope":"leads:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The lead","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Lead"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Delete a lead","description":"Its row and fields go, and it leaves every campaign. Dial attempts keep the number and decision, for the audit.","x-hcc-scope":"leads:write","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/{id}/consents":{"get":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"What this lead's number has agreed to, and everything said about it","description":"This keeps evidence of what a number agreed to: it is not legal clearance. Consent is by phone number, and the rows are never changed: the latest by `effectiveAt` stands, per scope, so only a newer grant undoes a revocation.","x-hcc-scope":"consent:read","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Its rows, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadConsent"}},"nextCursor":{"type":["string","null"]},"current":{"type":"object","properties":{"human_calls":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]},"ai_voice":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]},"prerecorded":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]}},"required":["human_calls","ai_voice","prerecorded"],"description":"Where this number stands, per scope"}},"required":["data","nextCursor","current"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Record that this number agreed to be called","description":"This keeps evidence of what a number agreed to: it is not legal clearance. Consent is by phone number, and the rows are never changed: the latest by `effectiveAt` stands, per scope, so only a newer grant undoes a revocation. A grant needs the date it was given, and can't be in the future. It never takes a number off the Do Not Call list.","x-hcc-scope":"consent:write","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["express","express_written","other"]},"scopes":{"type":"array","items":{"type":"string","enum":["human_calls","ai_voice","prerecorded"]},"minItems":1,"maxItems":3},"source":{"type":"string","minLength":1,"maxLength":200},"proofUrl":{"type":["string","null"],"maxLength":2000,"format":"uri"},"proofText":{"type":["string","null"],"minLength":1,"maxLength":2000},"effectiveAt":{"type":"string","format":"date-time"}},"required":["type","scopes","source","effectiveAt"]}}}},"responses":{"201":{"description":"Recorded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"human_calls":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]},"ai_voice":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]},"prerecorded":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]}},"required":["human_calls","ai_voice","prerecorded"],"description":"Where this number stands, per scope"},"recorded":{"type":"array","items":{"$ref":"#/components/schemas/LeadConsent"},"description":"The rows this added. Saying the same thing twice adds none."}},"required":["current","recorded"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/{id}/consents/revoke":{"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Record that this number took its consent back","description":"This keeps evidence of what a number agreed to: it is not legal clearance. Consent is by phone number, and the rows are never changed: the latest by `effectiveAt` stands, per scope, so only a newer grant undoes a revocation. With no `scopes`, it's every scope, which also adds the number to the Do Not Call list. The Dialer hears straight away.","x-hcc-scope":"consent:write","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","example":"5f2b6c1e-9d7a-4f43-8a51-2a0f0e3b9c11"},"required":false,"description":"Makes the request safe to retry. For 24h, a request with the same key and body replays the stored response (with `Idempotent-Replayed: true`); the same key with a different request is a 422 `idempotency_key_reused`, and while the first request is still running a 409 `idempotency_key_in_use`. Server errors, 409s and 429s are not stored.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"scopes":{"type":"array","items":{"type":"string","enum":["human_calls","ai_voice","prerecorded"]},"minItems":1,"maxItems":3},"source":{"type":"string","minLength":1,"maxLength":200},"proofUrl":{"type":["string","null"],"maxLength":2000,"format":"uri"},"proofText":{"type":["string","null"],"minLength":1,"maxLength":2000},"effectiveAt":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"Recorded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"current":{"type":"object","properties":{"human_calls":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]},"ai_voice":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]},"prerecorded":{"type":"object","properties":{"state":{"type":"string","enum":["granted","revoked","none"]},"consentId":{"type":["string","null"]},"type":{"type":["string","null"],"enum":["express","express_written","other",null]},"source":{"type":["string","null"]},"effectiveAt":{"type":["string","null"],"format":"date-time"}},"required":["state","consentId","type","source","effectiveAt"]}},"required":["human_calls","ai_voice","prerecorded"],"description":"Where this number stands, per scope"},"recorded":{"type":"array","items":{"$ref":"#/components/schemas/LeadConsent"},"description":"The rows this added. Saying the same thing twice adds none."}},"required":["current","recorded"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_key_in_use`: a request with this key is still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`idempotency_key_reused`: this key was used with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/{id}/complete":{"post":{"tags":["Leads"],"security":[{"bearerAuth":[]}],"summary":"Complete a lead","description":"Your code says this lead is finished: it leaves its campaigns, or the one you name, at any step. Exits and goals run on it, off a queue: an `.exit` that matches makes it `exit`, anything else `goal`. Answers before that has happened.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}}}}},"responses":{"202":{"description":"On its way"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns":{"put":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Register campaigns","description":"What `hcc deploy` sends. A campaign is its name and which hooks it defines; the logic is in your code. A new campaign starts `paused` in every environment, until someone resumes it, and a deploy never changes the status of one that exists.","x-hcc-scope":"campaigns:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterCampaigns"}}}},"responses":{"200":{"description":"The registered campaigns","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"List campaigns","x-hcc-scope":"campaigns:read","responses":{"200":{"description":"The campaigns of this environment","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}":{"get":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Get a campaign","x-hcc-scope":"campaigns:read","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/pause":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Pause a campaign","description":"No new dials. Calls already up carry on.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/resume":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Resume a campaign","description":"Dials again, within calling hours and pacing. Refused with a 409 while the campaign needs a deploy.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/backfill":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Run existing leads through a campaign","description":"Runs each lead that matches the campaign's filter, from its `.enroll`, through its `onLead`. With no `onLead` it takes them all, in the database, with no call to your server. It works while the campaign is paused, and nothing dials until it runs: while it's running, the leads it enrolls can be dialed straight away. A lead already in the campaign stays where it is, a lead that left stays out, and a removed lead comes back only if `onLead` enrolls it and the campaign doesn't say `reenroll: false`, so it's safe to repeat. It runs only when you ask, never on a deploy or a resume. A 409 if one is already running for this campaign, or if the campaign needs a deploy.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignBackfillRequest"}}}},"responses":{"202":{"description":"Started. Follow it with GET","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignBackfill"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"A campaign's latest backfill","x-hcc-scope":"campaigns:read","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The latest run, or null if there has been none","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/CampaignBackfill"},{"type":["object","null"]}]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/backfill/cancel":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Stop a backfill","description":"What was enrolled stays. A 409 if none is running. A batch being answered at that moment can still enroll its leads.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignBackfill"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/backfill/retry":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Retry a backfill's failures","description":"Sends its failed leads again and, if it stopped early, walks on from where it was. A 409 if one is running, or there is nothing to retry.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignBackfill"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/leads":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Put leads in a campaign","description":"Straight in line, past `onLead`, if they match the campaign's filter and aren't on your Do Not Call list. A lead already in the campaign stays put.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollLeads"}}}},"responses":{"200":{"description":"How many were new to it, and how many the campaign's filter or your Do Not Call list turned away","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enrolled":{"type":"integer"},"skipped":{"type":"integer"}},"required":["enrolled","skipped"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"List a campaign's leads","x-hcc-scope":"campaigns:read","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string","enum":["queued","waiting","needs_timezone","needs_consent","claimed","in_call","acting","deciding","step_failed","done"]},"required":false,"name":"state","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The most recently changed first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CampaignLead"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/leads/{leadId}":{"delete":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Take a lead out of a campaign","description":"The lead stays. A dial it was ready for is dropped before it happens.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string"},"required":true,"name":"leadId","in":"path"}],"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/campaigns/{name}/leads/{leadId}/retry":{"post":{"tags":["Campaigns"],"security":[{"bearerAuth":[]}],"summary":"Try a parked lead again","description":"A lead parked as `step_failed` goes back to the step it stopped at, within a minute. For a lead parked just after a call, that means another dial.","x-hcc-scope":"campaigns:write","parameters":[{"schema":{"type":"string","example":"renewals"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string"},"required":true,"name":"leadId","in":"path"}],"responses":{"202":{"description":"On its way"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/floor":{"get":{"tags":["Supervision"],"security":[{"bearerAuth":[]}],"summary":"The live floor: queues, reps, calls and queued calls","x-hcc-scope":"floor:read","responses":{"200":{"description":"The floor","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Floor"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/monitor":{"post":{"tags":["Supervision"],"security":[{"bearerAuth":[]}],"summary":"Monitor a rep's call: listen, whisper or barge","description":"Dials `to` into the call with the mode's flags. Only calls with a rep on them can be monitored (409 otherwise).","x-hcc-scope":"floor:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMonitor"}}}},"responses":{"201":{"description":"The monitor session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MonitorSession"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or session is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}":{"patch":{"tags":["Supervision"],"security":[{"bearerAuth":[]}],"summary":"Switch mode, or mute the supervisor","x-hcc-scope":"floor:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMonitor"}}}},"responses":{"200":{"description":"The monitor session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MonitorSession"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or session is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Supervision"],"security":[{"bearerAuth":[]}],"summary":"End the monitor session: the supervisor's leg leaves","x-hcc-scope":"floor:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The ended session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MonitorSession"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or session is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/monitors/{id}/take-over":{"post":{"tags":["Supervision"],"security":[{"bearerAuth":[]}],"summary":"Take the call over from the rep","description":"Barge first (409 otherwise). The rep leaves; the supervisor stays on the call.","x-hcc-scope":"floor:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The session, ended with `took_over`","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MonitorSession"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or session is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/queue-calls/{id}/reassign":{"post":{"tags":["Supervision"],"security":[{"bearerAuth":[]}],"summary":"Move a queued call to another queue, or to a free rep","description":"The id is the call id. The call keeps its place in line.","x-hcc-scope":"floor:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignQueueCall"}}}},"responses":{"200":{"description":"What moved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/QueueCallReassigned"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The call or session is not in a state to do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logs/requests":{"get":{"tags":["Logs"],"security":[{"bearerAuth":[]}],"summary":"List API requests, newest first","description":"The API key environment's requests of the last 30 days. A request shows here a moment after its response.","x-hcc-scope":"logs:read","parameters":[{"schema":{"type":"string","enum":["2xx","3xx","4xx","5xx"],"description":"Only this status class, e.g. `4xx`"},"required":false,"description":"Only this status class, e.g. `4xx`","name":"status","in":"query"},{"schema":{"type":"string","pattern":"^[A-Za-z]{3,7}$","description":"Only this HTTP method","example":"POST"},"required":false,"description":"Only this HTTP method","name":"method","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Paths containing this text","example":"/v1/calls"},"required":false,"description":"Paths containing this text","name":"path","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of requests","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiRequest"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/logs/requests/{id}":{"get":{"tags":["Logs"],"security":[{"bearerAuth":[]}],"summary":"Get an API request by its request id","x-hcc-scope":"logs:read","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The request","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiRequest"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/reps":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"Rep performance","description":"Per rep: calls handled (inbound and outbound), talk time, average handle time, wrap-up, missed offers, occupancy and time per state.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"type":"string","enum":["json","csv"],"description":"`csv`: answer with CSV, like `Accept: text/csv`"},"required":false,"description":"`csv`: answer with CSV, like `Accept: text/csv`","name":"format","in":"query"}],"responses":{"200":{"description":"The report, or its rows as CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepReport"}},"text/csv":{"schema":{"type":"string","description":"RFC 4180, with a header"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/queues":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"Queue performance","description":"Per queue, from the visits that entered it: offered, answered, abandoned, overflowed, service level, average speed of answer and longest wait. `repId` does not apply.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"type":"string","enum":["json","csv"],"description":"`csv`: answer with CSV, like `Accept: text/csv`"},"required":false,"description":"`csv`: answer with CSV, like `Accept: text/csv`","name":"format","in":"query"}],"responses":{"200":{"description":"The report, or its rows as CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueReport"}},"text/csv":{"schema":{"type":"string","description":"RFC 4180, with a header"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/outbound":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"Outbound performance","description":"From the dial attempts of reps, campaigns and the API: dials, connects, connect rate, talk, Do Not Call blocks and dispositions, per rep, with calls the API placed with no rep in a row of their own (`noRep`). `queue` and `direction` do not apply.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"type":"string","enum":["json","csv"],"description":"`csv`: answer with CSV, like `Accept: text/csv`"},"required":false,"description":"`csv`: answer with CSV, like `Accept: text/csv`","name":"format","in":"query"}],"responses":{"200":{"description":"The report, or its rows as CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundReport"}},"text/csv":{"schema":{"type":"string","description":"RFC 4180, with a header"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/campaigns":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"Campaign performance","description":"Per campaign: dials, connects, right-party conversations, machines, no answers, talk and dispositions, from the dials placed in the range; and the leads that left in the range, why, and the goal rate. Only `campaign` filters it: `repId`, `queue` and `direction` do not apply.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"type":"string","enum":["json","csv"],"description":"`csv`: answer with CSV, like `Accept: text/csv`"},"required":false,"description":"`csv`: answer with CSV, like `Accept: text/csv`","name":"format","in":"query"}],"responses":{"200":{"description":"The report, or its rows as CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignReport"}},"text/csv":{"schema":{"type":"string","description":"RFC 4180, with a header"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/dispositions":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"Dispositions per rep and queue","description":"Calls with a disposition, counted per disposition, rep and queue.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"type":"string","enum":["json","csv"],"description":"`csv`: answer with CSV, like `Accept: text/csv`"},"required":false,"description":"`csv`: answer with CSV, like `Accept: text/csv`","name":"format","in":"query"}],"responses":{"200":{"description":"The report, or its rows as CSV","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispositionReport"}},"text/csv":{"schema":{"type":"string","description":"RFC 4180, with a header"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/timeseries":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"A metric over time","description":"Hourly or daily buckets in the workspace's time zone; every bucket of the range is present. Hourly series cover at most 31 days.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"},{"schema":{"type":"string","enum":["calls","service_level","wait_time","handled","dials","states"]},"required":true,"name":"metric","in":"query"},{"schema":{"type":"string","enum":["hour","day"],"default":"day"},"required":false,"name":"interval","in":"query"}],"responses":{"200":{"description":"The series","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Timeseries"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reports/summary":{"get":{"tags":["Reports"],"security":[{"bearerAuth":[]}],"summary":"Headline numbers, against the previous period","description":"Calls, service level, abandonment rate, average speed of answer, average handle time and connect rate for the range, and for the range of the same length right before it.","x-hcc-scope":"reports:read","parameters":[{"schema":{"type":"string","description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","example":"2026-10-01T00:00:00Z"},"required":false,"description":"Start of the range (inclusive), ISO 8601. Default: 7 days before `to`. At most 92 days","name":"from","in":"query"},{"schema":{"type":"string","description":"End of the range (exclusive), ISO 8601. Default: now","example":"2026-10-08T00:00:00Z"},"required":false,"description":"End of the range (exclusive), ISO 8601. Default: now","name":"to","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^rep_[0-9a-z]+$"},{"type":"array","items":{"type":"string","pattern":"^rep_[0-9a-z]+$"}}],"description":"Only these reps (`rep_…`)"},"required":false,"description":"Only these reps (`rep_…`)","style":"form","explode":true,"name":"repId","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$/i"}}],"description":"Only these queues, by name"},"required":false,"description":"Only these queues, by name","style":"form","explode":true,"name":"queue","in":"query"},{"schema":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"},{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,54}$/i"}}],"description":"Only these campaigns, by name. Only the campaign report reads it"},"required":false,"description":"Only these campaigns, by name. Only the campaign report reads it","style":"form","explode":true,"name":"campaign","in":"query"},{"schema":{"type":"string","enum":["inbound","outbound"],"description":"Only inbound or outbound calls"},"required":false,"description":"Only inbound or outbound calls","name":"direction","in":"query"}],"responses":{"200":{"description":"The KPIs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSummary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator":{"get":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"The simulated number, the numbers and test flows you can call, and the limits","x-hcc-scope":"simulator:write","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatorInfo"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls":{"get":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"List simulated calls (kept for 24 hours)","x-hcc-scope":"simulator:write","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SimulatedCall"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Start a simulated inbound call to one of your numbers","x-hcc-scope":"simulator:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSimulatedCall"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Call"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}":{"get":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"A simulated call as the simulator sees it: legs, the open prompt, the agent","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/timeline":{"get":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Everything that happened on a simulated call, in order","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SimulatorTimelineEntry"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/digits":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Press keys: answers the open prompt","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedDigits"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/speech":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Say something: answers the open prompt as speech","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedSpeech"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/answer":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: answer","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/machine":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: machine","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/greeting":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: greeting","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/greeting-end":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: greeting-end","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/busy":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: busy","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/no-answer":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: no-answer","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/fail":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: fail","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/hangup":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Act as the far end of a leg: hangup","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedLegAction"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/agent/tool":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Play the AI agent: call one of its tools through the flow’s tool path","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedToolCall"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/agent/say":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Play the AI agent: say something to the caller","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedAgentSay"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/supervisor/say":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Play the monitoring supervisor: whispering, only the rep hears it; barging, everyone does","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedAgentSay"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/rep/say":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Play the rep: what they say is in a test call's transcript","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedAgentSay"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/agent/end":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Play the AI agent: end the conversation (runs onEnd / onAgentEnd)","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedAgentEnd"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulator/calls/{id}/agent/report":{"post":{"tags":["Simulator"],"security":[{"bearerAuth":[]}],"summary":"Play the AI agent's platform: deliver its post-call report and summary now, whether or not it has ended","x-hcc-scope":"simulator:write","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedAgentReport"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SimulatedCall"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): the simulator runs in test mode only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dev/sessions":{"post":{"tags":["Dev sessions"],"security":[{"bearerAuth":[]}],"summary":"Create a dev session (what `hcc dev` attaches with)","description":"While it is attached, the test environment’s flow events go to it instead of the test flow endpoint URL, and it gets a copy of every test Event. One per workspace: the last one attached wins.","x-hcc-scope":"dev:connect","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDevSession"}}}},"responses":{"201":{"description":"Created; open `connectUrl` within 60 s","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DevSession"}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): dev sessions run against the test environment only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dev/sessions/{id}":{"delete":{"tags":["Dev sessions"],"security":[{"bearerAuth":[]}],"summary":"Detach a dev session","description":"Idempotent. Test flow events go to the test flow endpoint URL again.","x-hcc-scope":"dev:connect","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Detached"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A live key (`test_mode_only`): dev sessions run against the test environment only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`, or another limit named by `error.code`","headers":{"Retry-After":{"description":"Seconds to wait before trying again. Sent with `rate_limited`.","schema":{"type":"integer","example":10}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}