{"openapi":"3.1.0","info":{"title":"Ladoo API","version":"2026-11-16","description":"Ladoo API. `/v1` is tenant-scoped (API key or dashboard session); `/public/v1` serves chat widgets, brands and status without auth. Send `Ladoo-Version` to pick a dated version (default: the one your key was created on) and `Idempotency-Key` on POSTs to retry safely. Responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`; a 429 adds `Retry-After`. Versions and changes: https://tryladoo.com/docs/developers/changelog"},"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","description":"Tenant API key (`lsk_…`), scoped. The dashboard instead sends its session cookie plus `X-Ladoo-Workspace`; the person's role maps to the same scopes."},"Session":{"type":"apiKey","in":"cookie","name":"lassi.session_token","description":"Dashboard session (Better Auth)"}},"schemas":{"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]},"image":{"type":["string","null"]},"timezone":{"type":["string","null"],"description":"IANA time zone for times in your emails, e.g. America/Chicago"},"sms_phone":{"type":["string","null"],"description":"Your confirmed mobile number for texts after calls (E.164)."},"sms_opted_out":{"type":"boolean","description":"That number replied STOP, so nothing is texted to it until it replies START."},"signup_for":{"type":["string","null"],"description":"Who the sign-up link was for: `agency` or a business type like `plumbing`. Presets onboarding."}},"required":["id","email","name","image","timezone","sms_phone","sms_opted_out","signup_for"]},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/AccessibleWorkspace"}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"workspace_name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"expires_at":{"type":"string","format":"date-time"}},"required":["id","workspace_id","workspace_name","role","expires_at"]}},"texts_available":{"type":"boolean","description":"Whether texts after calls can be sent yet. False until Ladoo's texting number is approved; the dashboard shows the setting as coming soon."},"caller_texts_available":{"type":"boolean","description":"Whether texts to callers (missed-call text back, booking texts) can be turned on. False until carriers approve them; the dashboard shows those switches as coming soon."},"staff":{"type":"boolean","description":"Ladoo staff (STAFF_EMAILS): the dashboard shows the admin dashboard."},"terms":{"type":"object","properties":{"version":{"type":"string"},"accepted":{"type":"boolean"}},"required":["version","accepted"],"description":"The current Terms of Service version, and whether you've agreed to it. The dashboard asks for agreement before anything else when `accepted` is false."}},"required":["user","workspaces","invitations","texts_available","caller_texts_available","staff","terms"]},"AccessibleWorkspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["platform","agency","subaccount","direct"]},"parent_id":{"type":["string","null"],"format":"uuid"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"suspended":{"type":"boolean","description":"Suspended by Ladoo: it can't be opened until support lifts it"},"access":{"type":"string","enum":["member","inherited"],"description":"`inherited`: no membership here, but owner/admin of an agency above it"},"daily_digest":{"type":["boolean","null"],"description":"Whether you get this workspace's morning summary email (null with inherited access)."},"call_texts":{"type":["string","null"],"enum":["off","all","urgent",null],"description":"Texts after this workspace's calls: every call, only urgent and transferred calls, or none (null with inherited access)."},"call_texts_on_call_only":{"type":["boolean","null"],"description":"Only while your mobile number is first on call for one of its teams."},"call_emails":{"type":["string","null"],"enum":["off","all","urgent",null],"description":"Emails after this workspace's calls, to your account email: every call, only urgent and transferred calls, or none. Unset, it's every call for owners and admins and off for everyone else (null with inherited access)."}},"required":["id","name","slug","kind","parent_id","role","suspended","access","daily_digest","call_texts","call_texts_on_call_only","call_emails"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string"},"details":{},"request_id":{"type":"string"}},"required":["code","message","request_id"]}},"required":["error"]},"AuditEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"action":{"type":"string","example":"workflow.published"},"actor":{"$ref":"#/components/schemas/AuditActor"},"target":{"type":["string","null"],"description":"What it was done to (an id)"},"ip":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string","format":"date-time"}},"required":["id","workspace","action","actor","target","ip","metadata","created_at"]},"AuditActor":{"type":"object","properties":{"type":{"type":"string","enum":["user","api_key","ladoo","stripe","calendar","system"]},"id":{"type":["string","null"],"description":"A person's or key's id; for `calendar`, `crm` or `google`"},"name":{"type":["string","null"],"description":"The person's name, or the key's name"},"email":{"type":["string","null"],"description":"For a person"},"key_prefix":{"type":["string","null"],"description":"For an API key (`lsk_…`)"}},"required":["type","id","name","email","key_prefix"]},"CallListItem":{"allOf":[{"$ref":"#/components/schemas/CallSummary"},{"type":"object","properties":{"person":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"],"description":"The person in People this conversation is linked to"},"success":{"type":["string","null"],"enum":["passed","failed","unclear",null],"description":"How the call did against its agent's success criteria (`judgment.outcome` on the call). Null until judged, when not judged, or when the agent has no criteria."}},"required":["person","success"]}]},"CallExtracted":{"type":["object","null"],"properties":{"caller_name":{"type":["string","null"]},"reason":{"type":["string","null"]},"urgency":{"type":["string","null"],"enum":["low","normal","high",null]},"callback_number":{"type":["string","null"]},"caller_name_corrected":{"type":["boolean","null"],"description":"The caller spelled a correction to the name on file. Only then does the call's name replace the person's in People and the contact's in the CRM."},"confirmed_email":{"type":["string","null"],"description":"The saved email the caller confirmed on the call: they spelled it, or said yes when it was read back. It counts as confirmed in People, so it can replace an email only heard on an earlier call, but never one the team typed (KAN-535)."}},"additionalProperties":{}},"CallAnalysis":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"The agent's analysis fields (KAN-404) read from the call after it ended, by field name: a string, number, boolean, `YYYY-MM-DD` date or one of an enum's options, or null when the call didn't say. Null for calls of agents without analysis fields.","example":{"lead_quality":"hot","budget":2500,"wants_financing":false}},"CallSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["live","test"]},"channel":{"type":"string","enum":["phone","web_chat"],"description":"`phone`, or `web_chat` for the website chat widget"},"widget_id":{"type":["string","null"],"format":"uuid"},"language":{"type":"string","enum":["en","es"],"description":"`es` when the caller spoke Spanish to an English-and-Spanish agent. The transcript is as spoken, with each line's English in `translation` when it was translated; the summary is always in English."},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["in_progress","completed"]},"phone_number_id":{"type":["string","null"],"format":"uuid"},"deployment_id":{"type":["string","null"],"format":"uuid"},"workflow_version_id":{"type":["string","null"],"format":"uuid"},"config_hash":{"type":"string"},"time_zone":{"type":["string","null"],"description":"The IANA time zone the call ran in: its clock, spoken times and hours conditions. Null for calls before it was recorded."},"from_number":{"type":["string","null"]},"to_number":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":["string","null"],"format":"date-time"},"duration_seconds":{"type":["integer","null"]},"end_reason":{"type":["string","null"],"enum":["caller_hangup","agent_hangup","transfer","error","timeout",null]},"summary":{"type":["string","null"]},"outcome":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["booked","message_taken","urgent_escalated","transferred","spam","blocked","cap_reached","no_action","info_provided"]},"crm_ref":{},"details":{"type":"object","additionalProperties":{}},"reached":{"type":"array","items":{"type":"string","enum":["booked","message_taken","urgent_escalated","transferred","spam","blocked","cap_reached","no_action","info_provided"]},"description":"Every outcome the call reached, its outcome (`type`) first: a message taken and then flagged urgent reached both."}},"required":["type","details","reached"]},"extracted":{"$ref":"#/components/schemas/CallExtracted"},"analysis":{"$ref":"#/components/schemas/CallAnalysis"},"urgency":{"type":["string","null"],"enum":["low","normal","high",null]},"recording_url":{"type":["string","null"]},"hung_up_early":{"type":"boolean","description":"Whether the caller hung up right after the greeting: under 20 seconds, before the call moved past its first step. False while the call is in progress."},"billable":{"type":["boolean","null"],"description":"Whether the call counts toward the plan's call minutes. Live calls that were spam, from a blocked caller, or under 10 seconds aren't billed; test calls never are. Null while the call is in progress."},"created_at":{"type":"string","format":"date-time"}},"required":["id","kind","channel","widget_id","language","direction","status","phone_number_id","deployment_id","workflow_version_id","config_hash","time_zone","from_number","to_number","started_at","ended_at","duration_seconds","end_reason","summary","outcome","extracted","analysis","urgency","recording_url","hung_up_early","billable","created_at"]},"CallDetail":{"allOf":[{"$ref":"#/components/schemas/Call"},{"type":"object","properties":{"person":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"],"description":"The person in People this conversation is linked to"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/CallStep"},"description":"The steps in `node_trail`, from the workflow version that ran the call, so a debug view can name them. Empty for single-prompt agents and calls without a trail."},"judgment":{"$ref":"#/components/schemas/CallJudgment"},"crm_sync":{"type":["object","null"],"properties":{"status":{"type":"string","enum":["pending","done","failed","skipped"]},"error":{"type":["string","null"]},"attempts":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"}},"required":["status","error","attempts","updated_at"],"description":"Whether the call was written to the workspace's CRM. Null when no CRM was connected. `skipped`: spam or a blocked caller, which never reach the CRM."},"follow_up":{"type":["object","null"],"properties":{"user_id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["user_id","name"],"description":"Who follows up on this missed call (Settings > General)"},"text_back":{"type":["object","null"],"properties":{"status":{"type":"string","enum":["pending","sent","skipped","failed"]},"reason":{"type":["string","null"]},"sent_at":{"type":["string","null"],"format":"date-time"}},"required":["status","reason","sent_at"],"description":"The text back to the caller of a missed call. `reason`: why it was skipped or failed. Null when none was queued."},"booking_notices":{"type":"array","items":{"$ref":"#/components/schemas/BookingNotice"},"description":"What the caller was sent about the appointments this call booked (a confirmation email), including ones skipped and why"}},"required":["person","steps","judgment","crm_sync","follow_up","text_back","booking_notices"]}]},"TranscriptEntry":{"type":"object","properties":{"role":{"type":"string","enum":["agent","caller","tool","staff"]},"speaker":{"type":"string","maxLength":200},"text":{"type":"string"},"start_ms":{"type":"integer","minimum":0},"end_ms":{"type":"integer","minimum":0},"interrupted":{"type":"boolean"},"translation":{"type":"string","description":"English translation of `text`, on calls whose `language` is `es`. Absent when the line was already in English or wasn't translated."}},"required":["role","text","start_ms","end_ms"]},"CallFlag":{"type":"object","properties":{"entry_index":{"type":"integer","minimum":0,"description":"Index of the flagged line in `transcript`"},"who":{"type":"string","enum":["agent","staff"]},"category":{"type":"string","enum":["incorrect","off_script","unanswered","tone"],"description":"`incorrect`: contradicts or goes beyond the business's information. `off_script`: skips the call script or breaks an instruction. `unanswered`: a question the knowledge doesn't cover. `tone`: rude or unprofessional wording."},"severity":{"type":"string","enum":["low","medium","high"]},"issue":{"type":"string","maxLength":500},"expected":{"type":["string","null"],"maxLength":500},"source":{"type":["string","null"],"maxLength":500,"description":"A quote from the instructions, knowledge or script it's judged against"}},"required":["entry_index","who","category","severity","issue","expected","source"]},"GuardrailBreach":{"type":"object","properties":{"guardrail_id":{"type":"string","format":"uuid"},"rule":{"type":"string"},"entry_index":{"type":["integer","null"],"minimum":0,"description":"The transcript line that broke it (null on calls checked before KAN-430's fix)"},"quote":{"type":"string","description":"What was said"}},"required":["guardrail_id","rule","entry_index","quote"]},"ToolCall":{"type":"object","properties":{"name":{"type":"string"},"args":{"type":"object","additionalProperties":{}},"result":{},"ok":{"type":"boolean"},"latency_ms":{"type":"integer","minimum":0},"started_ms":{"type":["integer","null"],"minimum":0},"error_kind":{"type":["string","null"],"maxLength":64}},"required":["name","args","ok","latency_ms"]},"CallLatency":{"type":["object","null"],"properties":{"p50_ms":{"type":["number","null"],"minimum":0},"p95_ms":{"type":["number","null"],"minimum":0},"turns":{"type":"integer","minimum":0},"per_turn":{"type":"array","items":{"type":"object","properties":{"eot_ms":{"type":"number","minimum":0},"llm_ttft_ms":{"type":"number","minimum":0},"tts_ttfb_ms":{"type":"number","minimum":0},"total_ms":{"type":"number","minimum":0},"provider_ttft_ms":{"type":"number","minimum":0}},"required":["eot_ms","llm_ttft_ms","tts_ttfb_ms","total_ms"]},"default":[]}},"required":["p50_ms","p95_ms","turns"]},"NodeVisit":{"type":"object","properties":{"node_id":{"type":"string","minLength":1},"entered_ms":{"type":"integer","minimum":0},"ok":{"type":"boolean"},"status_code":{"type":["integer","null"],"description":"A Webhook step's HTTP status; null when no reply came back"}},"required":["node_id","entered_ms"]},"CallStep":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"action":{"type":["string","null"]}},"required":["id","name","type","action"]},"CallJudgment":{"type":["object","null"],"properties":{"status":{"type":"string","enum":["pending","judged","skipped","failed"],"description":"`pending` until the review runs, shortly after the call. `skipped`: not judged, because the workspace's review allowance or the platform's cap said no (`skip_message` says why). `failed`: the review couldn't be completed."},"skip_reason":{"type":["string","null"]},"skip_message":{"type":["string","null"]},"outcome":{"type":["string","null"],"enum":["passed","failed","unclear",null],"description":"`failed` when any criterion failed, `passed` when all passed, otherwise `unclear`. Null when the agent had no success criteria or the call wasn't judged."},"results":{"type":"array","items":{"type":"object","properties":{"criterion":{"type":"string"},"verdict":{"type":"string","enum":["pass","fail","unclear"]},"reason":{"type":"string"}},"required":["criterion","verdict","reason"]}},"csat":{"type":["integer","null"],"minimum":1,"maximum":5,"description":"Estimated caller satisfaction, 1-5, read from the transcript text (not the voice)."},"csat_reason":{"type":["string","null"]},"judged_at":{"type":["string","null"],"format":"date-time"}},"required":["status","skip_reason","skip_message","outcome","results","csat","csat_reason","judged_at"],"description":"The call judged against its agent's success criteria, with a satisfaction estimate. Null for calls that aren't judged (test calls, chats, spam, no conversation) and calls from before judging."},"BookingNotice":{"type":"object","properties":{"booking_id":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["email","sms"]},"kind":{"type":"string","enum":["confirmation","reminder","update","cancellation"]},"to":{"type":["string","null"],"description":"The caller's email address"},"status":{"type":"string","enum":["pending","sent","skipped","failed"]},"reason":{"type":["string","null"],"description":"Why it was skipped or failed; null otherwise"},"sent_at":{"type":["string","null"],"format":"date-time"}},"required":["booking_id","channel","kind","to","status","reason","sent_at"]},"Call":{"allOf":[{"$ref":"#/components/schemas/CallSummary"},{"type":"object","properties":{"binding_id":{"type":["string","null"],"format":"uuid"},"provider_call_id":{"type":["string","null"]},"transcript":{"type":["array","null"],"items":{"$ref":"#/components/schemas/TranscriptEntry"}},"flags":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CallFlag"}},"guardrail_breaches":{"type":["array","null"],"items":{"$ref":"#/components/schemas/GuardrailBreach"},"description":"The agent's guardrails this call broke, checked in code when it completed. Null when the agent had no guardrails then, or the call is in progress."},"tool_calls":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ToolCall"}},"latency":{"$ref":"#/components/schemas/CallLatency"},"node_trail":{"type":["array","null"],"items":{"$ref":"#/components/schemas/NodeVisit"}},"completed_at":{"type":["string","null"],"format":"date-time"}},"required":["binding_id","provider_call_id","transcript","flags","guardrail_breaches","tool_calls","latency","node_trail","completed_at"]}]},"CallAnalytics":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"time_zone":{"type":"string"}},"required":["from","to","time_zone"]},"calls":{"type":"integer","minimum":0},"minutes":{"type":"integer","minimum":0,"description":"Billed call minutes (rounded up), as on the plan's usage meter"},"average_seconds":{"type":["integer","null"],"description":"Average length of finished calls"},"after_hours":{"type":["integer","null"],"minimum":0,"description":"Calls that started outside the business's hours: the booking hours of the calendar the agent that took the call books into, as calls route by them. Calls of agents without set hours aren't counted either way. Null when no agent's hours are known."},"hours_known":{"type":"integer","minimum":0,"description":"Calls whose agent's hours are known: what `after_hours` is a share of"},"business_hours":{"type":["string","null"],"description":"The hours `after_hours` is measured against, e.g. `Mon–Fri 9am–5pm, Eastern`. Null when they're unknown or the agents keep different hours."},"hung_up_early":{"type":"integer","minimum":0,"description":"Calls the caller hung up right after the greeting: under 20 seconds, still on the first step (each call's `hung_up_early`)"},"outcomes":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":["string","null"],"enum":["booked","message_taken","urgent_escalated","transferred","spam","blocked","cap_reached","no_action","info_provided",null]},"calls":{"type":"integer","minimum":0}},"required":["outcome","calls"],"description":"Calls by outcome (null: no outcome yet)"}},"conversations":{"type":"integer","minimum":0,"description":"Calls that became a conversation: finished with an outcome that isn't spam, a blocked caller or a client over its minute cap, and the caller didn't hang up early"},"booking_rate":{"type":["number","null"],"description":"Booked calls over `conversations`. Null with no conversations."},"previous":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"calls":{"type":"integer","minimum":0},"minutes":{"type":"integer","minimum":0},"hung_up_early":{"type":"integer","minimum":0},"conversations":{"type":"integer","minimum":0},"booking_rate":{"type":["number","null"]}},"required":["from","to","calls","minutes","hung_up_early","conversations","booking_rate"],"description":"The same figures for the period of the same length right before `range`, to compare with"},"callbacks_waiting":{"type":"object","properties":{"calls":{"type":"integer","minimum":0},"booking":{"type":"integer","minimum":0,"description":"Hung up partway through a booking"},"message":{"type":"integer","minimum":0,"description":"Hung up partway through a message"}},"required":["calls","booking","message"],"description":"Calls the caller hung up partway through a booking or message (each call's `unfinished`): people to call back"},"urgent":{"type":"integer","minimum":0,"description":"Calls the agent noted as urgent (`urgency` high)"},"flagged":{"type":"integer","minimum":0,"description":"Calls with a transcript line the post-call review flagged"},"calendar_errors":{"type":"integer","minimum":0,"description":"Calls where the booking calendar or CRM couldn't be reached: a calendar tool failed with a connection, HTTP or setup error (not a refusal like a taken time)"},"callers":{"type":"object","properties":{"new":{"type":"integer","minimum":0,"description":"People whose first conversation was in the range"},"returning":{"type":"integer","minimum":0,"description":"People in the range who had been in touch before"},"repeat":{"type":"integer","minimum":0,"description":"People who called more than once in the range"},"unknown":{"type":"integer","minimum":0,"description":"Calls not linked to a person"}},"required":["new","returning","repeat","unknown"],"description":"Callers, by the person each call is linked to"},"busiest":{"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6,"description":"0 Sunday to 6 Saturday"},"hour":{"type":"integer","minimum":0,"maximum":23},"calls":{"type":"integer","minimum":0}},"required":["day","hour","calls"]},"description":"Calls by weekday and hour they started in `time_zone`; empty hours left out"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"calls":{"type":"integer","minimum":0}},"required":["date","calls"]},"description":"Calls per day in `time_zone`, every day of the range"},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string","enum":["en","es"]},"calls":{"type":"integer","minimum":0}},"required":["language","calls"]}},"judging":{"type":"object","properties":{"judged":{"type":"integer","minimum":0,"description":"Calls judged against their agent's success criteria"},"passed":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"unclear":{"type":"integer","minimum":0},"success_rate":{"type":["number","null"],"description":"`passed` over `judged`. Null with nothing judged."},"csat_average":{"type":["number","null"],"description":"Average estimated caller satisfaction (1-5). Null with none estimated."},"csat_calls":{"type":"integer","minimum":0,"description":"Calls with a satisfaction estimate"}},"required":["judged","passed","failed","unclear","success_rate","csat_average","csat_calls"],"description":"Calls reviewed after they ended (each call's `judgment`)"},"latency":{"type":"object","properties":{"p50_ms":{"type":["number","null"]},"p95_ms":{"type":["number","null"]},"turns":{"type":"integer","minimum":0,"description":"Agent replies measured"}},"required":["p50_ms","p95_ms","turns"]},"reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"calls":{"type":"integer","minimum":0}},"required":["reason","calls"]},"description":"The most common call reasons, most first"},"workflow":{"type":["object","null"],"properties":{"agent_id":{"type":"string","format":"uuid"},"version_id":{"type":"string","format":"uuid"},"version_number":{"type":"integer"},"calls":{"type":"integer","minimum":0,"description":"Calls in the range that ran this version"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"action":{"type":["string","null"],"description":"An action step's action"},"reached":{"type":"integer","minimum":0,"description":"Calls that entered this step"},"ended":{"type":"integer","minimum":0,"description":"Calls whose last step was this one"}},"required":["id","name","type","action","reached","ended"]},"description":"Every step of the version in workflow order: breadth-first from the start, then steps the caller can jump to anytime, then any others"}},"required":["agent_id","version_id","version_number","calls","steps"],"description":"Where calls went in the agent's live workflow version. Only with `agent_id`; null when the agent has no live version."},"versions":{"type":["array","null"],"items":{"type":"object","properties":{"version_id":{"type":"string","format":"uuid"},"version_number":{"type":"integer"},"published_at":{"type":["string","null"],"format":"date-time"},"calls":{"type":"integer","minimum":0},"conversations":{"type":"integer","minimum":0},"booked":{"type":"integer","minimum":0},"booking_rate":{"type":["number","null"]},"hung_up_early":{"type":"integer","minimum":0}},"required":["version_id","version_number","published_at","calls","conversations","booked","booking_rate","hung_up_early"]},"description":"Only with `agent_id`: each workflow version of the agent that ran calls in the range or was published in it, oldest first, with how its calls went"},"clients":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"calls":{"type":"integer","minimum":0},"minutes":{"type":"integer","minimum":0},"booked":{"type":"integer","minimum":0},"hung_up_early":{"type":"integer","minimum":0},"callbacks_waiting":{"type":"integer","minimum":0},"previous_calls":{"type":"integer","minimum":0,"description":"Calls in the previous period"}},"required":["id","name","calls","minutes","booked","hung_up_early","callbacks_waiting","previous_calls"]},"description":"With `clients=true`: each client workspace's share"}},"required":["range","calls","minutes","average_seconds","after_hours","hours_known","business_hours","hung_up_early","outcomes","conversations","booking_rate","previous","callbacks_waiting","urgent","flagged","calendar_errors","callers","busiest","daily","languages","judging","latency","reasons","workflow","versions","clients"]},"BlockedCaller":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"phone":{"type":"string","description":"E.164","example":"+15551234567"},"note":{"type":["string","null"]},"created_by":{"type":["string","null"],"format":"uuid"},"created_at":{"type":"string","format":"date-time"}},"required":["id","phone","note","created_by","created_at"]},"BlockedCallerInput":{"type":"object","properties":{"phone":{"type":"string","maxLength":32,"description":"E.164. Spaces, dashes and parentheses are ignored; a bare 10-digit number is read as a US/Canada number."},"note":{"type":["string","null"],"maxLength":280}},"required":["phone"]},"BlockedCallerSettings":{"type":"object","properties":{"block_anonymous":{"type":"boolean","description":"Hang up on calls with no caller ID (withheld, anonymous or private numbers) before the agent answers, like a blocked number."}},"required":["block_anonymous"]},"AttentionIssue":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["calendar_disconnected","number_not_routing","client_billing_disconnected"]},"level":{"type":"string","enum":["red","amber"],"description":"`red`: calls or bookings are failing now. `amber`: fix soon."},"message":{"type":"string","example":"Google Calendar (sam@example.com) was disconnected, so bookings can't be checked."},"path":{"type":"string","description":"The dashboard page that fixes it"},"workspace":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"],"description":"The client workspace it's in; null for this workspace"},"opened_at":{"type":"string","format":"date-time"}},"required":["id","kind","level","message","path","workspace","opened_at"]},"Person":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"phone":{"type":["string","null"],"description":"E.164"},"email":{"type":["string","null"]},"first_contact_at":{"type":"string","format":"date-time"},"last_contact_at":{"type":"string","format":"date-time"},"channels":{"type":"array","items":{"type":"string","enum":["phone","web_chat"]},"description":"How they reached you"},"conversations":{"type":"integer"},"possible_match":{"type":"boolean"},"possible_matches":{"type":"integer","description":"Open 'looks like' suggestions"}},"required":["id","name","phone","email","first_contact_at","last_contact_at","channels","conversations","possible_match","possible_matches"]},"PersonDetail":{"allOf":[{"$ref":"#/components/schemas/Person"},{"type":"object","properties":{"notes":{"type":["string","null"]},"name_edited":{"type":"boolean","description":"The team typed or picked the name"},"email_status":{"type":["string","null"],"enum":["confirmed","unverified","invalid",null],"description":"`invalid`: a booking email to it hard-bounced, or whoever got it said it isn't theirs; nothing is sent to it, and the agent asks the caller for their email again. `confirmed`: the team or CRM set it, or the caller confirmed it on a call. `unverified`: only heard. Null without an email."},"created_from":{"type":"string","enum":["phone","web_chat"]},"other_phones":{"type":"array","items":{"type":"string"},"description":"Kept from merged people; E.164"},"other_emails":{"type":"array","items":{"type":"string"}},"crm_url":{"type":["string","null"],"description":"A link to the contact in your CRM. Currently always null."},"crm_contact":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","url"]},"crm_duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["id","name","email"]},"description":"Other contacts in your CRM with this person's phone number. Merge them in your CRM, or link the person to another one (`crm_contact` on PATCH). Ladoo never deletes or merges CRM contacts itself."},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["phone","web_chat"]},"started_at":{"type":"string","format":"date-time"},"duration_seconds":{"type":["integer","null"]},"summary":{"type":["string","null"]},"outcome":{"type":["string","null"],"enum":["booked","message_taken","urgent_escalated","transferred","spam","blocked","cap_reached","no_action","info_provided",null]}},"required":["id","channel","started_at","duration_seconds","summary","outcome"]},"description":"Newest first"},"matches":{"type":"array","items":{"type":"object","properties":{"reasons":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["phone","email","crm_contact","crm_phone","crm_email","name","similar_name","heard_name"]},"names":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"description":"The two names compared, for a similar or heard name"}},"required":["kind"]}},"strong":{"type":"boolean","description":"A shared phone, email or CRM contact"},"person":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"last_contact_at":{"type":"string","format":"date-time"},"last_summary":{"type":["string","null"]}},"required":["id","name","phone","email","last_contact_at","last_summary"]}},"required":["reasons","strong","person"]},"description":"People who look like this one, strongest first"}},"required":["notes","name_edited","email_status","created_from","other_phones","other_emails","crm_url","crm_contact","crm_duplicates","history","matches"]}]},"PersonCreate":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":200},"phone":{"type":["string","null"],"maxLength":32},"email":{"type":["string","null"],"maxLength":320},"notes":{"type":["string","null"],"maxLength":4000}}},"PersonUpdate":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":200},"phone":{"type":["string","null"],"maxLength":32},"email":{"type":["string","null"],"maxLength":320},"notes":{"type":["string","null"],"maxLength":4000},"crm_contact":{"type":["string","null"],"format":"uuid","description":"Link the person to this CRM contact (an id from `crm_contact` or `crm_duplicates`), or null to unlink. The contacts themselves stay as they are."}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string","enum":["call.started","call.completed","call.analyzed","call.flagged_urgent","call.transferred","message.taken","booking.created","booking.rescheduled","booking.cancelled","person.created","person.updated","knowledge.source_failed","number.purchased","number.released"]}},"enabled":{"type":"boolean"},"failing_since":{"type":["string","null"],"format":"date-time","description":"When deliveries started failing, with no success since. After 3 days of failing the endpoint is paused and the workspace's owners are emailed."},"auto_disabled_at":{"type":["string","null"],"format":"date-time","description":"When Ladoo paused the endpoint for failing. Cleared when it's resumed."},"previous_secret_expires_at":{"type":["string","null"],"format":"date-time","description":"After a rotation, deliveries are signed with the new and the old secret until then."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","url","description","events","enabled","failing_since","auto_disabled_at","previous_secret_expires_at","created_at","updated_at"]},"WebhookEndpointWithSecret":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","properties":{"secret":{"type":"string","description":"Signing secret for the Ladoo-Signature header. Shown only once."}},"required":["secret"]}]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"endpoint_id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"test":{"type":"boolean","description":"Sent with Send test event, with sample data"},"attempts":{"type":"integer"},"response_code":{"type":["integer","null"]},"response_body":{"type":["string","null"],"description":"The start of the receiver's last response body (2 KB)"},"latency_ms":{"type":["integer","null"]},"error":{"type":["string","null"]},"payload":{"type":"object","additionalProperties":{}},"created_at":{"type":"string","format":"date-time"},"last_attempt_at":{"type":["string","null"],"format":"date-time"},"next_attempt_at":{"type":["string","null"],"format":"date-time","description":"When it's tried again; null once delivered or failed"},"delivered_at":{"type":["string","null"],"format":"date-time"}},"required":["id","endpoint_id","event_id","event_type","status","test","attempts","response_code","response_body","latency_ms","error","payload","created_at","last_attempt_at","next_attempt_at","delivered_at"]},"PhoneNumber":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"e164":{"type":"string","example":"+12173943059"},"carrier":{"type":"string","enum":["telnyx","twilio"]},"status":{"type":"string","enum":["active","inactive","released"]},"type":{"type":"string","enum":["local","toll_free"]},"locality":{"type":["string","null"]},"monthly_price_cents":{"type":["integer","null"],"description":"What this number costs each month; null for numbers Ladoo manages"},"agent":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","e164","carrier","status","type","locality","monthly_price_cents","agent","created_at"]},"AvailablePhoneNumber":{"type":"object","properties":{"e164":{"type":"string"},"type":{"type":"string","enum":["local","toll_free"]},"locality":{"type":["string","null"]},"region":{"type":["string","null"]},"monthly_price_cents":{"type":"integer"}},"required":["e164","type","locality","region","monthly_price_cents"]},"BuyPhoneNumberRequest":{"type":"object","properties":{"e164":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"type":{"type":"string","enum":["local","toll_free"]},"locality":{"type":"string","maxLength":80},"agent_id":{"type":"string","format":"uuid"}},"required":["e164","type"]},"AssignPhoneNumberRequest":{"type":"object","properties":{"agent_id":{"type":["string","null"],"format":"uuid"}},"required":["agent_id"]},"Billing":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/Plan"},"billed_by_agency":{"type":"boolean"},"can_manage":{"type":"boolean"},"provider":{"type":"string","enum":["stripe","fake","none"]},"subscription":{"type":["object","null"],"properties":{"status":{"type":"string"},"cancel_at_period_end":{"type":"boolean"},"current_period_start":{"type":"string","format":"date-time"},"current_period_end":{"type":"string","format":"date-time"},"past_due_since":{"type":["string","null"],"format":"date-time","description":"When the plan's payment failed; null unless it's past due"},"grace_ends_at":{"type":["string","null"],"format":"date-time","description":"Past due: when live calls pause unless the payment goes through"}},"required":["status","cancel_at_period_end","current_period_start","current_period_end","past_due_since","grace_ends_at"]},"blocked":{"type":["string","null"],"enum":["suspended","archived","payment_overdue",null],"description":"Why calls, chats, number purchases and test minutes are paused right now, or null"},"usage":{"type":"object","properties":{"ai_credits":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"},"remaining":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["used","limit","remaining","per"]},"test_minutes":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"},"remaining":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["used","limit","remaining","per"]},"live_minutes":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"},"remaining":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]},"overage_minutes":{"type":"number"}},"required":["used","limit","remaining","per","overage_minutes"]},"chat_conversations":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"},"remaining":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["used","limit","remaining","per"]},"numbers":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"client_workspaces":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"knowledge_bases":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"knowledge_chars":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"scripts":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"}},"required":["used","limit"]},"model_spend":{"type":"object","properties":{"live_call":{"type":"object","properties":{"used_usd":{"type":"number"}},"required":["used_usd"]},"call_review":{"type":"object","properties":{"used_usd":{"type":"number"},"limit_usd":{"type":"number"},"remaining_usd":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["used_usd","limit_usd","remaining_usd","per"]},"judge":{"type":"object","properties":{"used_usd":{"type":"number"},"limit_usd":{"type":"number"},"remaining_usd":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["used_usd","limit_usd","remaining_usd","per"]},"simulation":{"type":"object","properties":{"used_usd":{"type":"number"},"limit_usd":{"type":"number"},"remaining_usd":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["used_usd","limit_usd","remaining_usd","per"]}},"required":["live_call","call_review","judge","simulation"],"description":"AI model spend this period, in USD: live calls (included, never capped), automatic reviews of live calls (`call_review`), judging test results (`judge`) and test simulations (`simulation`), each capped by the plan; holds for runs in progress count as used"}},"required":["ai_credits","test_minutes","live_minutes","chat_conversations","numbers","client_workspaces","knowledge_bases","knowledge_chars","scripts","model_spend"]},"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}},"number_prices_cents":{"type":"object","properties":{"local":{"type":"integer"},"toll_free":{"type":"integer"}},"required":["local","toll_free"]}},"required":["plan","billed_by_agency","can_manage","provider","subscription","blocked","usage","plans","number_prices_cents"]},"Plan":{"type":"object","properties":{"key":{"type":"string","enum":["free","starter","pro","agency"]},"name":{"type":"string"},"tagline":{"type":"string"},"price_cents":{"type":"integer"},"ai_credits":{"type":"integer"},"test_minutes":{"type":"integer"},"live_minutes":{"type":"integer"},"chat_conversations":{"type":"integer"},"overage_per_minute_cents":{"type":["number","null"]},"max_numbers":{"type":"integer"},"max_client_workspaces":{"type":"integer"},"max_knowledge_bases":{"type":"integer"},"max_knowledge_chars":{"type":"integer"},"max_crawl_pages":{"type":"integer"},"max_scripts":{"type":"integer"},"highlights":{"type":"array","items":{"type":"string"}}},"required":["key","name","tagline","price_cents","ai_credits","test_minutes","live_minutes","chat_conversations","overage_per_minute_cents","max_numbers","max_client_workspaces","max_knowledge_bases","max_knowledge_chars","max_crawl_pages","max_scripts","highlights"]},"CheckoutRequest":{"type":"object","properties":{"plan":{"type":"string","enum":["starter","pro","agency"]},"return_path":{"type":"string","maxLength":200}},"required":["plan"]},"AgentDetail":{"allOf":[{"$ref":"#/components/schemas/Agent"},{"type":"object","properties":{"workflow":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"version_id":{"type":"string","format":"uuid"},"version_number":{"type":"integer"},"published_at":{"type":["string","null"],"format":"date-time"},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolRef"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"dev_fixtures":{"type":"object","additionalProperties":{}},"booking_calendars":{"$ref":"#/components/schemas/BookingCalendars"},"booking":{"$ref":"#/components/schemas/AgentBooking"}},"required":["id","version_id","version_number","published_at","tools","fields","dev_fixtures","booking_calendars","booking"]},"versions":{"type":"array","items":{"type":"object","properties":{"version_id":{"type":"string","format":"uuid"},"version_number":{"type":"integer"},"published_at":{"type":["string","null"],"format":"date-time"},"changelog":{"type":["string","null"]}},"required":["version_id","version_number","published_at","changelog"]}},"phone_numbers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"e164":{"type":"string"}},"required":["id","e164"]}},"notifications":{"$ref":"#/components/schemas/AgentNotifications"},"success_criteria":{"type":"array","items":{"type":"string"}},"analysis_fields":{"type":"array","items":{"$ref":"#/components/schemas/AnalysisField"}},"pre_call_webhook":{"$ref":"#/components/schemas/AgentPreCallWebhook"}},"required":["workflow","versions","phone_numbers","notifications","success_criteria","analysis_fields","pre_call_webhook"]}]},"Pronunciation":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":80,"example":"Ladoo"},"say_as":{"type":"string","minLength":1,"maxLength":120,"example":"Lah-doo"}},"required":["text","say_as"]},"ToolRef":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string"}},"required":["name","kind"],"additionalProperties":{}},"CallField":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"label":{"type":"string","minLength":1},"type":{"type":"string","enum":["string","number","boolean","date","phone","email","enum"]},"options":{"type":"array","items":{"type":"string"},"default":[]},"description":{"type":"string","default":""},"collect":{"type":"string","enum":["required","optional","extract_only"]},"crm_field":{"type":["string","null"],"default":null}},"required":["key","label","type","collect"]},"BookingCalendars":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["all"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["selected"]},"calendars":{"type":"array","items":{"$ref":"#/components/schemas/BookingCalendarRef"},"maxItems":10}},"required":["mode","calendars"]}],"description":"`all`: every connected calendar set to take bookings, at the time of the call. `selected`: only these (an empty list: the agent doesn't book)."},"BookingCalendarRef":{"type":"object","properties":{"provider":{"type":"string","enum":["ghl","google","microsoft","ics"]},"account":{"type":"string","minLength":1,"maxLength":320,"description":"The connected account: the CRM account's id, the Google or Microsoft account's email, or a calendar link's name."},"calendar_id":{"type":"string","minLength":1,"maxLength":1024},"name":{"type":"string","maxLength":200,"default":"","description":"The calendar's name when it was chosen, for notices if it goes away."}},"required":["provider","account","calendar_id"]},"AgentBooking":{"type":["object","null"],"properties":{"state":{"type":"string","enum":["on","partial","off","not_used"],"description":"`partial`: a chosen calendar went away and the agent books into the rest. `not_used`: its booking tools are off."},"calendars":{"type":"array","items":{"type":"string"},"description":"Where it books right now, e.g. `CRM`."},"notice":{"type":["string","null"],"description":"What the owner should know or do, in plain words; null when fine."}},"required":["state","calendars","notice"]},"AgentNotifications":{"type":"object","properties":{"team_id":{"type":["string","null"],"format":"uuid","description":"Team to alert about urgent calls. Stored now; alert delivery is not built yet."}},"required":["team_id"]},"AnalysisField":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","example":"lead_quality","description":"The key the value is stored under: lowercase letters, digits and underscores, starting with a letter, up to 40 characters"},"type":{"type":"string","enum":["string","number","enum","boolean","date"],"description":"`string`, `number`, `enum` (one of `options`), `boolean`, or `date` (YYYY-MM-DD)"},"description":{"type":"string","minLength":1,"maxLength":300,"example":"How likely the caller is to buy: hot, warm or cold","description":"What to read from the call, in plain words. The model sees it as written."},"options":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"minItems":2,"maxItems":20,"description":"The allowed values of an `enum` field (2 to 20)"}},"required":["name","type","description"]},"AgentPreCallWebhook":{"type":"object","properties":{"url":{"type":["string","null"],"description":"Null: the agent has none"}},"required":["url"],"description":"The URL Ladoo POSTs to when a call rings, before the agent answers. The signing secret is shown only when it's set or rotated."},"Agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"engine":{"type":"string"},"defaults":{"type":"object","properties":{"language":{"type":"string"},"system_prompt":{"type":"string"},"first_message":{"type":"string"},"first_message_known_caller":{"type":"string"},"llm":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"temperature":{"type":"number","minimum":0,"maximum":2}},"required":["provider","model"]},"stt":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"keyterms":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":100,"default":[]}},"required":["provider","model"]},"tts":{"type":"object","properties":{"provider":{"type":"string"},"voice_id":{"type":"string"},"model":{"type":"string"},"pace":{"type":"string","enum":["slow","medium","fast"],"default":"medium"}},"required":["provider","voice_id","model"]},"max_call_seconds":{"type":"integer","exclusiveMinimum":0,"description":"Ends the call after this many seconds; at most 3600."},"pronunciations":{"type":"array","items":{"$ref":"#/components/schemas/Pronunciation"},"maxItems":100,"default":[]},"disclosure":{"type":"string","maxLength":400,"default":"I'm an AI assistant, and calls may be recorded, transcribed and handled by our service providers.","description":"Said on every phone call right after the greeting's first sentence (Terms §4.2). It must say the call may be recorded and transcribed and that service providers handle it. It should also say the caller is talking to an AI assistant and can ask for a person or leave a message; leaving those out is allowed, but some places require them."},"languages":{"type":"string","enum":["en","en_es"],"default":"en","description":"`en`: English only. `en_es`: English and Spanish. The greeting stays in English and invites Spanish speakers to speak Spanish; a caller who does gets the rest of the call in Spanish. Summaries stay in English."},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"default":{}}},"required":["language","system_prompt","first_message","llm","stt","tts","max_call_seconds"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","engine","defaults","created_at","updated_at"]},"CreateAgentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"template":{"type":"string","enum":["blank","after-hours","emergency-triage"],"default":"blank"}},"required":["name"]},"PublishAgentRequest":{"type":"object","properties":{"defaults":{"type":"object","properties":{"language":{"type":"string"},"system_prompt":{"type":"string"},"first_message":{"type":"string"},"first_message_known_caller":{"type":"string"},"llm":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"temperature":{"type":"number","minimum":0,"maximum":2}},"required":["provider","model"]},"stt":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"keyterms":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":100,"default":[]}},"required":["provider","model"]},"tts":{"type":"object","properties":{"provider":{"type":"string"},"voice_id":{"type":"string"},"model":{"type":"string"},"pace":{"type":"string","enum":["slow","medium","fast"],"default":"medium"}},"required":["provider","voice_id","model"]},"max_call_seconds":{"type":"integer","exclusiveMinimum":0,"description":"Ends the call after this many seconds; at most 3600."},"pronunciations":{"type":"array","items":{"$ref":"#/components/schemas/Pronunciation"},"maxItems":100,"default":[]},"disclosure":{"type":"string","maxLength":400,"default":"I'm an AI assistant, and calls may be recorded, transcribed and handled by our service providers.","description":"Said on every phone call right after the greeting's first sentence (Terms §4.2). It must say the call may be recorded and transcribed and that service providers handle it. It should also say the caller is talking to an AI assistant and can ask for a person or leave a message; leaving those out is allowed, but some places require them."},"languages":{"type":"string","enum":["en","en_es"],"default":"en","description":"`en`: English only. `en_es`: English and Spanish. The greeting stays in English and invites Spanish speakers to speak Spanish; a caller who does gets the rest of the call in Spanish. Summaries stay in English."},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"default":{}}},"required":["language","system_prompt","first_message","llm","stt","tts","max_call_seconds"]},"base_variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"The variables as the editor loaded them. When set, only the keys changed or removed relative to these apply, so settings saved meanwhile (from Build with AI, say) are kept. Unset replaces the variables with `defaults.variables`."},"base_languages":{"type":"string","enum":["en","en_es"],"description":"The languages as the editor loaded them. When set and `defaults.languages` is the same, the languages saved meanwhile (Spanish turned on by Build with AI, say) are kept."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolRef"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"dev_fixtures":{"type":"object","additionalProperties":{}},"booking_calendars":{"allOf":[{"$ref":"#/components/schemas/BookingCalendars"},{"description":"Which calendars the agent books into. Unset keeps the current choice. A newly chosen calendar must be connected to this workspace (422 `calendar_not_connected`)."}]},"changelog":{"type":"string","maxLength":500}}},"RenameAgentRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]},"AgentSuccessCriteria":{"type":"object","properties":{"criteria":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":10,"description":"Plain rules for a good call, e.g. \"Booked a visit or took a full message\". Up to 10, each up to 200 characters; blanks and repeats are dropped. After each live call a reviewer marks each one pass, fail or unclear."}},"required":["criteria"]},"AgentAnalysisFields":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/AnalysisField"},"description":"What to read from every call after it ends, e.g. a lead's budget or quality. Up to 10 fields, names unique. Read in the same post-call pass as the summary, on English and Spanish calls alike; each call stores them as `analysis`."}},"required":["fields"]},"AgentVariables":{"type":"object","properties":{"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["variables"]},"AgentVariablesUpdate":{"type":"object","properties":{"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]}},"remove":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_]{1,64}$"},"maxItems":50,"description":"Keys to take off the agent (a removed or renamed setting)."}},"required":["variables"]},"AgentTemplate":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"latest_version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","description","latest_version","created_at","updated_at"]},"AgentTemplateDetail":{"allOf":[{"$ref":"#/components/schemas/AgentTemplate"},{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateVersionSummary"}},"content":{"$ref":"#/components/schemas/AgentTemplateContent"}},"required":["versions","content"]}]},"AgentTemplateVersionSummary":{"type":"object","properties":{"version_number":{"type":"integer"},"changelog":{"type":["string","null"]},"created_by":{"type":["string","null"],"format":"uuid"},"created_at":{"type":"string","format":"date-time"}},"required":["version_number","changelog","created_by","created_at"]},"AgentTemplateContent":{"type":"object","properties":{"agent":{"type":"object","properties":{"language":{"type":"string"},"system_prompt":{"type":"string"},"first_message":{"type":"string"},"first_message_known_caller":{"type":"string"},"llm":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"temperature":{"type":"number","minimum":0,"maximum":2}},"required":["provider","model"]},"stt":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"keyterms":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":100,"default":[]}},"required":["provider","model"]},"tts":{"type":"object","properties":{"provider":{"type":"string"},"voice_id":{"type":"string"},"model":{"type":"string"},"pace":{"type":"string","enum":["slow","medium","fast"],"default":"medium"}},"required":["provider","voice_id","model"]},"max_call_seconds":{"type":"integer","exclusiveMinimum":0,"description":"Ends the call after this many seconds; at most 3600."},"pronunciations":{"type":"array","items":{"$ref":"#/components/schemas/Pronunciation"},"maxItems":100,"default":[]},"disclosure":{"type":"string","maxLength":400,"default":"I'm an AI assistant, and calls may be recorded, transcribed and handled by our service providers.","description":"Said on every phone call right after the greeting's first sentence (Terms §4.2). It must say the call may be recorded and transcribed and that service providers handle it. It should also say the caller is talking to an AI assistant and can ask for a person or leave a message; leaving those out is allowed, but some places require them."},"languages":{"type":"string","enum":["en","en_es"],"default":"en","description":"`en`: English only. `en_es`: English and Spanish. The greeting stays in English and invites Spanish speakers to speak Spanish; a caller who does gets the rest of the call in Spanish. Summaries stay in English."}},"required":["language","system_prompt","first_message","llm","stt","tts","max_call_seconds"]},"variables":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateVariable"}},"workflow":{"anyOf":[{"$ref":"#/components/schemas/WorkflowFile"},{"type":"null"}]},"success_criteria":{"type":"array","items":{"type":"string"},"default":[]}},"required":["agent","variables","workflow"],"description":"The latest version: agent settings, workflow and the business settings each client fills in. Never secrets, knowledge or business settings' values."},"AgentTemplateVariable":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$"},"label":{"type":"string"},"required":{"type":"boolean"}},"required":["key","label","required"]},"WorkflowFile":{"type":"object","properties":{"format":{"type":"string","enum":["lassi.workflow"]},"format_version":{"type":"number","enum":[1]},"name":{"type":"string","default":""},"description":{"type":"string","default":""},"graph":{"type":"object","additionalProperties":{}},"layout":{"type":"object","additionalProperties":{},"default":{}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"},"default":[]},"needs_setup":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowNeedsSetup"},"default":[]},"exported_at":{"type":"string","format":"date-time"}},"required":["format","format_version","graph"]},"WorkflowNeedsSetup":{"type":"object","properties":{"kind":{"type":"string","enum":["phone_number","crm_field","knowledge_base","webhook_header","pipeline_stage"]},"node_id":{"type":["string","null"]},"field_key":{"type":["string","null"]},"message":{"type":"string"}},"required":["kind","node_id","field_key","message"]},"AgentTemplateVersion":{"allOf":[{"$ref":"#/components/schemas/AgentTemplateVersionSummary"},{"type":"object","properties":{"content":{"$ref":"#/components/schemas/AgentTemplateContent"}},"required":["content"]}]},"AgentTemplateDiff":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"change":{"type":"string","enum":["added","removed","changed"]},"changes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"before":{},"after":{}},"required":["key"]}},"before":{"type":["object","null"],"additionalProperties":{}},"after":{"type":["object","null"],"additionalProperties":{}}},"required":["id","name","type","change","changes","before","after"]}},"flow":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"before":{},"after":{}},"required":["key"]}},"settings":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"before":{},"after":{}},"required":["key"]},"description":"Changes to the workflow's fields"},"agent":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"before":{},"after":{}},"required":["key"]},"description":"Changes to the prompt, greetings, voice, call settings and success criteria"},"variables":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"before":{},"after":{}},"required":["key"]},"description":"Changes to which business settings clients fill in"},"text_keys":{"type":"array","items":{"type":"string"}}},"required":["steps","flow","settings","agent","variables","text_keys"]},"CreatedFromTemplate":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/AgentDetail"},"published":{"type":"boolean","description":"True when the template's workflow went live straight away. False when something needs setting up first (see `needs_setup`): the workflow waits as a draft."},"needs_setup":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateSetupItem"}}},"required":["agent","published","needs_setup"]},"AgentTemplateSetupItem":{"anyOf":[{"$ref":"#/components/schemas/WorkflowNeedsSetup"},{"type":"object","properties":{"kind":{"type":"string","enum":["variable"]},"node_id":{"type":"null"},"field_key":{"type":"string"},"message":{"type":"string"}},"required":["kind","node_id","field_key","message"]}]},"CreateFromTemplate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The new agent's name"},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"default":{},"description":"The client's business settings for the template's `variables` (others are ignored). `business_name` defaults to the client workspace's name."},"version":{"type":"integer","minimum":1,"description":"Defaults to the latest"}},"required":["name"]},"PreCallWebhookSaved":{"type":"object","properties":{"url":{"type":["string","null"]},"secret":{"type":["string","null"],"description":"The signing secret for the `Ladoo-Signature` header, when this request created or rotated it. Shown only here; null otherwise."}},"required":["url","secret"]},"PreCallWebhookUpdate":{"type":"object","properties":{"url":{"type":["string","null"],"maxLength":2048,"description":"An https URL on a public host (port 443). Null turns the webhook off and deletes its secret."}},"required":["url"]},"AgentToolList":{"type":"object","properties":{"tools":{"type":"array","items":{"$ref":"#/components/schemas/AgentTool"}}},"required":["tools"]},"AgentTool":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"What the model calls it: lowercase letters, digits and underscores.","example":"order_status"},"description":{"type":"string","minLength":1,"maxLength":1000,"description":"When to use it and what it returns, for the model."},"parameters":{"$ref":"#/components/schemas/ToolParameters"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH"]},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"https on a public host. May use `{{args.x}}`, `{{fields.x}}` and `{{variables.x}}` after the host; values are URL-encoded."},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ToolHeader"},"maxItems":20,"description":"Values are secret: shown as `••••••••` once saved. Send that back to keep one."},"body":{"type":"string","maxLength":20000,"description":"A JSON template with `{{args.x}}` placeholders inside strings. Empty sends the arguments as the JSON body (GET sends them as the query string)."},"timeout_ms":{"type":"integer","minimum":1000,"maximum":10000},"say_while_waiting":{"type":"string","maxLength":200,"description":"Said to the caller while the request runs, e.g. \"Let me check that.\""},"response_fields":{"type":"array","items":{"$ref":"#/components/schemas/ToolResponseField"},"maxItems":20,"description":"The dot paths in the JSON reply the agent may read. Nothing else reaches it."},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","parameters","method","url","headers","body","timeout_ms","say_while_waiting","response_fields","created_at","updated_at"]},"ToolParameters":{"type":"object","properties":{"type":{"type":"string","enum":["object"],"default":"object"},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ToolParameter"},"default":{}},"required":{"type":"array","items":{"type":"string"},"default":[]}},"additionalProperties":false,"description":"A JSON Schema object of flat parameters: string, number, integer or boolean, each with an optional description and enum. The model fills them in; they're checked before sending."},"ToolParameter":{"type":"object","properties":{"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string","maxLength":500,"default":""},"enum":{"type":"array","items":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"}]},"minItems":1,"maxItems":50}},"required":["type"],"additionalProperties":false},"ToolHeader":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"value":{"type":"string","maxLength":2000}},"required":["name","value"]},"ToolResponseField":{"type":"object","properties":{"path":{"type":"string","maxLength":200,"pattern":"^[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*$"},"description":{"type":"string","maxLength":200,"default":""}},"required":["path"]},"CreateAgentTool":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"What the model calls it: lowercase letters, digits and underscores.","example":"order_status"},"description":{"type":"string","minLength":1,"maxLength":1000,"description":"When to use it and what it returns, for the model."},"parameters":{"$ref":"#/components/schemas/ToolParameters"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH"],"default":"POST"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"https on a public host. May use `{{args.x}}`, `{{fields.x}}` and `{{variables.x}}` after the host; values are URL-encoded."},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ToolHeader"},"maxItems":20,"default":[],"description":"Values are secret: shown as `••••••••` once saved. Send that back to keep one."},"body":{"type":"string","maxLength":20000,"default":"","description":"A JSON template with `{{args.x}}` placeholders inside strings. Empty sends the arguments as the JSON body (GET sends them as the query string)."},"timeout_ms":{"type":"integer","minimum":1000,"maximum":10000,"default":5000},"say_while_waiting":{"type":"string","maxLength":200,"default":"","description":"Said to the caller while the request runs, e.g. \"Let me check that.\""},"response_fields":{"type":"array","items":{"$ref":"#/components/schemas/ToolResponseField"},"maxItems":20,"default":[],"description":"The dot paths in the JSON reply the agent may read. Nothing else reaches it."}},"required":["name","description","parameters","url"]},"UpdateAgentTool":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"What the model calls it: lowercase letters, digits and underscores.","example":"order_status"},"description":{"type":"string","minLength":1,"maxLength":1000,"description":"When to use it and what it returns, for the model."},"parameters":{"$ref":"#/components/schemas/ToolParameters"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH"]},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"https on a public host. May use `{{args.x}}`, `{{fields.x}}` and `{{variables.x}}` after the host; values are URL-encoded."},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ToolHeader"},"maxItems":20,"description":"Values are secret: shown as `••••••••` once saved. Send that back to keep one."},"body":{"type":"string","maxLength":20000,"description":"A JSON template with `{{args.x}}` placeholders inside strings. Empty sends the arguments as the JSON body (GET sends them as the query string)."},"timeout_ms":{"type":"integer","minimum":1000,"maximum":10000},"say_while_waiting":{"type":"string","maxLength":200,"description":"Said to the caller while the request runs, e.g. \"Let me check that.\""},"response_fields":{"type":"array","items":{"$ref":"#/components/schemas/ToolResponseField"},"maxItems":20,"description":"The dot paths in the JSON reply the agent may read. Nothing else reaches it."}}},"McpServerList":{"type":"object","properties":{"servers":{"type":"array","items":{"$ref":"#/components/schemas/McpServer"}}},"required":["servers"]},"McpServer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"url":{"type":"string"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ToolHeader"}},"timeout_ms":{"type":"integer"},"tools":{"type":"array","items":{"$ref":"#/components/schemas/McpServerTool"},"description":"The server's tools as last read. Calls use a picked tool's schema from then."},"refreshed_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","url","headers","timeout_ms","tools","refreshed_at","created_at","updated_at"]},"McpServerTool":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object","additionalProperties":{}},"exposed_name":{"type":["string","null"],"description":"What the model calls it once picked. Null when its name can't be used."},"problem":{"type":["string","null"],"description":"Why it can't be picked (its name or schema), or null."},"picked":{"type":"boolean"},"confirm":{"type":"boolean"}},"required":["name","description","input_schema","exposed_name","problem","picked","confirm"]},"CreateMcpServer":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,19}$","description":"A short name, which prefixes the server's tools for the model: lowercase letters, digits and underscores, up to 20.","example":"crm"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"The server's Streamable HTTP endpoint: https on a public host.","example":"https://mcp.example.com/mcp"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ToolHeader"},"maxItems":20,"default":[],"description":"Sent with every request, such as Authorization. Values are secret: shown as `••••••••` once saved. Send that back to keep one."},"timeout_ms":{"type":"integer","minimum":1000,"maximum":10000,"default":8000},"tools":{"type":"array","items":{"$ref":"#/components/schemas/McpToolPick"},"maxItems":20,"default":[],"description":"The server's tools the agent may use, by the server's names."}},"required":["name","url"]},"McpToolPick":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"confirm":{"type":"boolean","default":false,"description":"The agent confirms with the caller before calling it (for tools that change things)."}},"required":["name"]},"UpdateMcpServer":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,19}$","description":"A short name, which prefixes the server's tools for the model: lowercase letters, digits and underscores, up to 20.","example":"crm"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"The server's Streamable HTTP endpoint: https on a public host.","example":"https://mcp.example.com/mcp"},"headers":{"type":"array","items":{"$ref":"#/components/schemas/ToolHeader"},"maxItems":20,"description":"Sent with every request, such as Authorization. Values are secret: shown as `••••••••` once saved. Send that back to keep one."},"timeout_ms":{"type":"integer","minimum":1000,"maximum":10000},"tools":{"type":"array","items":{"$ref":"#/components/schemas/McpToolPick"},"maxItems":20,"description":"The server's tools the agent may use, by the server's names."}}},"McpServerRefresh":{"type":"object","properties":{"server":{"$ref":"#/components/schemas/McpServer"},"dropped":{"type":"array","items":{"type":"string"},"description":"Picked tools the server no longer has (or can't be used), now unpicked."},"changed":{"type":"array","items":{"type":"string"},"description":"Picked tools whose schema or description changed, now updated."}},"required":["server","dropped","changed"]},"AgentTest":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"kind":{"type":"string","enum":["simulated","replay"]},"origin":{"type":"string","enum":["owner","call","assist"],"description":"`owner`: written by hand. `call`: made from a real call. `assist`: Build with AI."},"edited_at":{"type":["string","null"],"format":"date-time","description":"When the owner last changed the test by hand. An edited suggestion is kept when tests are suggested again."},"goal":{"type":["string","null"]},"persona":{"type":["string","null"]},"language":{"type":"string","enum":["en","es"]},"call_time":{"$ref":"#/components/schemas/AgentTestCallTime"},"pass_rules":{"type":"array","items":{"$ref":"#/components/schemas/AgentTestPassRule"}},"caller_turns":{"type":["array","null"],"items":{"type":"string"}},"source_call_id":{"type":["string","null"],"format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","agent_id","name","kind","origin","edited_at","goal","persona","language","call_time","pass_rules","caller_turns","source_call_id","created_at","updated_at"]},"AgentTestCallTime":{"type":["object","null"],"properties":{"weekday":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","example":"15:00"}},"required":["weekday","time"],"description":"The local time (in the agent's time zone) the simulated call happens at, e.g. to test an after-hours caller. Null: the next weekday at 10:00."},"AgentTestPassRule":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["outcome"]},"outcomes":{"type":"array","items":{"type":"string","enum":["booked","message_taken","urgent_escalated","transferred","spam","no_action","info_provided"]},"minItems":1,"maxItems":7,"description":"The call passes when it ends with any of these outcomes"}},"required":["type","outcomes"]},{"type":"object","properties":{"type":{"type":"string","enum":["judge"]},"text":{"type":"string","minLength":3,"maxLength":300,"description":"A plain rule a judge checks, e.g. 'Offers a Tuesday time'"}},"required":["type","text"]}]},"AgentTestInput":{"type":"object","properties":{"kind":{"type":"string","enum":["simulated","replay"],"default":"simulated"},"name":{"type":"string","minLength":1,"maxLength":120},"goal":{"type":["string","null"],"maxLength":1000,"description":"Simulated tests: what the caller wants, e.g. 'Book a cleaning next Tuesday'"},"persona":{"type":["string","null"],"maxLength":500,"description":"Simulated tests: who the caller is and how they talk, e.g. 'In a hurry, terse'"},"language":{"type":"string","enum":["en","es"],"default":"en"},"call_time":{"$ref":"#/components/schemas/AgentTestCallTime"},"pass_rules":{"type":"array","items":{"$ref":"#/components/schemas/AgentTestPassRule"},"maxItems":10,"default":[]},"caller_turns":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":1000},"maxItems":60,"description":"Replay tests: what the caller said, in order"}},"required":["name"]},"AgentTestUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"goal":{"type":["string","null"],"maxLength":1000,"description":"Simulated tests: what the caller wants, e.g. 'Book a cleaning next Tuesday'"},"persona":{"type":["string","null"],"maxLength":500,"description":"Simulated tests: who the caller is and how they talk, e.g. 'In a hurry, terse'"},"language":{"type":"string","enum":["en","es"]},"call_time":{"$ref":"#/components/schemas/AgentTestCallTime"},"pass_rules":{"type":"array","items":{"$ref":"#/components/schemas/AgentTestPassRule"},"maxItems":10},"caller_turns":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":1000},"maxItems":60,"description":"Replay tests: what the caller said, in order"}}},"AgentTestRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"purpose":{"type":"string","enum":["manual","publish_check"]},"target":{"type":"string","enum":["live","draft","changes"]},"status":{"type":"string","enum":["running","done","cancelled"]},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"runner_online":{"type":"boolean","description":"False: the test runner hasn't checked in, so queued tests are waiting"},"counts":{"type":"object","properties":{"total":{"type":"integer"},"queued":{"type":"integer"},"running":{"type":"integer"},"passed":{"type":"integer"},"failed":{"type":"integer"},"unclear":{"type":"integer"},"other":{"type":"integer"}},"required":["total","queued","running","passed","failed","unclear","other"]},"comparison":{"$ref":"#/components/schemas/AgentTestComparison"},"pass_rate":{"type":["object","null"],"properties":{"passed":{"type":"integer"},"total":{"type":"integer"}},"required":["passed","total"],"description":"Of the tests, how many passed on the candidate, when the run tested one. A test that failed, was unclear or didn't get a score hasn't passed."},"results":{"type":"array","items":{"type":"object","properties":{"test_id":{"type":"string","format":"uuid"},"live":{"$ref":"#/components/schemas/AgentTestResult"},"candidate":{"$ref":"#/components/schemas/AgentTestResult"}},"required":["test_id"]}}},"required":["id","agent_id","purpose","target","status","created_at","finished_at","runner_online","counts","comparison","pass_rate","results"]},"AgentTestComparison":{"type":["object","null"],"properties":{"worse":{"type":"integer"},"better":{"type":"integer"},"same":{"type":"integer"},"unknown":{"type":"integer","description":"Tests without a scored result on both sides"},"not_run":{"type":"integer","description":"Of `unknown`, tests scored on live with no score on the new version (an error, a timeout or a skip). `block` refuses a publish while this is above 0."}},"required":["worse","better","same","unknown","not_run"],"description":"The candidate against live, when the run tested a candidate"},"AgentTestResult":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"test_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"side":{"type":"string","enum":["live","candidate"]},"status":{"type":"string","enum":["queued","running","passed","failed","unclear","error","skipped"]},"checks":{"type":"array","items":{"$ref":"#/components/schemas/AgentTestCheck"}},"call":{"type":["object","null"],"properties":{"transcript":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","caller"]},"text":{"type":"string"}},"required":["role","text"]}},"tool_calls":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"args":{"type":"object","additionalProperties":{}},"ok":{"type":"boolean"}},"required":["name","args","ok"]}},"outcome":{"type":["string","null"]},"ended_by":{"type":["string","null"]},"seconds":{"type":"number"}},"required":["transcript","tool_calls","outcome","ended_by","seconds"]},"error":{"type":["string","null"]},"reused":{"type":"boolean","description":"A current live result from an earlier run, not run again for this check"},"finished_at":{"type":["string","null"],"format":"date-time"}},"required":["id","test_id","name","side","status","checks","call","error","reused","finished_at"]},"AgentTestCheck":{"type":"object","properties":{"kind":{"type":"string","enum":["outcome","rule","guardrail"]},"label":{"type":"string"},"verdict":{"type":"string","enum":["pass","fail","unclear"]},"reason":{"type":"string"}},"required":["kind","label","verdict","reason"]},"PublishCheckRequest":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","enum":["draft"]}},"required":["source"]},{"type":"object","properties":{"source":{"type":"string","enum":["changes"]},"changes":{"type":"object","properties":{"defaults":{"type":"object","properties":{"language":{"type":"string"},"system_prompt":{"type":"string"},"first_message":{"type":"string"},"first_message_known_caller":{"type":"string"},"llm":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"temperature":{"type":"number","minimum":0,"maximum":2}},"required":["provider","model"]},"stt":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"keyterms":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":100,"default":[]}},"required":["provider","model"]},"tts":{"type":"object","properties":{"provider":{"type":"string"},"voice_id":{"type":"string"},"model":{"type":"string"},"pace":{"type":"string","enum":["slow","medium","fast"],"default":"medium"}},"required":["provider","voice_id","model"]},"max_call_seconds":{"type":"integer","exclusiveMinimum":0,"description":"Ends the call after this many seconds; at most 3600."},"pronunciations":{"type":"array","items":{"$ref":"#/components/schemas/Pronunciation"},"maxItems":100,"default":[]},"disclosure":{"type":"string","maxLength":400,"default":"I'm an AI assistant, and calls may be recorded, transcribed and handled by our service providers.","description":"Said on every phone call right after the greeting's first sentence (Terms §4.2). It must say the call may be recorded and transcribed and that service providers handle it. It should also say the caller is talking to an AI assistant and can ask for a person or leave a message; leaving those out is allowed, but some places require them."},"languages":{"type":"string","enum":["en","en_es"],"default":"en","description":"`en`: English only. `en_es`: English and Spanish. The greeting stays in English and invites Spanish speakers to speak Spanish; a caller who does gets the rest of the call in Spanish. Summaries stay in English."},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"default":{}}},"required":["language","system_prompt","first_message","llm","stt","tts","max_call_seconds"]},"base_variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"base_languages":{"type":"string","enum":["en","en_es"]},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolRef"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"dev_fixtures":{"type":"object","additionalProperties":{}},"booking_calendars":{"$ref":"#/components/schemas/BookingCalendars"},"changelog":{"type":"string","maxLength":500}}}},"required":["source","changes"]}]},"AgentTestSettings":{"type":"object","properties":{"publish_check":{"type":"string","enum":["off","warn","block"],"description":"What Save & publish does with the check: `warn` (default) shows it and lets the owner publish; `block` refuses while a test got worse or fewer than `min_pass_rate` percent pass; `off` doesn't run them"},"min_pass_rate":{"type":"integer","minimum":0,"maximum":100,"description":"With `block`, the percent of tests that must pass on what goes live (default 80). The rule that no test may get worse applies as well."}},"required":["publish_check","min_pass_rate"]},"AgentTestSettingsUpdate":{"type":"object","properties":{"publish_check":{"type":"string","enum":["off","warn","block"]},"min_pass_rate":{"type":"integer","minimum":0,"maximum":100,"description":"With `block`, the percent of tests that must pass on what goes live (default 80). The rule that no test may get worse applies as well."}}},"Guardrail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"rule":{"type":"string"},"check":{"$ref":"#/components/schemas/GuardrailCheck"},"created_at":{"type":"string","format":"date-time"}},"required":["id","rule","check","created_at"]},"GuardrailCheck":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["phrases"]},"phrases":{"type":"array","items":{"type":"string","minLength":2,"maxLength":100},"minItems":1,"maxItems":20}},"required":["type","phrases"]},{"type":"object","properties":{"type":{"type":"string","enum":["detail"]},"value":{"type":"string","minLength":3,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["judge"]}},"required":["type"]}],"description":"`phrases`: the agent never says any of these (whole words, any case). `detail`: the agent never says this, like a private number (numbers match by their digits). `judge`: a judge reads each test call and decides; live calls aren't judged yet."},"GuardrailsUpdate":{"type":"object","properties":{"guardrails":{"type":"array","items":{"$ref":"#/components/schemas/GuardrailInput"},"maxItems":20}},"required":["guardrails"]},"GuardrailInput":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Keep an existing guardrail's id"},"rule":{"type":"string","minLength":3,"maxLength":300,"description":"The rule in the owner's words","example":"Never promise same-day"},"check":{"$ref":"#/components/schemas/GuardrailCheck"}},"required":["rule","check"]},"ChatWidget":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Public: it goes in the embed snippet"},"name":{"type":"string","description":"For you; visitors see `appearance.title`"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","name","deleted"],"description":"The agent that answers. Changing it keeps the same snippet. While `deleted`, the widget takes no chats until it's given another agent."},"enabled":{"type":"boolean"},"allowed_origins":{"type":"array","items":{"type":"string"},"description":"Websites allowed to show the widget, like https://example.com. `https://*.example.com` covers its subdomains."},"appearance":{"$ref":"#/components/schemas/ChatWidgetAppearance"},"conversations":{"type":"integer","description":"Chats through it this billing period"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","agent","enabled","allowed_origins","appearance","conversations","created_at","updated_at"]},"ChatWidgetAppearance":{"type":"object","properties":{"title":{"type":["string","null"],"maxLength":60,"description":"Header title. Defaults to the agent's name"},"subtitle":{"type":["string","null"],"maxLength":80},"greeting":{"type":["string","null"],"maxLength":500,"description":"First message. Defaults to the agent's greeting"},"accent":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$"},"position":{"type":["string","null"],"enum":["right","left",null]},"launcher_label":{"type":["string","null"],"maxLength":30,"description":"Text beside the launcher button. Null shows the icon only"}}},"CreateChatWidgetRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"agent_id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"allowed_origins":{"type":"array","items":{"type":"string","maxLength":300},"maxItems":20,"description":"Pasted URLs are trimmed to their origin"},"appearance":{"$ref":"#/components/schemas/ChatWidgetAppearance"}},"required":["name","agent_id"]},"UpdateChatWidgetRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"agent_id":{"type":"string","format":"uuid"},"enabled":{"type":"boolean"},"allowed_origins":{"type":"array","items":{"type":"string","maxLength":300},"maxItems":20,"description":"Pasted URLs are trimmed to their origin"},"appearance":{"allOf":[{"$ref":"#/components/schemas/ChatWidgetAppearance"},{"description":"Merged into the current look"}]}}},"WorkflowDraft":{"type":"object","properties":{"draft":{"type":"object","properties":{"version_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["graph"]},"graph":{"type":"object","additionalProperties":{}},"layout":{"type":"object","additionalProperties":{}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"greetings":{"$ref":"#/components/schemas/PendingGreetings"},"booking_calendars":{"allOf":[{"$ref":"#/components/schemas/BookingCalendars"},{"description":"A booking-calendar choice that goes live on the agent when this workflow is published"}]},"created_at":{"type":"string","format":"date-time"}},"required":["version_id","kind","graph","layout","fields","greetings","booking_calendars","created_at"]},"validation":{"$ref":"#/components/schemas/WorkflowValidation"}},"required":["draft","validation"]},"PendingGreetings":{"type":["object","null"],"properties":{"first_message":{"type":"string","minLength":1,"maxLength":1000},"first_message_known_caller":{"type":"string","maxLength":1000}},"description":"Greeting changes that go live on the agent when this workflow is published"},"WorkflowValidation":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowIssue"}}},"required":["valid","errors"]},"WorkflowIssue":{"type":"object","properties":{"node_id":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["node_id","code","message"]},"SaveWorkflowDraftRequest":{"type":"object","properties":{"graph":{"type":"object","additionalProperties":{},"description":"The workflow graph (see WorkflowGraph)"},"layout":{"type":"object","additionalProperties":{},"description":"Canvas data; never affects runtime"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"greetings":{"type":["object","null"],"properties":{"first_message":{"type":"string","minLength":1,"maxLength":1000},"first_message_known_caller":{"type":"string","maxLength":1000}},"description":"Greeting changes to apply to the agent on publish. Omit to keep the draft's; null clears them."},"booking_calendars":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["all"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["selected"]},"calendars":{"type":"array","items":{"$ref":"#/components/schemas/BookingCalendarRef"},"maxItems":10}},"required":["mode","calendars"]},{"type":"null"}],"description":"Which calendars the agent books into once this workflow is published. Omit to keep the draft's; null clears it. A newly chosen calendar must be connected when publishing (422 `calendar_not_connected`)."},"base_revisions":{"$ref":"#/components/schemas/AgentDraftRevisions"}},"required":["graph"]},"AgentDraftRevisions":{"type":"object","properties":{"prompt":{"type":"integer","minimum":0},"greetings":{"type":"integer","minimum":0},"disclosure":{"type":"integer","minimum":0},"languages":{"type":"integer","minimum":0},"voice":{"type":"integer","minimum":0},"pronunciations":{"type":"integer","minimum":0},"listen_for":{"type":"integer","minimum":0},"fields":{"type":"integer","minimum":0},"tools":{"type":"integer","minimum":0},"booking_calendars":{"type":"integer","minimum":0},"test_data":{"type":"integer","minimum":0},"workflow":{"type":"integer","minimum":0}},"description":"The section revisions as loaded (from GET /agents/{id}/draft). A section changed elsewhere since gets 409 `draft_conflict` (`details.sections`), and nothing is saved."},"ValidateWorkflowRequest":{"type":"object","properties":{"graph":{},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}}}},"PublishedWorkflow":{"type":"object","properties":{"graph":{"type":"object","additionalProperties":{}},"layout":{"type":"object","additionalProperties":{}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}}},"required":["graph","layout","fields"]},"WorkflowImportResult":{"allOf":[{"$ref":"#/components/schemas/WorkflowDraft"},{"type":"object","properties":{"needs_setup":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowNeedsSetup"}}},"required":["needs_setup"]}]},"WorkflowAssistResult":{"type":"object","properties":{"reply":{"type":"string"},"graph":{"type":["object","null"],"additionalProperties":{},"description":"A valid graph, or null when nothing changed"},"changes":{"type":"array","items":{"type":"string"}},"added_fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"greetings":{"allOf":[{"$ref":"#/components/schemas/PendingGreetings"},{"description":"Greetings the assistant changed (only the changed keys), or null"}]},"questions":{"type":"array","items":{"$ref":"#/components/schemas/AssistQuestion"},"description":"What the assistant needs answered before it can finish; usually empty"},"booking_hours":{"$ref":"#/components/schemas/BookingHoursProposal"},"test_causes":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["workflow","agent","setup","unknown"]},"cause":{"type":"string"},"tests":{"type":"array","items":{"type":"string"}},"change":{"type":["string","null"]},"setup":{"type":["string","null"]}},"required":["kind","cause","tests","change","setup"]},"description":"For a request with `tests`: the tests grouped by cause. Only `workflow` causes change the graph; `agent` and `setup` ones change nothing (`setup` names the step to take), and `unknown` ones the assistant couldn't explain."},"ai_credits":{"type":"object","properties":{"remaining":{"type":"number"},"limit":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["remaining","limit","per"],"description":"Build with AI messages left after this one"}},"required":["reply","graph","changes","added_fields","fields","greetings","questions","booking_hours","ai_credits"]},"AssistQuestion":{"type":"object","properties":{"id":{"type":"string","description":"Stable id within the answer, e.g. `hours`"},"label":{"type":"string","description":"Short topic for the answered summary, e.g. Hours"},"question":{"type":"string"},"kind":{"type":"string","enum":["choice","text","hours"],"description":"`choice`: pick an option or type another; `text`: free text; `hours`: opening hours"},"options":{"type":"array","items":{"type":"string"},"description":"Suggested answers (0-4)"},"default":{"type":["string","null"],"description":"The suggested answer, if any"},"setting":{"type":["string","null"],"description":"Business setting the answer is saved to, e.g. `business_hours`"}},"required":["id","label","question","kind","options","default","setting"]},"BookingHoursProposal":{"type":["object","null"],"properties":{"connection_id":{"type":"string","description":"The calendar connection to change"},"hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"mon":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"tue":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"wed":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"thu":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"fri":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"sat":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]}}},"text":{"type":"string","description":"The proposed hours, e.g. \"Mon–Fri 7am–6pm, …\""},"current_hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"mon":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"tue":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"wed":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"thu":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"fri":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"sat":{"type":["object","null"],"properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]}},"description":"The calendar's hours now, to put back on Undo"},"current_text":{"type":"string","description":"The calendar's hours now"}},"required":["connection_id","hours","text","current_hours","current_text"],"description":"Booking hours to offer the owner: they stated hours and the booking calendar is still on its default hours. Nothing is changed until they apply it with PATCH /integrations/calendars/{id}. Null otherwise."},"WorkflowAssistRequest":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","content"]},"minItems":1,"maxItems":40},"graph":{"type":"object","additionalProperties":{},"description":"The workflow on the canvas now"},"answers":{"type":"array","items":{"$ref":"#/components/schemas/AssistAnswer"},"minItems":1,"maxItems":3,"description":"Answers to the assistant's last questions"},"fixes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["prompt_restates_disclosure","collect_prompt_asks_for_details","prompt_repeats_guardrails","knowledge_prompt_has_prices","knowledge_ends_call","request_dropped","hours_gate_booking"]},"node_id":{"type":"string","minLength":1,"maxLength":100},"message":{"type":"string","maxLength":800,"default":""}},"required":["code","node_id"]},"minItems":1,"maxItems":30,"description":"Notes the editor flagged that the owner asked Build with AI to fix (Fix with AI): each note's code, its step and the note's text"}},"required":["messages"]},"AssistAnswer":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"label":{"type":"string","maxLength":30},"question":{"type":"string","minLength":1,"maxLength":200},"answer":{"type":["string","null"],"minLength":1,"maxLength":300,"description":"The owner's answer; null when they skipped it"},"setting":{"type":["string","null"],"description":"Business setting the answer is saved to"}},"required":["id","question","answer"]},"AssistRun":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"prompt":{"type":"string"},"hidden":{"type":"boolean","description":"A build from a script; leave it out of later messages"},"base_graph":{"type":["object","null"],"additionalProperties":{},"description":"The graph the run started from"},"status":{"type":"string","enum":["running","succeeded","failed"]},"result":{"allOf":[{"$ref":"#/components/schemas/WorkflowAssistResult"},{"type":["object","null"]}]},"answers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AssistAnswer"},"minItems":1,"maxItems":3,"description":"The answers this run was sent with, or null"},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"applied":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}},"required":["id","prompt","hidden","base_graph","status","result","answers","error","applied","created_at","finished_at"]},"StartAssistRunRequest":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"The owner's message, as the chat shows it"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","content"]},"minItems":1,"maxItems":40,"description":"The conversation to send; required unless script_id is set"},"script_id":{"type":"string","format":"uuid","description":"Build the flow from this script"},"instructions":{"type":"string","maxLength":1000},"graph":{"type":"object","additionalProperties":{},"description":"The workflow on the canvas now"},"answers":{"type":"array","items":{"$ref":"#/components/schemas/AssistAnswer"},"minItems":1,"maxItems":3,"description":"Answers to the last run's questions. Ones with a `setting` are saved to the agent's business settings."},"fixes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["prompt_restates_disclosure","collect_prompt_asks_for_details","prompt_repeats_guardrails","knowledge_prompt_has_prices","knowledge_ends_call","request_dropped","hours_gate_booking"]},"node_id":{"type":"string","minLength":1,"maxLength":100},"message":{"type":"string","maxLength":800,"default":""}},"required":["code","node_id"]},"minItems":1,"maxItems":30,"description":"Notes the editor flagged that the owner asked Build with AI to fix (Fix with AI): each note's code, its step and the note's text"},"tests":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"result_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["worse","failed","unclear"]},"expects":{"type":"string","maxLength":600,"default":""},"reason":{"type":"string","maxLength":600,"default":""},"transcript":{"type":"array","items":{"type":"string","maxLength":300},"maxItems":6,"default":[]}},"required":["name","status"]},"minItems":1,"maxItems":10},"left_out":{"type":"integer","minimum":0,"maximum":1000,"default":0}},"required":["items"],"description":"Agent tests that failed, got worse or were unclear, that the owner asked Build with AI to fix (Fix with AI on test results): got worse first, then failed, then unclear"}},"required":["prompt"]},"AgentAssistResponse":{"type":"object","properties":{"reply":{"type":"string"},"changes":{"type":"array","items":{"type":"string"}},"draft":{"$ref":"#/components/schemas/AgentAssistDraft"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/AssistQuestion"},"description":"What the assistant needs answered before it can finish; usually empty"},"ai_credits":{"type":"object","properties":{"remaining":{"type":"number"},"limit":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["remaining","limit","per"],"description":"Build with AI messages left after this one"}},"required":["reply","changes","draft","questions","ai_credits"]},"AgentAssistDraft":{"type":["object","null"],"properties":{"system_prompt":{"type":"string","maxLength":20000},"first_message":{"type":"string","maxLength":1000},"first_message_known_caller":{"type":"string","maxLength":1000,"default":""},"variables":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"}]},"default":{}},"fields":{"type":"array","items":{"type":"object","additionalProperties":{}},"maxItems":100,"default":[]},"pronunciations":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"say_as":{"type":"string"}},"required":["text","say_as"]},"maxItems":200,"default":[]},"booking_calendars":{"$ref":"#/components/schemas/BookingCalendars"}},"required":["system_prompt","first_message"],"description":"The whole draft after the change, or null when nothing changed"},"AgentAssistRequest":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","minLength":1,"maxLength":4000}},"required":["role","content"]},"minItems":1,"maxItems":40},"draft":{"allOf":[{"$ref":"#/components/schemas/AgentAssistDraft"},{"description":"The agent as it is in the editor now"}]},"answers":{"type":"array","items":{"$ref":"#/components/schemas/AssistAnswer"},"minItems":1,"maxItems":3,"description":"Answers to the assistant's last questions"}},"required":["messages","draft"]},"WorkflowVersionSummary":{"type":"object","properties":{"version_id":{"type":"string","format":"uuid"},"version_number":{"type":"integer"},"published_at":{"type":["string","null"],"format":"date-time"},"changelog":{"type":["string","null"]},"created_by":{"type":["string","null"],"format":"uuid","description":"The person who published it; null for an API key"},"live":{"type":"boolean","description":"The version the agent's calls use now"}},"required":["version_id","version_number","published_at","changelog","created_by","live"]},"WorkflowVersion":{"allOf":[{"$ref":"#/components/schemas/WorkflowVersionSummary"},{"type":"object","properties":{"workflow":{"type":"object","additionalProperties":{},"description":"What the version runs: its graph (or single prompt), fields, tools and calendar choice. Webhook header values are masked."},"layout":{"type":"object","additionalProperties":{},"description":"Canvas positions; never affects calls"}},"required":["workflow","layout"]}]},"WorkflowVersionDiff":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/WorkflowVersionSummary"},"to":{"$ref":"#/components/schemas/WorkflowVersionSummary"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"change":{"type":"string","enum":["added","removed","changed"]},"changes":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersionKeyChange"},"description":"The keys that changed on a changed step (prompt text among them)"},"before":{"type":["object","null"],"additionalProperties":{}},"after":{"type":["object","null"],"additionalProperties":{}}},"required":["id","name","type","change","changes","before","after"]},"description":"Steps added, removed or changed, in `to`'s order"},"flow":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersionKeyChange"},"description":"Changes to where the call starts and to the edges every step has"},"settings":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersionKeyChange"},"description":"Changes to the version's fields, tools and calendar choice"},"text_keys":{"type":"array","items":{"type":"string"},"description":"Step keys holding text the agent says or follows, to compare word by word"}},"required":["from","to","steps","flow","settings","text_keys"]},"WorkflowVersionKeyChange":{"type":"object","properties":{"key":{"type":"string"},"before":{},"after":{}},"required":["key"]},"AgentDraft":{"type":"object","properties":{"has_changes":{"type":"boolean"},"changed_sections":{"type":"array","items":{"$ref":"#/components/schemas/AgentDraftSection"},"description":"The sections that differ from what's live: the 'Unpublished changes'."},"revisions":{"allOf":[{"$ref":"#/components/schemas/AgentDraftRevisions"},{"description":"Each section's revision; it goes up each time that section changes."}]},"version_id":{"type":["string","null"],"format":"uuid","description":"Null when there's no draft."},"based_on_version":{"type":["integer","null"],"description":"The live version number."},"settings":{"type":"object","properties":{"system_prompt":{"type":"string","maxLength":100000},"first_message":{"type":"string","maxLength":1000},"first_message_known_caller":{"type":"string","maxLength":1000},"disclosure":{"type":"string","maxLength":5000},"languages":{"type":"string","enum":["en","en_es"]},"voice_id":{"type":"string","maxLength":200},"pace":{"type":"string","enum":["slow","medium","fast"]},"pronunciations":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":500},"say_as":{"type":"string","maxLength":500}},"required":["text","say_as"]},"maxItems":500},"keyterms":{"type":"array","items":{"type":"string","maxLength":160},"maxItems":200,"description":"Words speech-to-text listens for."}},"required":["system_prompt","first_message","first_message_known_caller","disclosure","languages","voice_id","pace","pronunciations","keyterms"],"additionalProperties":false},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolRef"}},"dev_fixtures":{"type":"object","additionalProperties":{}},"booking_calendars":{"$ref":"#/components/schemas/BookingCalendars"},"workflow":{"type":["object","null"],"properties":{"graph":{"type":"object","additionalProperties":{}},"layout":{"type":"object","additionalProperties":{}}},"required":["graph","layout"],"description":"Null for a single-prompt agent that has no graph."},"template_update":{"type":["object","null"],"properties":{"template_id":{"type":"string","format":"uuid"},"version":{"type":"integer"}},"required":["template_id","version"],"description":"A pushed template update waiting on the draft."},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowIssue"}},"settings":{"type":"array","items":{"type":"object","properties":{"section":{"$ref":"#/components/schemas/AgentDraftSection"},"message":{"type":"string"}},"required":["section","message"]}}},"required":["valid","errors","settings"]}},"required":["has_changes","changed_sections","revisions","version_id","based_on_version","settings","fields","tools","dev_fixtures","booking_calendars","workflow","template_update","validation"]},"AgentDraftSection":{"type":"string","enum":["prompt","greetings","disclosure","languages","voice","pronunciations","listen_for","fields","tools","booking_calendars","test_data","workflow"]},"PatchAgentDraftRequest":{"type":"object","properties":{"base_revisions":{"allOf":[{"$ref":"#/components/schemas/AgentDraftRevisions"},{"description":"The revisions as loaded. A section this request changes that was changed elsewhere since gets 409 `draft_conflict` (`details.sections`), and nothing is saved."}]},"settings":{"$ref":"#/components/schemas/AgentDraftSettings"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolRef"}},"dev_fixtures":{"type":"object","additionalProperties":{}},"booking_calendars":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["all"]}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","enum":["selected"]},"calendars":{"type":"array","items":{"$ref":"#/components/schemas/BookingCalendarRef"},"maxItems":10}},"required":["mode","calendars"]},{"type":"null"}],"description":"null clears the draft's choice. A newly chosen calendar must be connected when publishing (422 `calendar_not_connected`)."},"workflow":{"type":"object","properties":{"graph":{"type":"object","additionalProperties":{}},"layout":{"type":"object","additionalProperties":{},"default":{}}},"required":["graph"],"description":"The workflow graph, as PUT /workflow/draft saves it."}}},"AgentDraftSettings":{"type":"object","properties":{"system_prompt":{"type":"string","maxLength":100000},"first_message":{"type":"string","maxLength":1000},"first_message_known_caller":{"type":"string","maxLength":1000},"disclosure":{"type":"string","maxLength":5000},"languages":{"type":"string","enum":["en","en_es"]},"voice_id":{"type":"string","maxLength":200},"pace":{"type":"string","enum":["slow","medium","fast"]},"pronunciations":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":500},"say_as":{"type":"string","maxLength":500}},"required":["text","say_as"]},"maxItems":500},"keyterms":{"type":"array","items":{"type":"string","maxLength":160},"maxItems":200,"description":"Words speech-to-text listens for."}},"additionalProperties":false,"description":"Agent settings. Only the keys sent apply; a value equal to the live one takes that key off the draft."},"CodeRunResult":{"type":"object","properties":{"ok":{"type":"boolean"},"outputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"When ok: the declared outputs the code returned"},"ignored":{"type":"array","items":{"type":"string"},"description":"When ok: returned keys that aren't declared outputs"},"reason":{"type":"string","enum":["too_long","input_too_large","syntax","timeout","memory","error","not_object","too_large","bad_value","unavailable"]},"error":{"type":"string","description":"When not ok: what went wrong"},"ms":{"type":"integer"}},"required":["ok","ms"]},"TestCodeRequest":{"type":"object","properties":{"code":{"type":"string","maxLength":65536},"outputs":{"type":"array","items":{"type":"string","maxLength":64},"maxItems":20},"input":{"$ref":"#/components/schemas/CodeInput"}},"required":["code","outputs"]},"CodeInput":{"type":"object","properties":{"fields":{"type":"object","additionalProperties":{},"default":{},"description":"Details collected so far, by key"},"variables":{"type":"object","additionalProperties":{},"default":{},"description":"Business settings, plus values earlier code steps returned"},"caller":{"type":["object","null"],"properties":{"phone":{"type":["string","null"]},"name":{"type":["string","null"]},"first_name":{"type":["string","null"]},"email":{"type":["string","null"]}},"description":"The caller, when known"},"now":{"type":"string","format":"date-time","description":"Defaults to now"}},"default":{"fields":{},"variables":{}}},"AgentBuild":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","succeeded","failed"]},"stage":{"type":"string","enum":["learning","writing","building","done"]},"progress":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string"},"pages":{"type":"number"}},"required":["name","kind","status","pages"]}},"business_name":{"type":["string","null"]},"greeting":{"type":["string","null"]},"asks":{"type":"array","items":{"type":"string"}},"steps":{"type":"array","items":{"type":"string"}},"needs_setup":{"type":"boolean"},"needs_calendar":{"type":"boolean"},"try_saying":{"type":"array","items":{"type":"string"}}},"description":"What the build has done so far"},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}},"required":["id","agent_id","status","stage","progress","error","created_at","finished_at"]},"StartAgentBuildRequest":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":4000,"description":"The business, in the owner's words"}},"required":["description"]},"KnowledgeBase":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["empty","processing","ready","needs_attention"],"description":"empty: no sources; processing: a source is queued or indexing; needs_attention: a source failed or has pages that failed; else ready"},"source_count":{"type":"integer"},"document_count":{"type":"integer"},"chunk_count":{"type":"integer"},"char_count":{"type":"integer"},"token_estimate":{"type":"integer","description":"ceil(char_count / 4)"},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","description","status","source_count","document_count","chunk_count","char_count","token_estimate","agents","created_at","updated_at"]},"CreateKnowledgeBaseRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500}},"required":["name"]},"KnowledgeBaseDetail":{"allOf":[{"$ref":"#/components/schemas/KnowledgeBase"},{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeSource"}}},"required":["sources"]}]},"KnowledgeSource":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"knowledge_base_id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["text","qa","url","website","file"]},"name":{"type":"string"},"config":{"$ref":"#/components/schemas/KnowledgeSourceConfig"},"status":{"type":"string","enum":["queued","processing","ready","failed"]},"summary":{"type":"string","example":"12 pages indexed, 2 failed (403)"},"error":{"type":["string","null"]},"failures":{"type":"array","items":{"type":"object","properties":{"uri":{"type":"string"},"reason":{"type":"string"}},"required":["uri","reason"]}},"document_count":{"type":"integer"},"chunk_count":{"type":"integer"},"char_count":{"type":"integer"},"queued_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","knowledge_base_id","kind","name","config","status","summary","error","failures","document_count","chunk_count","char_count","queued_at","started_at","finished_at","created_at","updated_at"]},"KnowledgeSourceConfig":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["qa"]},"pairs":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string"},"answer":{"type":"string"}},"required":["question","answer"]}},"from_calls":{"type":"boolean","enum":[true],"description":"Collects answers suggested from calls (POST /knowledge-bases/{id}/answers)"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","enum":["url"]},"url":{"type":"string"}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","enum":["website"]},"url":{"type":"string"},"max_pages":{"type":"integer"},"include_paths":{"type":"array","items":{"type":"string"}},"exclude_paths":{"type":"array","items":{"type":"string"}}},"required":["kind","url","max_pages"]},{"type":"object","properties":{"kind":{"type":"string","enum":["file"]},"filename":{"type":"string"},"mime_type":{"type":"string"},"byte_size":{"type":"integer"}},"required":["kind","filename","mime_type","byte_size"]}],"description":"What the source ingests. Lists leave out `text` and `pairs`."},"UpdateKnowledgeBaseRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500}}},"CreateKnowledgeSourceRequest":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["text"]},"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":200000}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","enum":["qa"]},"name":{"type":"string","minLength":1,"maxLength":200},"pairs":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":4000},"answer":{"type":"string","minLength":1,"maxLength":4000}},"required":["question","answer"]},"minItems":1,"maxItems":500}},"required":["kind","pairs"]},{"type":"object","properties":{"kind":{"type":"string","enum":["url"]},"name":{"type":"string","minLength":1,"maxLength":200},"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","enum":["website"]},"name":{"type":"string","minLength":1,"maxLength":200},"url":{"type":"string","minLength":1,"maxLength":2048},"max_pages":{"type":"integer","minimum":1,"maximum":1000,"description":"Defaults to, and is capped at, the plan's pages per website"},"include_paths":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^\\/"},"maxItems":20},"exclude_paths":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^\\/"},"maxItems":20}},"required":["kind","url"]}]},"AddKnowledgeAnswerRequest":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":4000,"description":"What the caller asked or said, as the agent should recognize it"},"answer":{"type":"string","minLength":1,"maxLength":4000,"description":"What the agent should say or know when it comes up"}},"required":["question","answer"]},"UploadKnowledgeFileRequest":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"name":{"type":"string","minLength":1,"maxLength":200}}},"KnowledgeSourceDetail":{"allOf":[{"$ref":"#/components/schemas/KnowledgeSource"},{"type":"object","properties":{"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"uri":{"type":["string","null"]},"title":{"type":"string"},"char_count":{"type":"integer"},"token_count":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","uri","title","char_count","token_count","updated_at"]}}},"required":["documents"]}]},"UpdateKnowledgeSourceRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","maxLength":200000},"pairs":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":4000},"answer":{"type":"string","minLength":1,"maxLength":4000}},"required":["question","answer"]},"minItems":1,"maxItems":500},"max_pages":{"type":"integer","minimum":1,"maximum":1000},"include_paths":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^\\/"},"maxItems":20},"exclude_paths":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^\\/"},"maxItems":20}}},"KnowledgeDocument":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source_id":{"type":"string","format":"uuid"},"uri":{"type":["string","null"]},"title":{"type":"string"},"content":{"type":"string"},"char_count":{"type":"integer"},"token_count":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","source_id","uri","title","content","char_count","token_count","updated_at"]},"KnowledgeSearchResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeSearchResult"}},"mode":{"type":"string","enum":["all","any","none"]}},"required":["results","mode"]},"KnowledgeSearchResult":{"type":"object","properties":{"chunk_id":{"type":"string","format":"uuid"},"knowledge_base_id":{"type":"string","format":"uuid"},"source_id":{"type":"string","format":"uuid"},"document_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"heading_path":{"type":"array","items":{"type":"string"}},"uri":{"type":["string","null"]},"text":{"type":"string"},"score":{"type":"number"}},"required":["chunk_id","knowledge_base_id","source_id","document_id","title","heading_path","uri","text","score"]},"SearchKnowledgeBaseRequest":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":500},"limit":{"type":"integer","minimum":1,"maximum":10,"default":5}},"required":["query"]},"AgentKnowledgeBases":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"},"description":"Attached to the agent, in order"},"workflow_knowledge_bases":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"},"description":"Not attached, but named by a knowledge step of the agent's published workflow; calls use them too"},"token_estimate":{"type":"integer","description":"Across every knowledge base calls use: attached and workflow ones"},"inline":{"type":"boolean","description":"True when the agent's knowledge (attached and workflow) is small enough to be kept in context, as calls do"}},"required":["data","workflow_knowledge_bases","token_estimate","inline"]},"SetAgentKnowledgeBasesRequest":{"type":"object","properties":{"knowledge_base_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50}},"required":["knowledge_base_ids"]},"ScriptSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"original_filename":{"type":["string","null"],"description":"Null when pasted"},"status":{"type":"string","enum":["ready","failed"]},"error":{"type":["string","null"]},"char_count":{"type":"integer"},"line_count":{"type":"integer"},"verbatim_count":{"type":"integer"},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","original_filename","status","error","char_count","line_count","verbatim_count","agents","created_at","updated_at"]},"Script":{"allOf":[{"$ref":"#/components/schemas/ScriptSummary"},{"type":"object","properties":{"content":{"type":"string","description":"The script's text: Markdown headings, one line per line, `[say exactly]` marks"},"sections":{"type":"array","items":{"$ref":"#/components/schemas/ScriptSection"}}},"required":["content","sections"]}]},"ScriptSection":{"type":"object","properties":{"heading":{"type":["string","null"],"description":"Null before the first heading"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ScriptLine"}}},"required":["heading","lines"]},"ScriptLine":{"type":"object","properties":{"text":{"type":"string"},"verbatim":{"type":"boolean","description":"Say this line exactly as written"}},"required":["text","verbatim"]},"CreateScriptRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"content":{"type":"string","minLength":1,"maxLength":1000000,"description":"Up to 40,000 characters (422 `script_too_long`). `#` headings start sections; start a line with `[say exactly]` to have it said word for word."}},"required":["name","content"]},"UpdateScriptRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"content":{"type":"string","minLength":1,"maxLength":1000000,"description":"Re-parsed into sections"},"sections":{"type":"array","items":{"type":"object","properties":{"heading":{"type":["string","null"],"maxLength":200},"lines":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":4000},"verbatim":{"type":"boolean","default":false}},"required":["text"]},"maxItems":2000}},"required":["lines"]},"maxItems":500,"description":"Replaces the sections; the content is rebuilt from them"}}},"SetAgentScriptsRequest":{"type":"object","properties":{"script_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"description":"In the order the agent follows them; replaces the set"}},"required":["script_ids"]},"GenerateWorkflowFromScriptRequest":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"},"graph":{"type":"object","additionalProperties":{},"description":"The workflow on the canvas now"},"instructions":{"type":"string","maxLength":1000}},"required":["agent_id"]},"Member":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"name":{"type":["string","null"]},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"color":{"type":"string"}},"required":["id","name","color"]}},"last_active_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["user_id","email","name","role","teams","last_active_at","created_at"]},"Invitation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"status":{"type":"string","enum":["open","expired"]},"expires_at":{"type":"string","format":"date-time"},"invited_by":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","role","status","expires_at","invited_by","created_at"]},"Team":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"color":{"type":"string","enum":["gray","blue","green","amber","red","violet"]},"member_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"notified_by_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"on_call":{"$ref":"#/components/schemas/TeamOnCall"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","color","member_ids","notified_by_agents","on_call","created_at"]},"TeamOnCall":{"type":"object","properties":{"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"phone":{"type":"string"}},"required":["id","name","phone"]}},"ring_seconds":{"type":"integer"},"transcribe_transfers":{"type":"boolean"},"rotation":{"$ref":"#/components/schemas/OnCallRotation"},"next_handoff_at":{"type":["string","null"],"format":"date-time"}},"required":["people","ring_seconds","transcribe_transfers","rotation","next_handoff_at"]},"OnCallRotation":{"type":["object","null"],"properties":{"day":{"type":"string","enum":["sun","mon","tue","wed","thu","fri","sat"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string"}},"required":["day","time","timezone"]},"TeamOnCallInput":{"type":"object","properties":{"people":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"phone":{"type":"string"}},"required":["name","phone"]},"maxItems":10},"ring_seconds":{"type":"integer","minimum":10,"maximum":60},"transcribe_transfers":{"type":"boolean"},"rotation":{"$ref":"#/components/schemas/OnCallRotation"}},"required":["people"]},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"kind":{"type":"string","enum":["platform","agency","subaccount","direct"]},"parent":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"seats":{"type":"object","properties":{"limit":{"type":"integer"},"used":{"type":"integer"}},"required":["limit","used"]},"recognize_callers":{"type":"boolean","description":"Whether the agent gets a returning caller's name and recent calls from People. People fills in either way."},"caller_booking_changes":{"type":"boolean","description":"Whether callers can change or cancel their bookings on a call (on by default). Off, the agent takes a message for the team instead."},"text_back":{"type":"boolean","description":"Whether a caller who hung up before anything was done gets a text back (off by default). Sent from Ladoo's texting number, 8 AM to 8 PM in the call's time zone."},"text_back_message":{"type":["string","null"],"description":"The owner's own words for that text; null sends the default"},"follow_up_user_id":{"type":["string","null"],"format":"uuid","description":"The member put on each missed call to follow up, and emailed about it"},"brand":{"$ref":"#/components/schemas/Brand"},"viewer":{"type":"object","properties":{"role":{"type":["string","null"],"enum":["owner","admin","editor","viewer",null]},"access":{"type":"string","enum":["member","inherited","staff","api_key"]},"scopes":{"type":"array","items":{"type":"string"}}},"required":["role","access","scopes"],"description":"The caller's own access (scopes only, for API keys)"}},"required":["id","name","slug","kind","parent","seats","recognize_callers","caller_booking_changes","text_back","text_back_message","follow_up_user_id","brand","viewer"]},"Brand":{"type":["object","null"],"properties":{"name":{"type":"string"},"agency_slug":{"type":"string"},"accent":{"type":["string","null"]},"logo_square_url":{"type":["string","null"]},"logo_wide_url":{"type":["string","null"]},"website":{"type":["string","null"]},"support_email":{"type":["string","null"]},"show_powered_by":{"type":"boolean"}},"required":["name","agency_slug","accent","logo_square_url","logo_wide_url","website","support_email","show_powered_by"],"description":"The agency's white-label, for a client workspace of a branded agency"},"ClientWorkspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"archived_at":{"type":["string","null"],"format":"date-time"},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"cap":{"$ref":"#/components/schemas/ClientCap"},"billing":{"type":["object","null"],"properties":{"monthly_price_cents":{"type":"integer"},"included_minutes":{"type":"integer"},"overage_per_minute_centicents":{"type":"integer","description":"Price per minute past the included minutes, in hundredths of a cent"},"billing_email":{"type":"string"},"stripe_customer_id":{"type":"string"},"stripe_subscription_id":{"type":"string"},"stopped_at":{"type":["string","null"],"format":"date-time"}},"required":["monthly_price_cents","included_minutes","overage_per_minute_centicents","billing_email","stripe_customer_id","stripe_subscription_id","stopped_at"],"description":"What the agency bills this client through its own Stripe. Left out without `billing:read`."}},"required":["id","name","slug","archived_at","member_count","created_at","cap"]},"ClientCap":{"type":"object","properties":{"monthly_minutes":{"type":["integer","null"],"description":"Null: no cap"},"at_cap":{"type":"string","enum":["continue","forward"],"description":"At the cap, `continue` keeps answering and counts the overage; `forward` sends live calls to `fallback_number` without answering"},"fallback_number":{"type":["string","null"],"description":"E.164"}},"required":["monthly_minutes","at_cap","fallback_number"]},"CreatedClientWorkspace":{"allOf":[{"$ref":"#/components/schemas/ClientWorkspace"},{"type":"object","properties":{"from_template":{"$ref":"#/components/schemas/CreatedFromTemplate"}}}]},"ClientUsage":{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"rate_per_minute_centicents":{"type":"integer","description":"The agency plan's per-minute rate, in hundredths of a cent, used for `estimated_cost_cents`"},"data":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"minutes":{"type":"integer","description":"Billable call minutes"},"calls":{"type":"integer"},"booked":{"type":"integer","description":"Calls that booked an appointment"},"cap_minutes":{"type":["integer","null"]},"estimated_cost_cents":{"type":"integer"}},"required":["client_id","name","minutes","calls","booked","cap_minutes","estimated_cost_cents"]}}},"required":["period","rate_per_minute_centicents","data"]},"BrandSettings":{"type":"object","properties":{"name":{"type":["string","null"]},"accent":{"type":["string","null"]},"support_email":{"type":["string","null"]},"website":{"type":["string","null"]},"show_powered_by":{"type":"boolean"},"logo_square_url":{"type":["string","null"]},"logo_wide_url":{"type":["string","null"]},"mail_domain":{"type":["object","null"],"properties":{"domain":{"type":"string"},"status":{"type":"string","description":"Mail is sent from it only when `verified`"},"from_address":{"type":"string"},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"},"priority":{"type":["integer","null"]},"status":{"type":"string"}},"required":["type","name","value","priority","status"]}}},"required":["domain","status","from_address","records"]},"sign_in_url":{"type":"string","description":"A sign-in page with the agency's brand"},"applies":{"type":"boolean","description":"Whether clients see the brand now: it needs a name and the Agency plan"}},"required":["name","accent","support_email","website","show_powered_by","logo_square_url","logo_wide_url","mail_domain","sign_in_url","applies"]},"UpdateBrandRequest":{"type":"object","properties":{"name":{"type":["string","null"],"minLength":1,"maxLength":60},"accent":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$"},"support_email":{"type":["string","null"],"maxLength":200,"format":"email"},"website":{"type":["string","null"],"maxLength":200},"show_powered_by":{"type":"boolean"}}},"AgencyStripe":{"type":"object","properties":{"available":{"type":"boolean","description":"Whether this server can link Stripe at all"},"account":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The agency's Stripe account (acct_…)"},"name":{"type":["string","null"],"description":"The account's business name on Stripe, when it has one"},"livemode":{"type":"boolean"},"connected_at":{"type":"string","format":"date-time"}},"required":["id","name","livemode","connected_at"]}},"required":["available","account"]},"ClientBilling":{"type":"object","properties":{"monthly_price_cents":{"type":"integer"},"included_minutes":{"type":"integer"},"overage_per_minute_centicents":{"type":"integer","description":"Price per minute past the included minutes, in hundredths of a cent"},"billing_email":{"type":"string"},"stripe_customer_id":{"type":"string"},"stripe_subscription_id":{"type":"string"},"stopped_at":{"type":["string","null"],"format":"date-time"}},"required":["monthly_price_cents","included_minutes","overage_per_minute_centicents","billing_email","stripe_customer_id","stripe_subscription_id","stopped_at"]},"ClientBillingInput":{"type":"object","properties":{"monthly_price_cents":{"type":"integer","minimum":0,"maximum":10000000},"included_minutes":{"type":"integer","minimum":0,"maximum":1000000},"overage_per_minute_centicents":{"type":"integer","minimum":0,"maximum":1000000},"billing_email":{"type":"string","maxLength":254,"format":"email"}},"required":["monthly_price_cents","included_minutes","overage_per_minute_centicents","billing_email"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string","description":"Public part of the key, safe to show"},"scopes":{"type":"array","items":{"type":"string"}},"api_version":{"type":"string","description":"The API version (`Ladoo-Version`) the key's requests use unless they send one","example":"2026-11-16"},"expires_at":{"type":["string","null"],"format":"date-time"},"allowed_ips":{"type":"array","items":{"type":"string"}},"last_used_at":{"type":["string","null"],"format":"date-time"},"last_used_ip":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","prefix","scopes","api_version","expires_at","allowed_ips","last_used_at","last_used_ip","created_at"]},"NewApiKey":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"key":{"type":"string"}},"required":["key"]}]},"CreateApiKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"type":"array","items":{"type":"string","enum":["calls:read","agents:read","agents:write","test_sessions:write","voices:read","phone_numbers:read","phone_numbers:write","webhooks:read","webhooks:write","members:read","members:write","teams:read","teams:write","workspace:write","clients:read","clients:write","api_keys:read","api_keys:write","billing:read","billing:write","integrations:read","integrations:write","audit:read","people:read","people:write","knowledge:read","knowledge:write","bookings:read","bookings:write"]},"minItems":1,"description":"What the key may do; each must be a scope you have yourself"},"preset":{"type":"string","enum":["read_only","calls_people","full"],"description":"Instead of `scopes`: `read_only`, `calls_people` or `full`, cut down to the scopes you have. With neither, the key gets everything you have."},"expires_at":{"type":"string","format":"date-time","description":"After this, requests with the key fail with 401 key_expired"},"allowed_ips":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"IPs or CIDR ranges the key may be used from; empty for anywhere"}},"required":["name"]},"TestSession":{"type":"object","properties":{"livekit_url":{"type":"string"},"token":{"type":"string"},"room_name":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"max_seconds":{"type":"integer","description":"The session ends after this long"}},"required":["livekit_url","token","room_name","expires_at","max_seconds"]},"CreateTestSessionRequest":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"},"mode":{"type":"string","enum":["voice","text"]},"caller_number":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"channel":{"type":"string","enum":["phone","web_chat"],"default":"phone","description":"`web_chat` runs the agent the way the website chat widget does (text only)"},"greeted":{"type":"boolean","default":false,"description":"The client already showed the greeting, so the agent doesn't send it"},"greeting":{"type":"string","maxLength":500,"description":"With `greeted`: the greeting the client showed (a chat widget preview)"}},"required":["agent_id","mode"]},"Voice":{"type":"object","properties":{"id":{"type":"string","example":"cgSgspJ2msm6clMCkdW9"},"name":{"type":"string","example":"Jessica - Playful, Bright, Warm"},"category":{"type":["string","null"],"example":"premade"},"gender":{"type":["string","null"]},"accent":{"type":["string","null"]},"age":{"type":["string","null"]},"use_case":{"type":["string","null"]},"descriptive":{"type":["string","null"]},"language":{"type":["string","null"]},"description":{"type":["string","null"]},"preview_url":{"type":["string","null"],"description":"Public MP3 sample; no credentials needed to play it"}},"required":["id","name","category","gender","accent","age","use_case","descriptive","language","description","preview_url"]},"SpeechRequest":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":200,"example":"Thanks for calling Lah-doo."}},"required":["text"]},"CrmConnection":{"type":["object","null"],"properties":{"provider":{"type":"string","enum":["ghl"]},"status":{"type":"string","enum":["active","needs_reconnect","disconnected"]},"account_id":{"type":"string","description":"The LeadConnector account's id"},"account_name":{"type":["string","null"]},"timezone":{"type":["string","null"]},"settings":{"$ref":"#/components/schemas/CrmSettings"},"backfilled_at":{"type":["string","null"],"format":"date-time","description":"When the CRM's contacts finished importing; null while it runs."},"last_error":{"type":["string","null"]},"connected_at":{"type":"string","format":"date-time"},"booking_hours":{"type":["object","null"],"additionalProperties":{"type":["object","null"],"properties":{"timezone":{"type":"string"},"hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"mon":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"tue":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"wed":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"thu":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"fri":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]},"sat":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"]}},"required":["sun","mon","tue","wed","thu","fri","sat"]}},"required":["timezone","hours"]},"description":"Each CRM calendar's weekly hours by calendar id, as last read from the CRM: the booking hours of an agent that books only into the CRM. Null for a calendar with none (team and round-robin calendars use each member's hours); null overall until first read. Change them in the CRM."},"booking_hours_at":{"type":["string","null"],"format":"date-time","description":"When `booking_hours` were last read from the CRM."}},"required":["provider","status","account_id","account_name","timezone","settings","backfilled_at","last_error","connected_at","booking_hours","booking_hours_at"]},"CrmSettings":{"type":"object","properties":{"calendar_id":{"type":["string","null"],"minLength":1,"description":"Calendar the agent books into. Null turns booking off."},"pipeline_id":{"type":["string","null"],"minLength":1,"description":"Pipeline for opportunities. Null: calls create no opportunities."},"new_lead_stage_id":{"type":["string","null"],"minLength":1},"booked_stage_id":{"type":["string","null"],"minLength":1,"description":"Stage an opportunity moves to when the call books. Null: don't move it."},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20},"outcome_tags":{"type":"boolean","description":"Also tag contacts by outcome, such as `ladoo-booked`."}},"required":["calendar_id","pipeline_id","new_lead_stage_id","booked_stage_id","tags","outcome_tags"]},"CrmOptions":{"type":"object","properties":{"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"pipelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","name","stages"]}}},"required":["calendars","pipelines"]},"CrmPeopleImportPreview":{"type":"object","properties":{"ready":{"type":"boolean","description":"False while the CRM's contacts are still being read; counts are 0 until then."},"new_count":{"type":"integer","description":"People with no contact in your CRM."},"existing_count":{"type":"integer","description":"People your CRM already has (same phone or email) who aren't linked yet."},"excluded":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer"}},"required":["reason","count"]}},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"last_contact_at":{"type":"string","format":"date-time"}},"required":["id","name","phone","email","last_contact_at"]}},"import":{"$ref":"#/components/schemas/CrmPeopleImport"}},"required":["ready","new_count","existing_count","excluded","people","import"]},"CrmPeopleImport":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","done","failed"]},"include_notes":{"type":"boolean"},"counts":{"type":"object","properties":{"total":{"type":"integer"},"pending":{"type":"integer"},"added":{"type":"integer","description":"New contacts created in your CRM."},"matched":{"type":"integer","description":"People your CRM already had: linked, tagged and blank fields filled."},"skipped":{"type":"integer"},"failed":{"type":"integer"},"reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"integer"}},"required":["reason","count"]},"description":"Why people were skipped or failed, most common first."}},"required":["total","pending","added","matched","skipped","failed","reasons"]},"error":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}},"required":["id","status","include_notes","counts","error","created_at","finished_at"]},"CrmDisconnect":{"type":"object","properties":{"ghl_app":{"type":"string","enum":["uninstalled","already_uninstalled","shared","left_installed"],"description":"`uninstalled`: Ladoo removed its app from the sub-account. `already_uninstalled`: it was removed in your CRM already. `shared`: another Ladoo workspace uses the sub-account, so the app stays. `left_installed`: Ladoo couldn't remove it; uninstall it in your CRM."},"account_id":{"type":"string","description":"The LeadConnector account's id"},"contacts_deleted":{"type":"integer","description":"Contacts deleted from Ladoo's copy. Contacts in your CRM are kept."}},"required":["ghl_app","account_id","contacts_deleted"]},"IntegrationRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"integration":{"type":"string","enum":["google_calendar","outlook","jobber","housecall_pro","servicetitan","hubspot","zapier","texting","other"]},"other_name":{"type":["string","null"]},"details":{"type":["string","null"]},"contact_email":{"type":"string"},"plan":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","integration","other_name","details","contact_email","plan","created_at"]},"IntegrationRequestInput":{"type":"object","properties":{"integration":{"type":"string","enum":["google_calendar","outlook","jobber","housecall_pro","servicetitan","hubspot","zapier","texting","other"]},"other_name":{"type":["string","null"],"maxLength":100},"details":{"type":["string","null"],"maxLength":1000},"contact_email":{"type":"string","maxLength":254,"format":"email"}},"required":["integration","contact_email"]},"App":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"logo_url":{"type":["string","null"]},"category":{"type":"string","enum":["crm","calendars","field_service","messaging","payments","sheets_docs","email","other"]},"featured":{"type":"boolean"},"auth":{"type":"string","enum":["oauth","api_key","zapier"],"description":"`oauth`: one-click sign-in to the app. `api_key`: the owner pastes their API key for the app on the connect page. `zapier`: not connectable here yet; offer the Zapier fallback (connect answers 422 `not_connectable`)."},"connection":{"$ref":"#/components/schemas/AppConnectionSummary"}},"required":["slug","name","description","logo_url","category","featured","auth","connection"]},"AppConnectionSummary":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["initiated","active","failed","expired"]},"account_label":{"type":["string","null"]}},"required":["id","status","account_label"]},"AppConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"app":{"type":"string"},"app_name":{"type":"string"},"status":{"type":"string","enum":["initiated","active","failed","expired"]},"account_label":{"type":["string","null"]},"connected_by":{"type":["string","null"],"format":"uuid"},"connected_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","app","app_name","status","account_label","connected_by","connected_at","created_at"]},"AppDetail":{"allOf":[{"$ref":"#/components/schemas/App"},{"type":"object","properties":{"actions":{"type":"array","items":{"$ref":"#/components/schemas/AppAction"}}},"required":["actions"]}]},"AppAction":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"when":{"type":"string","enum":["during_call","after_call"],"description":"Guidance: fast enough to use while the caller waits, or best after the call."},"recommended":{"type":"boolean"}},"required":["slug","name","description","when","recommended"]},"AgentApp":{"type":"object","properties":{"app":{"type":"string"},"app_name":{"type":"string"},"connection_id":{"type":["string","null"],"format":"uuid"},"actions":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"when":{"type":"string","enum":["during_call","after_call"]}},"required":["slug","name","when"]}}},"required":["app","app_name","connection_id","actions"]},"CalendarConnection":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["google","microsoft","ics"],"description":"`ics` is a calendar link: a private iCal address, with bookings kept in Ladoo."},"status":{"type":"string","enum":["active","needs_reconnect","disconnected"]},"account_email":{"type":"string","description":"The signed-in account. For a calendar link, the calendar's name."},"settings":{"$ref":"#/components/schemas/BookingSettings"},"calendar_name":{"type":["string","null"],"description":"The name of `settings.calendar_id`, when known."},"books_here":{"type":"boolean","description":"Whether this calendar takes bookings (a calendar is chosen to book in). Each agent chooses which connected calendars it books into."},"last_error":{"type":["string","null"]},"connected_at":{"type":"string","format":"date-time"},"source_host":{"type":["string","null"],"description":"A calendar link's host. The address itself is a secret and isn't shown."},"feed":{"type":["object","null"],"properties":{"url":{"type":"string","format":"uri"},"webcal":{"type":"string"}},"required":["url","webcal"],"description":"A calendar link: the address to subscribe to for Ladoo's bookings, as https and webcal. Anyone with it can see the bookings."}},"required":["id","provider","status","account_email","settings","calendar_name","books_here","last_error","connected_at","source_host","feed"]},"BookingSettings":{"type":"object","properties":{"calendar_id":{"type":["string","null"],"minLength":1,"description":"Calendar the agent books into. Null turns booking off."},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"mon":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"tue":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"wed":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"thu":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"fri":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"sat":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."}},"required":["sun","mon","tue","wed","thu","fri","sat"]},"appointment_minutes":{"type":"integer","minimum":10,"maximum":480},"buffer_minutes":{"type":"integer","minimum":0,"maximum":240,"description":"Kept free before and after every appointment."},"max_days_ahead":{"type":"integer","minimum":1,"maximum":90,"description":"How far ahead callers can book, in days."},"min_notice_minutes":{"type":"integer","minimum":0,"maximum":10080,"description":"The soonest an appointment can start, in minutes from now."}},"required":["calendar_id","timezone","hours","appointment_minutes","buffer_minutes","max_days_ahead","min_notice_minutes"]},"BookingCalendarChoice":{"type":"object","properties":{"id":{"type":["string","null"],"format":"uuid","description":"The calendar connection's id; null for the CRM."},"provider":{"type":"string","enum":["ghl","google","microsoft","ics"]},"label":{"type":"string","example":"CRM"},"account":{"type":"string","description":"What an agent's choice names it by: the CRM account's id, the account's email, or a calendar link's name."},"account_name":{"type":["string","null"],"description":"Shown to people."},"status":{"type":"string","enum":["active","needs_reconnect"]},"calendar_id":{"type":["string","null"],"description":"The calendar agents set to all connected calendars book into. Null: set to not take bookings, so no agent books here."},"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The calendars an agent can choose here, live from the provider."},"error":{"type":["string","null"],"description":"Why the calendars couldn't be listed just now."}},"required":["id","provider","label","account","account_name","status","calendar_id","calendars","error"]},"CalendarBooking":{"type":"object","properties":{"id":{"type":"string"},"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"},"title":{"type":"string","description":"The caller's name and reason, as booked"},"caller_name":{"type":["string","null"],"description":"The name heard when booking. Kept as heard."},"person_name":{"type":["string","null"],"description":"The current People name of the caller whose call booked it, which the team or a spelled correction may have fixed since. Show this first, when there is one."},"caller_phone":{"type":["string","null"]},"call_id":{"type":["string","null"],"format":"uuid","description":"The call that booked it"},"agent_name":{"type":["string","null"],"description":"The agent that booked it"},"calendars":{"type":"array","items":{"type":"string"},"description":"Where it was booked, e.g. `CRM` or `Google Calendar`. Empty for calls from before this was recorded."},"reason":{"type":["string","null"]},"status":{"type":"string","enum":["booked","cancelled","cancel_failed","removed"],"description":"`cancel_failed`: cancelled, but still in at least one calendar (see `events`). `removed`: deleted in every calendar it was in, outside Ladoo."},"cancellable":{"type":"boolean","description":"Whether it can be cancelled (or the cancel retried) from Ladoo"},"events":{"type":"array","items":{"$ref":"#/components/schemas/CalendarBookingEvent"}},"cancelled_at":{"type":["string","null"],"format":"date-time"},"cancelled_by":{"type":["string","null"]},"summary":{"type":["string","null"],"description":"How a cancel went, in words"},"notices":{"type":"array","items":{"$ref":"#/components/schemas/BookingNotice"},"description":"What the caller was sent about it (a confirmation email), including ones skipped and why"}},"required":["id","start","end","title","caller_name","person_name","caller_phone","call_id","agent_name","calendars","reason","status","cancellable","events","cancelled_at","cancelled_by","summary","notices"]},"CalendarBookingEvent":{"type":"object","properties":{"label":{"type":"string","description":"The calendar, e.g. `Google Calendar`"},"provider":{"type":["string","null"],"enum":["ghl","google","microsoft","ics",null]},"state":{"type":"string","enum":["booked","removed","failed","gone"],"description":"`booked`: on the calendar. `removed`: Ladoo removed it. `failed`: removing it failed (`error` says why); cancelling again retries. `gone`: deleted in the calendar itself."},"error":{"type":["string","null"]}},"required":["label","provider","state","error"]},"BookingConfirmationSettings":{"type":"object","properties":{"email":{"type":"boolean","description":"Whether a caller who gave an email gets a confirmation, with a calendar invite, when an agent books them (off by default)"},"text":{"type":"boolean","description":"Whether the caller also gets a short confirmation text from Ladoo's texting number (off by default). US and Canadian numbers only; never to a number that replied STOP or a caller ID the carrier didn't verify."},"text_previews":{"type":"object","properties":{"en":{"type":"string"},"es":{"type":"string"}},"required":["en","es"],"description":"The text as it goes out, with a sample appointment"},"reminders":{"type":"boolean","description":"Whether callers also get a reminder before the appointment, on each channel they got the confirmation (off by default)"},"reminder_hours":{"type":"integer","description":"How many hours before the appointment the reminder goes (1 to 168)"},"caller_texts_available":{"type":"boolean","description":"Whether `text` can be turned on. False until carriers approve texts to callers."},"business_email":{"type":["string","null"],"description":"Where callers' replies go. Null: the workspace owner's email."},"reply_to":{"type":["string","null"],"description":"Where replies go now: `business_email`, else the owner's email"},"business_address":{"type":["string","null"],"description":"The {address} in the email and the invite's location; null leaves it out"},"templates":{"type":"object","properties":{"en":{"$ref":"#/components/schemas/BookingEmailTemplate"},"es":{"$ref":"#/components/schemas/BookingEmailTemplate"}},"required":["en","es"],"description":"The business's own words by language; null sends the default"},"defaults":{"type":"object","properties":{"en":{"$ref":"#/components/schemas/BookingEmailTemplate"},"es":{"$ref":"#/components/schemas/BookingEmailTemplate"}},"required":["en","es"]},"placeholders":{"type":"array","items":{"type":"string"}},"booking_changes":{"type":"boolean","description":"Callers can change or cancel their bookings (Settings > General): the email then has a link to call the business to do it"}},"required":["email","text","text_previews","reminders","reminder_hours","caller_texts_available","business_email","reply_to","business_address","templates","defaults","placeholders","booking_changes"]},"BookingEmailTemplate":{"type":["object","null"],"properties":{"subject":{"type":"string","maxLength":200},"body":{"type":"string","maxLength":5000}},"required":["subject","body"]},"PublicChatWidget":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"available":{"type":"boolean"},"unavailable_reason":{"type":["string","null"],"enum":["disabled","plan","limit","not_published",null]},"title":{"type":"string"},"subtitle":{"type":"string"},"greeting":{"type":"string"},"accent":{"type":"string"},"position":{"type":"string","enum":["right","left"]},"launcher_label":{"type":["string","null"]},"powered_by":{"type":"boolean","description":"Show \"Powered by Ladoo\". Off when the agency behind the workspace hides it"},"allowed_origins":{"type":"array","items":{"type":"string"}}},"required":["id","agent_id","available","unavailable_reason","title","subtitle","greeting","accent","position","launcher_label","powered_by","allowed_origins"]},"ChatSession":{"type":"object","properties":{"livekit_url":{"type":"string"},"token":{"type":"string"},"room_name":{"type":"string"},"max_seconds":{"type":"integer"}},"required":["livekit_url","token","room_name","max_seconds"]},"CreateChatSessionRequest":{"type":"object","properties":{"origin":{"type":"string","maxLength":300,"description":"The page embedding the widget"}},"required":["origin"]},"ServiceStatus":{"type":"object","properties":{"ok":{"type":["boolean","null"],"description":"Every component up; null before any check"},"updated_at":{"type":["string","null"],"description":"The newest check"},"components":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["api","dashboard","website","voice"]},"name":{"type":"string"},"ok":{"type":["boolean","null"]},"checked_at":{"type":["string","null"]},"latency":{"type":["string","null"],"enum":["fast","normal","slow",null]},"uptime":{"type":["number","null"],"description":"0–1 over the last 90 days"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"YYYY-MM-DD, UTC"},"uptime":{"type":["number","null"],"description":"0–1; null when nothing was recorded"},"incidents":{"type":"integer"}},"required":["date","uptime","incidents"]}}},"required":["id","name","ok","checked_at","latency","uptime","days"]}}},"required":["ok","updated_at","components"]},"EmailFix":{"type":"object","properties":{"status":{"type":"string","enum":["open","done"],"description":"`done`: the email was already fixed, so the link no longer does anything."},"business":{"type":"string"},"email_hint":{"type":"string","description":"The address the email went to, masked: `j•••@example.com`."}},"required":["status","business"]},"EmailFixAction":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["not_mine"]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","enum":["new_email"]},"email":{"type":"string","maxLength":320}},"required":["action","email"]}]}},"parameters":{}},"paths":{"/v1/me":{"get":{"tags":["Account"],"summary":"The signed-in person, the workspaces they can open and invitations waiting","security":[{"Session":[]}],"responses":{"200":{"description":"Me","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Account"],"summary":"Update your name or time zone","security":[{"Session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string"}}}}}},"responses":{"200":{"description":"Me","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me/workspaces/{id}":{"patch":{"tags":["Account"],"summary":"Your own settings in one workspace","description":"`daily_digest`: email me a summary of yesterday's calls around 7 AM my time. `call_texts`: text me after calls (needs a confirmed mobile number). `call_emails`: email me after calls.","security":[{"Session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"daily_digest":{"type":"boolean"},"call_texts":{"type":"string","enum":["off","all","urgent"]},"call_texts_on_call_only":{"type":"boolean"},"call_emails":{"type":"string","enum":["off","all","urgent"]}}}}}},"responses":{"200":{"description":"Me","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me/workspaces":{"post":{"tags":["Account"],"summary":"Start a new workspace, with you as its owner","description":"`direct` is a workspace for your own business. `agency` is one that manages client workspaces under it. You can own up to 3 (409 `workspace_limit`; an agency's client workspaces don't count), and start at most 5 a day (429). A new workspace on the Free plan shares your free test minutes and Build with AI messages with your other free workspaces.","security":[{"Session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["direct","agency"]}},"required":["name","kind"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid"}},"required":["workspace_id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me/invitations/{id}/accept":{"post":{"tags":["Account"],"summary":"Accept an invitation addressed to your email","security":[{"Session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Joined","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["workspace_id","role"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me/text-alerts/phone":{"post":{"tags":["Account"],"summary":"Text a one-time code to the mobile number for texts after calls","description":"US and Canadian numbers. Confirm it with the code to start getting texts.","security":[{"Session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":7,"maxLength":30}},"required":["phone"]}}}},"responses":{"202":{"description":"Code sent","content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string"}},"required":["phone"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Account"],"summary":"Stop all texts and forget the mobile number","security":[{"Session":[]}],"responses":{"204":{"description":"Removed"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me/text-alerts/phone/confirm":{"post":{"tags":["Account"],"summary":"Confirm the mobile number with the code it was texted","security":[{"Session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"200":{"description":"Confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string"}},"required":["phone"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me/call-links/{code}":{"get":{"tags":["Account"],"summary":"Where a link in a text after a call points","description":"The workspace and call behind a /c/<code> link, if you can open that workspace. `call_id` is null for a text that covered several calls.","security":[{"Session":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9]{8}$"},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Target","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid"},"call_id":{"type":["string","null"],"format":"uuid"}},"required":["workspace_id","call_id"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audit-events":{"get":{"tags":["Audit log"],"summary":"Who changed what in this workspace (and, for an agency, its clients)","description":"Newest first. Every change made through the API or the dashboard is here, with the person or API key that made it and their IP.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z_]+(\\.[a-z_]+)?$","description":"An action (`agent.updated`) or a kind of action (`agent`)"},"required":false,"description":"An action (`agent.updated`) or a kind of action (`agent`)","name":"action","in":"query"},{"schema":{"type":"string","pattern":"^(user|api_key):[0-9a-f-]{36}$","description":"`user:<id>` or `api_key:<id>`"},"required":false,"description":"`user:<id>` or `api_key:<id>`","name":"actor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only this client workspace"},"required":false,"description":"Only this client workspace","name":"workspace_id","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"`next_cursor` from the previous page"},"required":false,"description":"`next_cursor` from the previous page","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls":{"get":{"tags":["Calls"],"summary":"List calls, newest first","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Only calls that started at or after this time (inclusive)"},"required":false,"description":"Only calls that started at or after this time (inclusive)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only calls that started before this time (exclusive)"},"required":false,"description":"Only calls that started before this time (exclusive)","name":"to","in":"query"},{"schema":{"type":"string","enum":["booked","message_taken","urgent_escalated","transferred","spam","blocked","cap_reached","no_action","info_provided"]},"required":false,"name":"outcome","in":"query"},{"schema":{"type":"string","enum":["live","test"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","enum":["phone","web_chat"]},"required":false,"name":"channel","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only web chats that came through this chat widget"},"required":false,"description":"Only web chats that came through this chat widget","name":"widget_id","in":"query"},{"schema":{"type":"string","enum":["low","normal","high"]},"required":false,"name":"urgency","in":"query"},{"schema":{"type":"string","enum":["in_progress","completed"],"description":"Only calls still in progress, or only finished ones"},"required":false,"description":"Only calls still in progress, or only finished ones","name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"phone_number_id","in":"query"},{"schema":{"type":"string","description":"Only calls from this phone number (`from_number`), in any format: +15555550123, (555) 555-0123 and 555.555.0123 all match. Bare 10-digit numbers are read as North American."},"required":false,"description":"Only calls from this phone number (`from_number`), in any format: +15555550123, (555) 555-0123 and 555.555.0123 all match. Bare 10-digit numbers are read as North American.","name":"caller_phone","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only calls handled by this agent (any of its deployments)"},"required":false,"description":"Only calls handled by this agent (any of its deployments)","name":"agent_id","in":"query"},{"schema":{"type":"string","enum":["en","es"]},"required":false,"name":"language","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls the caller hung up right after the greeting (under 20 seconds, still on the first step), or only the rest"},"required":false,"description":"Only calls the caller hung up right after the greeting (under 20 seconds, still on the first step), or only the rest","name":"hung_up_early","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls that started outside (or inside) the hours of the calendar their agent books into. Calls of agents without set hours match neither."},"required":false,"description":"Only calls that started outside (or inside) the hours of the calendar their agent books into. Calls of agents without set hours match neither.","name":"after_hours","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Only calls with this reason (`extracted.reason`, ignoring case)"},"required":false,"description":"Only calls with this reason (`extracted.reason`, ignoring case)","name":"reason","in":"query"},{"schema":{"type":"string","enum":["booking","message","any"],"description":"Only calls the caller hung up partway through a booking, a message, or either (`any`)"},"required":false,"description":"Only calls the caller hung up partway through a booking, a message, or either (`any`)","name":"unfinished","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only each person's first conversation with the business, or only calls from people who'd been in touch before. Calls not linked to a person match neither."},"required":false,"description":"Only each person's first conversation with the business, or only calls from people who'd been in touch before. Calls not linked to a person match neither.","name":"first_call","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls the post-call review flagged a line in, or only the rest"},"required":false,"description":"Only calls the post-call review flagged a line in, or only the rest","name":"flagged","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls where the booking calendar or CRM couldn't be reached, or only the rest"},"required":false,"description":"Only calls where the booking calendar or CRM couldn't be reached, or only the rest","name":"calendar_error","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":6,"description":"Only calls that started on this weekday (0 Sunday to 6 Saturday) in `time_zone`"},"required":false,"description":"Only calls that started on this weekday (0 Sunday to 6 Saturday) in `time_zone`","name":"weekday","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":23,"description":"Only calls that started in this hour of the day (0 to 23) in `time_zone`"},"required":false,"description":"Only calls that started in this hour of the day (0 to 23) in `time_zone`","name":"hour","in":"query"},{"schema":{"type":"string","default":"UTC","description":"IANA zone `weekday` and `hour` are read in"},"required":false,"description":"IANA zone `weekday` and `hour` are read in","name":"time_zone","in":"query"},{"schema":{"type":"string","enum":["true"],"description":"Only calls from people with more than one call among those the other filters pick by date, kind, channel, agent and number (the Analytics page's callers who called more than once)"},"required":false,"description":"Only calls from people with more than one call among those the other filters pick by date, kind, channel, agent and number (the Analytics page's callers who called more than once)","name":"repeat_caller","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"workflow_version_id","in":"query"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"Only calls that entered this workflow step"},"required":false,"description":"Only calls that entered this workflow step","name":"step","in":"query"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"Only calls that ended on this workflow step"},"required":false,"description":"Only calls that ended on this workflow step","name":"last_step","in":"query"},{"schema":{"type":"string","enum":["passed","failed","unclear"],"description":"Only calls judged this way against their agent's success criteria"},"required":false,"description":"Only calls judged this way against their agent's success criteria","name":"success","in":"query"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"With `analysis_value`, only calls whose analysis field has that value (`analysis`, compared as text, ignoring case: `true`, `2500`, `hot`). Alone, only calls where the field has a value."},"required":false,"description":"With `analysis_value`, only calls whose analysis field has that value (`analysis`, compared as text, ignoring case: `true`, `2500`, `hot`). Alone, only calls where the field has a value.","name":"analysis_field","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"The value `analysis_field` must have"},"required":false,"description":"The value `analysis_field` must have","name":"analysis_value","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"`next_cursor` from the previous page"},"required":false,"description":"`next_cursor` from the previous page","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of calls. Transcripts and tool calls are only on the detail endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallListItem"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/export":{"get":{"tags":["Calls"],"summary":"Calls as CSV","description":"The calls the list's filters pick, newest first, up to 10,000: one row per call with its summary, outcome and the caller's details, then a column per analysis field (`analysis.<name>`).","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Only calls that started at or after this time (inclusive)"},"required":false,"description":"Only calls that started at or after this time (inclusive)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only calls that started before this time (exclusive)"},"required":false,"description":"Only calls that started before this time (exclusive)","name":"to","in":"query"},{"schema":{"type":"string","enum":["booked","message_taken","urgent_escalated","transferred","spam","blocked","cap_reached","no_action","info_provided"]},"required":false,"name":"outcome","in":"query"},{"schema":{"type":"string","enum":["live","test"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","enum":["phone","web_chat"]},"required":false,"name":"channel","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only web chats that came through this chat widget"},"required":false,"description":"Only web chats that came through this chat widget","name":"widget_id","in":"query"},{"schema":{"type":"string","enum":["low","normal","high"]},"required":false,"name":"urgency","in":"query"},{"schema":{"type":"string","enum":["in_progress","completed"],"description":"Only calls still in progress, or only finished ones"},"required":false,"description":"Only calls still in progress, or only finished ones","name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"phone_number_id","in":"query"},{"schema":{"type":"string","description":"Only calls from this phone number (`from_number`), in any format: +15555550123, (555) 555-0123 and 555.555.0123 all match. Bare 10-digit numbers are read as North American."},"required":false,"description":"Only calls from this phone number (`from_number`), in any format: +15555550123, (555) 555-0123 and 555.555.0123 all match. Bare 10-digit numbers are read as North American.","name":"caller_phone","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only calls handled by this agent (any of its deployments)"},"required":false,"description":"Only calls handled by this agent (any of its deployments)","name":"agent_id","in":"query"},{"schema":{"type":"string","enum":["en","es"]},"required":false,"name":"language","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls the caller hung up right after the greeting (under 20 seconds, still on the first step), or only the rest"},"required":false,"description":"Only calls the caller hung up right after the greeting (under 20 seconds, still on the first step), or only the rest","name":"hung_up_early","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls that started outside (or inside) the hours of the calendar their agent books into. Calls of agents without set hours match neither."},"required":false,"description":"Only calls that started outside (or inside) the hours of the calendar their agent books into. Calls of agents without set hours match neither.","name":"after_hours","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"Only calls with this reason (`extracted.reason`, ignoring case)"},"required":false,"description":"Only calls with this reason (`extracted.reason`, ignoring case)","name":"reason","in":"query"},{"schema":{"type":"string","enum":["booking","message","any"],"description":"Only calls the caller hung up partway through a booking, a message, or either (`any`)"},"required":false,"description":"Only calls the caller hung up partway through a booking, a message, or either (`any`)","name":"unfinished","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only each person's first conversation with the business, or only calls from people who'd been in touch before. Calls not linked to a person match neither."},"required":false,"description":"Only each person's first conversation with the business, or only calls from people who'd been in touch before. Calls not linked to a person match neither.","name":"first_call","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls the post-call review flagged a line in, or only the rest"},"required":false,"description":"Only calls the post-call review flagged a line in, or only the rest","name":"flagged","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only calls where the booking calendar or CRM couldn't be reached, or only the rest"},"required":false,"description":"Only calls where the booking calendar or CRM couldn't be reached, or only the rest","name":"calendar_error","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":6,"description":"Only calls that started on this weekday (0 Sunday to 6 Saturday) in `time_zone`"},"required":false,"description":"Only calls that started on this weekday (0 Sunday to 6 Saturday) in `time_zone`","name":"weekday","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":23,"description":"Only calls that started in this hour of the day (0 to 23) in `time_zone`"},"required":false,"description":"Only calls that started in this hour of the day (0 to 23) in `time_zone`","name":"hour","in":"query"},{"schema":{"type":"string","default":"UTC","description":"IANA zone `weekday` and `hour` are read in"},"required":false,"description":"IANA zone `weekday` and `hour` are read in","name":"time_zone","in":"query"},{"schema":{"type":"string","enum":["true"],"description":"Only calls from people with more than one call among those the other filters pick by date, kind, channel, agent and number (the Analytics page's callers who called more than once)"},"required":false,"description":"Only calls from people with more than one call among those the other filters pick by date, kind, channel, agent and number (the Analytics page's callers who called more than once)","name":"repeat_caller","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"workflow_version_id","in":"query"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"Only calls that entered this workflow step"},"required":false,"description":"Only calls that entered this workflow step","name":"step","in":"query"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"Only calls that ended on this workflow step"},"required":false,"description":"Only calls that ended on this workflow step","name":"last_step","in":"query"},{"schema":{"type":"string","enum":["passed","failed","unclear"],"description":"Only calls judged this way against their agent's success criteria"},"required":false,"description":"Only calls judged this way against their agent's success criteria","name":"success","in":"query"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"With `analysis_value`, only calls whose analysis field has that value (`analysis`, compared as text, ignoring case: `true`, `2500`, `hot`). Alone, only calls where the field has a value."},"required":false,"description":"With `analysis_value`, only calls whose analysis field has that value (`analysis`, compared as text, ignoring case: `true`, `2500`, `hot`). Alone, only calls where the field has a value.","name":"analysis_field","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500,"description":"The value `analysis_field` must have"},"required":false,"description":"The value `analysis_field` must have","name":"analysis_value","in":"query"}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}":{"get":{"tags":["Calls"],"summary":"Get a call with its transcript","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/analytics/calls":{"get":{"tags":["Calls"],"summary":"Call analytics for a date range","description":"Live phone calls only. With `clients=true` (an agency's owners and admins, who can see inside its clients), every client workspace together instead of this one, without call reasons; agent and number filters are per workspace then.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Start (inclusive)"},"required":true,"description":"Start (inclusive)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"End (exclusive)"},"required":true,"description":"End (exclusive)","name":"to","in":"query"},{"schema":{"type":"string","default":"UTC","description":"IANA zone the days in `daily` are counted in"},"required":false,"description":"IANA zone the days in `daily` are counted in","name":"time_zone","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"agent_id","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"phone_number_id","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"clients","in":"query"}],"responses":{"200":{"description":"Call analytics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallAnalytics"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/blocked-callers":{"get":{"tags":["Blocked callers"],"summary":"List blocked callers, newest first","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Blocked callers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BlockedCaller"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Blocked callers"],"summary":"Block a caller","description":"Calls from this number are hung up before the agent answers, recorded with outcome `blocked`, and not billed. Applies to this workspace only.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedCallerInput"}}}},"responses":{"201":{"description":"Blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedCaller"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/blocked-callers/settings":{"get":{"tags":["Blocked callers"],"summary":"Whether calls with no caller ID are blocked","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedCallerSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Blocked callers"],"summary":"Block or allow calls with no caller ID","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedCallerSettings"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedCallerSettings"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/blocked-callers/{id}":{"delete":{"tags":["Blocked callers"],"summary":"Unblock a caller","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Unblocked"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attention":{"get":{"tags":["Workspace"],"summary":"Things that need attention","description":"Broken connections in this workspace and, for an agency, its client workspaces: red first. Each clears itself once the fix works.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Open issues","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AttentionIssue"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/people":{"get":{"tags":["People"],"summary":"List people, most recently in touch first","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Name, phone or email"},"required":false,"description":"Name, phone or email","name":"q","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"phone_number_id","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"widget_id","in":"query"},{"schema":{"type":"string","enum":["true"],"description":"Only people flagged as a possible match"},"required":false,"description":"Only people flagged as a possible match","name":"possible_match","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"`next_cursor` from the previous page"},"required":false,"description":"`next_cursor` from the previous page","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of people","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Person"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["People"],"summary":"Add a person","description":"Needs a phone number or an email. A person with a phone number is found by it like someone who called: a later call from that number joins their history, and the agent knows their name when the workspace recognizes returning callers. Only one person can have a number that way, so a number someone already has is refused (409 `phone_taken`, with their id). The name counts as the team's: later calls don't overwrite it. First and last contact start at the time the person was added.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonCreate"}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/people/{id}":{"get":{"tags":["People"],"summary":"A person, their conversations and possible matches","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The person","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["People"],"summary":"Edit a person's name, phone, email or notes","description":"An edited name is kept: later conversations don't overwrite it.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonUpdate"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["People"],"summary":"Delete a person and all their conversations","description":"Transcripts and summaries go too. Appointments they booked stay on the calendar without their name, number or reason. It can't be undone.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"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 credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Webhook endpoints","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"A workspace can have up to 100 endpoints; one more is refused with `409 endpoint_limit`. Automation apps like Zapier create one per Zap and delete it when the Zap is turned off.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"An https address"},"description":{"type":["string","null"],"maxLength":500},"events":{"type":"array","items":{"type":"string","enum":["call.started","call.completed","call.analyzed","call.flagged_urgent","call.transferred","message.taken","booking.created","booking.rescheduled","booking.cancelled","person.created","person.updated","knowledge.source_failed","number.purchased","number.released"]},"minItems":1},"enabled":{"type":"boolean"}},"required":["url","events"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook endpoint","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Webhooks"],"summary":"Update a webhook endpoint","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"An https address"},"description":{"type":["string","null"],"maxLength":500},"events":{"type":"array","items":{"type":"string","enum":["call.started","call.completed","call.analyzed","call.flagged_urgent","call.transferred","message.taken","booking.created","booking.rescheduled","booking.cancelled","person.created","person.updated","knowledge.source_failed","number.purchased","number.released"]},"minItems":1},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint and its pending deliveries","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"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 credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-event-types":{"get":{"tags":["Webhooks"],"summary":"List the event types an endpoint can subscribe to","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Event types, in display order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["call.started","call.completed","call.analyzed","call.flagged_urgent","call.transferred","message.taken","booking.created","booking.rescheduled","booking.cancelled","person.created","person.updated","knowledge.source_failed","number.purchased","number.released"]},"description":{"type":"string"}},"required":["type","description"]}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List an endpoint's recent deliveries, newest first","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Deliveries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event with sample data","description":"Queues a signed delivery of sample data, sent like any other event (and even while the endpoint is paused). Up to 5 a minute per endpoint.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["call.started","call.completed","call.analyzed","call.flagged_urgent","call.transferred","message.taken","booking.created","booking.rescheduled","booking.cancelled","person.created","person.updated","knowledge.source_failed","number.purchased","number.released"],"description":"Event type to sample. Defaults to the endpoint's first event."}}}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-deliveries/{id}/redeliver":{"post":{"tags":["Webhooks"],"summary":"Send a delivered or failed delivery again","description":"Sends the same event (same id) again now, with a fresh set of retries.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-endpoints/{id}/rotate-secret":{"post":{"tags":["Webhooks"],"summary":"Rotate the signing secret","description":"Returns a new secret, shown only once. For the next 24 hours deliveries are signed with both the new and the old secret (two `v1` values), so receivers can switch over. Rotating again within those 24 hours replaces the new secret and keeps the old one.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Rotated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers":{"get":{"tags":["Phone numbers"],"summary":"List phone numbers","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Phone numbers the workspace holds (released ones are left out)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumber"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Phone numbers"],"summary":"Buy a phone number","description":"Buys the number, routes it to Ladoo and (optionally) to an agent. Needs a paid plan; the number's monthly price is added to the plan's bill.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyPhoneNumberRequest"}}}},"responses":{"201":{"description":"Bought and live","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/available":{"get":{"tags":["Phone numbers"],"summary":"Search numbers you can buy","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["local","toll_free"],"default":"local"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","pattern":"^[2-9]\\d{2}$"},"required":false,"name":"area_code","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":60},"required":false,"name":"locality","in":"query"},{"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"},"required":false,"name":"region","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":30,"default":12},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Numbers available right now","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AvailablePhoneNumber"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}/agent":{"put":{"tags":["Phone numbers"],"summary":"Choose the agent that answers a number","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignPhoneNumberRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumber"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/phone-numbers/{id}":{"delete":{"tags":["Phone numbers"],"summary":"Release a phone number","description":"Stops calls to the number and gives it back. Billing for it stops from the next month.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Released"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing":{"get":{"tags":["Billing"],"summary":"Plan, usage and limits","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Billing state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/checkout":{"post":{"tags":["Billing"],"summary":"Start or change a plan","description":"Without a paid plan this returns a checkout URL. With one, it switches plans (prorated) and returns `url: null`.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"Checkout or plan change","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":["string","null"]}},"required":["url"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/cancel":{"post":{"tags":["Billing"],"summary":"Cancel the plan at the end of the billing period","security":[{"ApiKey":[]}],"responses":{"204":{"description":"Will cancel at period end"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/resume":{"post":{"tags":["Billing"],"summary":"Keep a plan that was set to cancel","security":[{"ApiKey":[]}],"responses":{"204":{"description":"Resumed"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/portal":{"post":{"tags":["Billing"],"summary":"Link to manage the payment method and invoices","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Portal link","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":["string","null"]}},"required":["url"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents":{"post":{"tags":["Agents"],"summary":"Create an agent","description":"Creates the agent with a published workflow, optionally started from a template. It can be tested in the browser right away; give it a phone number to take real calls.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"201":{"description":"The new agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Agents"],"summary":"List agents","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Agents owned by the tenant","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}":{"get":{"tags":["Agents"],"summary":"Get an agent with its deployed workflow, versions and numbers","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agents"],"summary":"Rename an agent","description":"The name is a label in the dashboard; callers hear the persona's name. Takes effect immediately and isn't part of the versioned config.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameAgentRequest"}}}},"responses":{"200":{"description":"Renamed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"summary":"Delete an agent","description":"Its numbers stop answering for it straight away (they stay in the workspace, free to give to another agent), and it's detached from knowledge bases and scripts. Past calls keep their transcripts and still show the agent's name. Can't be undone from the dashboard.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/publish":{"post":{"tags":["Agents"],"summary":"Save edits and publish a new immutable version to the agent's deployments","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishAgentRequest"}}}},"responses":{"201":{"description":"Published; returns the updated agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/notifications":{"put":{"tags":["Agents"],"summary":"Choose the team alerted about this agent's urgent calls","description":"Takes effect immediately; not part of the versioned agent config.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentNotifications"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentNotifications"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/success-criteria":{"put":{"tags":["Agents"],"summary":"Set the rules each of this agent's calls is judged against","description":"Takes effect from the next call; calls already judged keep the criteria they were judged on. Not part of the versioned agent config.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSuccessCriteria"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSuccessCriteria"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/analysis-fields":{"put":{"tags":["Agents"],"summary":"Set the fields read from each of this agent's calls","description":"Takes effect from the next call; calls already analyzed keep what was read then. Not part of the versioned agent config.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnalysisFields"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnalysisFields"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/variables":{"patch":{"tags":["Agents"],"summary":"Change some of the agent's business settings (variables)","description":"Sets these variables, removes the keys in `remove`, and keeps the rest. Like the settings Build with AI saves, they're facts about the business: the next call uses them, without publishing a new version. They aren't part of the agent's draft.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVariablesUpdate"}}}},"responses":{"200":{"description":"Saved; returns all of the agent's variables","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVariables"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates":{"get":{"tags":["Agent templates"],"summary":"List agent templates","description":"In an agency workspace, its templates. In a client workspace, its agency's templates, to start agents from.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplate"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agent templates"],"summary":"Save one of the agency's agents as a template","description":"Saves the agent's prompt, greetings, voice, call settings, published workflow (with its tools and fields) and success criteria as version 1. Webhook header values, transfer numbers, knowledge bases, CRM fields and business settings' values are left out; each client sets its own. Only agents in the agency workspace itself can be saved.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500,"default":""}},"required":["agent_id","name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplateDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates/{id}":{"get":{"tags":["Agent templates"],"summary":"Get a template, with its versions and latest content","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplateDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agent templates"],"summary":"Rename a template or change its description","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplate"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agent templates"],"summary":"Delete a template","description":"Agents started from it keep working and keep their settings.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"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 credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates/{id}/versions":{"post":{"tags":["Agent templates"],"summary":"Save a new version of a template","description":"Saves the agent (by default the one the template was last saved from) as the next version. Agents started from earlier versions don't change until a push.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"},"changelog":{"type":"string","maxLength":500}}}}}},"responses":{"201":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplateDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates/{id}/versions/{v}":{"get":{"tags":["Agent templates"],"summary":"Get one version of a template","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"The version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplateVersion"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates/{id}/versions/{a}/diff/{b}":{"get":{"tags":["Agent templates"],"summary":"Compare two versions of a template","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"a","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"b","in":"path"}],"responses":{"200":{"description":"What changed from `a` to `b`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplateDiff"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates/{id}/agents":{"post":{"tags":["Agent templates"],"summary":"Start an agent from a template","description":"In a client workspace, creates the agent there. From the agency, set `client_id` (and the key needs `clients:write`). The agent gets the template's settings and the client's business settings; its workflow is published only when nothing needs setting up, otherwise it waits as a draft and `needs_setup` lists what's missing.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateFromTemplate"},{"type":"object","properties":{"client_id":{"type":"string","format":"uuid","description":"From the agency: the client workspace to create the agent in"}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedFromTemplate"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Agent templates"],"summary":"Client agents started from a template","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Linked agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"},"agent_name":{"type":"string"},"client_id":{"type":"string","format":"uuid"},"client_name":{"type":"string"},"template_version":{"type":["integer","null"]}},"required":["agent_id","agent_name","client_id","client_name","template_version"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-templates/{id}/push":{"post":{"tags":["Agent templates"],"summary":"Push a template version to client agents as drafts","description":"Opens a draft of the version (by default the latest) in each linked client agent, or the ones in `agent_ids`, and returns what it would change. Nothing is published: someone publishes each draft in its workspace. An agent with unpublished changes of its own is skipped; a draft from an earlier push is replaced.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1},"agent_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":500}}}}}},"responses":{"200":{"description":"What happened in each agent","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"},"agent_name":{"type":"string"},"client_id":{"type":"string","format":"uuid"},"client_name":{"type":"string"},"status":{"type":"string","enum":["drafted","skipped"]},"reason":{"type":["string","null"]},"diff":{"allOf":[{"$ref":"#/components/schemas/AgentTemplateDiff"},{"type":["object","null"]}]},"needs_setup":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateSetupItem"},"description":"What the client still sets up before publishing the draft"}},"required":["agent_id","agent_name","client_id","client_name","status","reason","diff","needs_setup"]}}},"required":["version","results"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/pre-call-webhook":{"put":{"tags":["Agents"],"summary":"Set or turn off the agent's pre-call webhook","description":"When a call rings, Ladoo POSTs `{call_id, agent_id, kind, from, to, person}` to this URL and waits up to 1 second for `{variables, caller, note_for_agent, route}`. A slow, failing or unreadable reply leaves the call as usual. The first URL creates a signing secret, returned once; changing the URL keeps it. Needs `webhooks:write` as well, like a webhook endpoint, since it sends callers' details out.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreCallWebhookUpdate"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreCallWebhookSaved"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/pre-call-webhook/rotate-secret":{"post":{"tags":["Agents"],"summary":"Rotate the pre-call webhook's signing secret","description":"Returns the new secret, shown only once. The old one stops signing at once.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Rotated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreCallWebhookSaved"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tools":{"get":{"tags":["Agents"],"summary":"List the agent's custom tools","description":"HTTP actions the agent may call on any step. Header values are masked. Tools aren't part of the versioned config: rolling back a version doesn't change them.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The agent's tools","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentToolList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agents"],"summary":"Add a custom tool to the agent","description":"The next call can use it. At most 20 per agent. It sends callers' details out, like a webhook endpoint, so it also needs `webhooks:write`. 409 `tool_name_taken` or `too_many_tools`.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentTool"}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTool"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tools/{tool_id}":{"patch":{"tags":["Agents"],"summary":"Change a custom tool","description":"Changes only what's sent. A header value of `••••••••` keeps the saved one, unless the URL changed: then every header value must be sent again.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"tool_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentTool"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTool"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"summary":"Delete a custom tool","description":"Steps that named it go on without it.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"tool_id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/mcp-servers":{"get":{"tags":["Agents"],"summary":"List the agent's MCP servers","description":"Remote MCP servers whose picked tools the agent may call on any step. Header values are masked. They aren't part of the versioned config.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The agent's MCP servers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerList"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agents"],"summary":"Connect an MCP server to the agent","description":"Reads the server's tools (Streamable HTTP) and saves the ones picked. It sends the model's arguments to the server, so it needs `webhooks:write`. 422 `mcp_unreachable` when the tool list can't be read; 409 `mcp_name_taken`, `tool_name_taken` or `too_many_servers`.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMcpServer"}}}},"responses":{"201":{"description":"Connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/mcp-servers/{server_id}":{"patch":{"tags":["Agents"],"summary":"Change an MCP server or the tools picked","description":"Changes only what's sent. `tools` replaces the picks (from the list as last read). A new URL reads the tool list again and needs every header value again.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"server_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMcpServer"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServer"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"summary":"Disconnect an MCP server","description":"The agent stops using its tools from the next call.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"server_id","in":"path"}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/mcp-servers/{server_id}/refresh":{"post":{"tags":["Agents"],"summary":"Read the MCP server's tools again","description":"Calls use the schemas read when a tool was picked or last refreshed, so a change on the server reaches calls only after this. Picked tools the server dropped are unpicked. 409 `mcp_server_changed` when the server was changed while its tools were being read.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"server_id","in":"path"}],"responses":{"200":{"description":"Refreshed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerRefresh"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests":{"get":{"tags":["Agent tests"],"summary":"List an agent's tests, oldest first","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Tests","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentTest"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agent tests"],"summary":"Add a test","description":"A simulated caller (goal, persona, language, call time) or a replay of caller turns, with the rules a run must pass.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestInput"}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/suggest":{"post":{"tags":["Agent tests"],"summary":"Suggest starter tests with Build with AI","description":"Build with AI reads the agent's live workflow and writes a starter set of simulated callers that cover it. They replace the agent's earlier suggestions (origin `assist`) that the owner hasn't edited; the owner's own tests, edited suggestions and tests from calls stay. Uses one Build with AI message.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"All the agent's tests, the new suggestions last","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentTest"}},"added":{"type":"integer"}},"required":["data","added"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/{test_id}":{"patch":{"tags":["Agent tests"],"summary":"Change a test","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"test_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestUpdate"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agent tests"],"summary":"Delete a test","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"test_id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/test":{"post":{"tags":["Agent tests"],"summary":"Make this call a test","description":"Saves a finished call as a replay test on the agent that took it: the caller's turns in order, the call's local time and language, and its outcome as the expected result. Calling it again for the same call returns the existing test. Needs `calls:read` too: the test holds what the caller said.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The call's existing test","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTest"}}}},"201":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTest"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/runs":{"get":{"tags":["Agent tests"],"summary":"Recent test runs, newest first","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":20,"default":5},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentTestRun"}},"runner_online":{"type":"boolean"}},"required":["data","runner_online"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agent tests"],"summary":"Run the agent's tests","description":"Queues a simulated call per test against `live` (what callers get now) or `draft` (the workflow editor's saved draft). Each call is scored when it finishes. Uses the workspace's model allowance; a call it can't cover is skipped.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"type":"string","enum":["live","draft"],"default":"live"},"test_ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}}}}}},"responses":{"201":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/runs/{run_id}":{"get":{"tags":["Agent tests"],"summary":"A test run with each test's result","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"run_id","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestRun"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/runs/{run_id}/cancel":{"post":{"tags":["Agent tests"],"summary":"Stop a test run (calls already under way finish)","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"run_id","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestRun"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/publish-check":{"post":{"tags":["Agent tests"],"summary":"Test what Save & publish would make live, against live","description":"Runs the agent's tests on the workflow editor's draft (`draft`) or on the Agent tab's changes (`changes`, the Save & publish body) and compares each with live. Nothing is published. `run` is null when the check doesn't run (`skipped` says why); a skipped check never stops a publish.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishCheckRequest"}}}},"responses":{"201":{"description":"The check","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["off","warn","block"]},"min_pass_rate":{"type":"integer","minimum":0,"maximum":100,"description":"With `block`, the percent of tests that must pass on what goes live (default 80). The rule that no test may get worse applies as well."},"run":{"allOf":[{"$ref":"#/components/schemas/AgentTestRun"},{"type":["object","null"]}]},"skipped":{"type":["string","null"],"enum":["off","no_tests","runner_offline",null]}},"required":["mode","min_pass_rate","run","skipped"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/tests/settings":{"get":{"tags":["Agent tests"],"summary":"The agent's test settings","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Agent tests"],"summary":"Change the agent's test settings","description":"Changes what the body names and keeps the rest. Loosening the publish check (`block` to `warn` or `off`, or a lower `min_pass_rate`) needs an owner or admin (403 `publish_check_settings_forbidden`); anyone who can edit the agent may tighten it.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestSettingsUpdate"}}}},"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTestSettings"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/guardrails":{"get":{"tags":["Agent tests"],"summary":"List an agent's guardrails","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Guardrails","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Guardrail"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Agent tests"],"summary":"Set an agent's guardrails","description":"Replaces the list: guardrails sent with an `id` are kept (and updated), new ones are added, and any left out are removed. They apply from the next call on and to every test run. Saved right away; no publish needed.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardrailsUpdate"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Guardrail"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat-widgets":{"get":{"tags":["Chat widgets"],"summary":"List website chat widgets","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"agent_id","in":"query"}],"responses":{"200":{"description":"Oldest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatWidget"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Chat widgets"],"summary":"Create a website chat widget","description":"On the Pro and Agency plans (402 `chat_plan_required` otherwise).","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatWidgetRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatWidget"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat-widgets/{id}":{"get":{"tags":["Chat widgets"],"summary":"Get a website chat widget","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The widget","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatWidget"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Chat widgets"],"summary":"Update a website chat widget","description":"Fields left out keep their value. Turning a widget off always works; anything else needs the Pro or Agency plan.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChatWidgetRequest"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatWidget"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Chat widgets"],"summary":"Delete a website chat widget (embedded copies stop working)","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"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 credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/draft":{"get":{"tags":["Workflows"],"summary":"Get the agent's workflow draft, with validation","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDraft"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Workflows"],"summary":"Save the agent's workflow draft","description":"Creates or replaces the draft. Drafts may be incomplete: problems come back in `validation.errors`, pinned to node ids, and block publishing but not saving.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveWorkflowDraftRequest"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDraft"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/validate":{"post":{"tags":["Workflows"],"summary":"Validate a workflow graph without saving it","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateWorkflowRequest"}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowValidation"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/draft/publish":{"post":{"tags":["Workflows"],"summary":"Publish the agent's draft as a new immutable version","description":"The same as POST /agents/{id}/draft/publish: everything on the agent's draft goes live as one version, the Agent tab's changes included. Moves every active deployment of the agent onto it. Responds 422 (`invalid_workflow`, with `details.errors`) if the draft has problems.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"changelog":{"type":"string","maxLength":500}}}}}},"responses":{"201":{"description":"Published; returns the updated agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/published":{"get":{"tags":["Workflows"],"summary":"The deployed workflow graph, to start a draft from","description":"The live graph as it runs, with transfer targets and other workspace values kept. Use the export to share a workflow instead.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The live graph","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishedWorkflow"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/export":{"get":{"tags":["Workflows"],"summary":"Download the workflow as a .lassi-workflow.json file","description":"Phone numbers, CRM field ids and knowledge base ids are removed and listed in `needs_setup`.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["draft","published"],"default":"published"},"required":false,"name":"from","in":"query"}],"responses":{"200":{"description":"The workflow file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowFile"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/import":{"post":{"tags":["Workflows"],"summary":"Import a .lassi-workflow.json file into the agent's draft","description":"Replaces the draft. Fields the agent already has keep its own definition; new ones are added. Anything listed in `needs_setup` must be filled in before publishing.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowFile"}}}},"responses":{"200":{"description":"Imported into the draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowImportResult"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/assist":{"post":{"tags":["Workflows"],"summary":"Build or edit the workflow with AI","description":"Takes the conversation so far and the graph on the canvas, and returns the assistant's reply with an updated graph. The graph always passes validation (or is null when the reply only answers a question). Nothing is saved: the editor applies it to the draft.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAssistRequest"}}}},"responses":{"200":{"description":"The assistant's answer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAssistResult"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/assist-runs":{"post":{"tags":["Workflows"],"summary":"Start a Build with AI request in the background","description":"Like POST /agents/{id}/workflow/assist, but returns at once and keeps working if the caller goes away. Poll GET /agents/{id}/workflow/assist-runs for the answer. One run per agent at a time.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAssistRunRequest"}}}},"responses":{"202":{"description":"The run, still going","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Workflows"],"summary":"Recent Build with AI requests","description":"The last day's runs on this agent, oldest first (at most 20).","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssistRun"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/assist-runs/{runId}/applied":{"post":{"tags":["Workflows"],"summary":"Mark a run's answer as applied to the draft","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistRun"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/assist-runs/{runId}/undo-settings":{"post":{"tags":["Workflows"],"summary":"Put back the agent settings a run saved","description":"Undo for the business settings a Build with AI answer saved (business name, business facts, hours callers hear, Spanish). Each goes back to what it held before, unless it was changed since: those are kept and listed in `kept`. Once only.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"What was put back and what was kept, named in plain words","content":{"application/json":{"schema":{"type":"object","properties":{"restored":{"type":"array","items":{"type":"string"}},"kept":{"type":"array","items":{"type":"string"}}},"required":["restored","kept"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/assist":{"post":{"tags":["Agents"],"summary":"Edit the agent's prompt, greetings and details with AI","description":"Takes the conversation so far and the agent as it is in the editor, and returns the assistant's reply with the updated draft. Fields and settings can be added or changed, never removed. Nothing is saved: the editor applies it as unsaved changes. Costs one Build with AI message.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAssistRequest"}}}},"responses":{"200":{"description":"The assistant's answer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAssistResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/versions":{"get":{"tags":["Workflows"],"summary":"List the agent's published workflow versions","description":"Newest first. Versions are immutable once published.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Versions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersionSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/versions/{v}":{"get":{"tags":["Workflows"],"summary":"Get one published version, with what it runs","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"The version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersion"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/versions/{a}/diff/{b}":{"get":{"tags":["Workflows"],"summary":"Compare two published versions","description":"What changed from version `a` to version `b`: steps added, removed and changed (with each changed key, prompt text included), the flow, and the version's settings.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"a","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"b","in":"path"}],"responses":{"200":{"description":"The changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionDiff"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/versions/{v}/restore":{"post":{"tags":["Workflows"],"summary":"Roll back to a published version","description":"Publishes version `v`'s content as a new version, changelog \"Rolled back to v{v}\", and moves the agent's deployments onto it. Old versions are never changed. The same checks as a publish apply: the graph is validated against today's rules (422 `invalid_workflow`), its calendars must still be connected, and an agent whose publish check blocks refuses it (409 `publish_check_blocks_rollback`) unless an owner or admin skips the check once (`?skip_publish_check=true&skip_reason=…`). 409 `version_live` when `v` is already live. The agent's prompt, greetings and voice aren't part of a version and don't change.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":1000000},"required":true,"name":"v","in":"path"}],"responses":{"201":{"description":"Rolled back; returns the updated agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/draft":{"get":{"tags":["Agents"],"summary":"Get the agent's draft: its unpublished changes","description":"Every section as the draft has it (the live value where it changes nothing), which sections changed, and their revisions. With no draft, everything is live and `changed_sections` is empty.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDraft"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agents"],"summary":"Save changes to the agent's draft","description":"Saves the sections sent and leaves the rest. Creates the draft if there's none. A draft may have problems: they come back in `validation` and block publishing, not saving. Business settings (variables) aren't part of the draft: save them with PATCH /agents/{id}/variables.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchAgentDraftRequest"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDraft"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"summary":"Discard the agent's draft","description":"Every section goes back to what's live, in the Agent tab and the editor.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Discarded; the draft, now empty","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDraft"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/draft/publish":{"post":{"tags":["Agents"],"summary":"Publish the agent's draft as one new version","description":"Everything on the draft goes live as one immutable version with one changelog, and every active deployment moves onto it. 404 with no changes to publish; 422 `invalid_workflow`, `invalid_agent_settings` or `calendar_not_connected` when part of it can't go live. The publish check applies (`?publish_check=<run id>`, or skip it once with `?skip_publish_check=true&skip_reason=…`).","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"changelog":{"type":"string","maxLength":500}}}}}},"responses":{"201":{"description":"Published; returns the agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDetail"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/workflow/code/test":{"post":{"tags":["Workflows"],"summary":"Test a Custom Code step","description":"Runs code in the same sandbox calls use, with sample answers and the agent's business settings (sample `variables` win), and returns what it returned or what went wrong. Nothing is saved.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCodeRequest"}}}},"responses":{"200":{"description":"The result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeRunResult"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/build":{"post":{"tags":["Agents"],"summary":"Set the agent up with AI","description":"Reads the agent's knowledge (waiting for sources still being read), writes its prompt, greeting and fields, then builds and publishes its workflow, in the background. Poll GET /agents/{id}/build. Costs up to two Build with AI messages.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartAgentBuildRequest"}}}},"responses":{"202":{"description":"The build, under way","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentBuild"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Agents"],"summary":"The agent's latest AI setup","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The latest build","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentBuild"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases":{"get":{"tags":["Knowledge"],"summary":"List knowledge bases","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Knowledge"],"summary":"Create a knowledge base","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeBaseRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}":{"get":{"tags":["Knowledge"],"summary":"Get a knowledge base and its sources","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The knowledge base","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseDetail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Knowledge"],"summary":"Rename or describe a knowledge base","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKnowledgeBaseRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Knowledge"],"summary":"Delete a knowledge base","description":"Deletes its sources and their text and detaches it from agents. Workflow knowledge steps keep the id; calls ignore it.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/sources":{"post":{"tags":["Knowledge"],"summary":"Add a source: pasted text, Q&A pairs, a web page or a website","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKnowledgeSourceRequest"}}}},"responses":{"201":{"description":"Queued for indexing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSource"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/answers":{"post":{"tags":["Knowledge"],"summary":"Add a question and answer suggested from a call","description":"Appends the pair to the knowledge base's \"Fixes from calls\" Q&A source, creating it on first use. A question already there (ignoring case and spacing) gets the new answer. The source is re-indexed; the change reaches calls once it's ready.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddKnowledgeAnswerRequest"}}}},"responses":{"200":{"description":"Added to the existing source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSource"}}}},"201":{"description":"Created the source with this pair","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSource"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/files":{"post":{"tags":["Knowledge"],"summary":"Upload a file (PDF, DOCX, TXT, MD, HTML or CSV, up to 10 MB)","description":"The text is extracted now and the file itself is not kept. The source is queued for indexing.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadKnowledgeFileRequest"}}}},"responses":{"201":{"description":"Queued for indexing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSource"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/sources/{source_id}":{"get":{"tags":["Knowledge"],"summary":"Get a source, its failures and its documents","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"source_id","in":"path"}],"responses":{"200":{"description":"The source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSourceDetail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Knowledge"],"summary":"Change a source","description":"`text` for text sources, `pairs` for Q&A, `max_pages` / `include_paths` / `exclude_paths` for websites. A content change re-queues the source.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"source_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKnowledgeSourceRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSource"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Knowledge"],"summary":"Delete a source and its text","description":"Works mid-indexing; the job notices and stops.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"source_id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/sources/{source_id}/refresh":{"post":{"tags":["Knowledge"],"summary":"Index a source again","description":"Web pages and websites are fetched again; text, Q&A and files are re-chunked. 409 `source_busy` while it is queued or indexing; 429 `refresh_too_soon` within 60 s of a web source's last run.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"source_id","in":"path"}],"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSource"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/sources/{source_id}/documents/{document_id}":{"get":{"tags":["Knowledge"],"summary":"Get a document's extracted text","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"source_id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"document_id","in":"path"}],"responses":{"200":{"description":"The document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeDocument"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{id}/search":{"post":{"tags":["Knowledge"],"summary":"Search a knowledge base (\"Test this KB\")","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchKnowledgeBaseRequest"}}}},"responses":{"200":{"description":"Best matching passages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeSearchResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/knowledge-bases":{"get":{"tags":["Knowledge"],"summary":"Knowledge bases an agent answers from","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Attached knowledge bases","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentKnowledgeBases"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Knowledge"],"summary":"Choose the knowledge bases an agent answers from","description":"Replaces the set. Order is kept.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAgentKnowledgeBasesRequest"}}}},"responses":{"200":{"description":"Attached knowledge bases","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentKnowledgeBases"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scripts":{"get":{"tags":["Scripts"],"summary":"List call scripts","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Scripts, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScriptSummary"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Scripts"],"summary":"Add a script from pasted text","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScriptRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scripts/files":{"post":{"tags":["Scripts"],"summary":"Add a script from a file","description":"The file is read into text and sections when it is uploaded; the file itself isn't kept.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"PDF, DOCX, TXT, MD, HTML or CSV, up to 10 MB"},"name":{"type":"string","description":"Defaults to the file name"}},"required":["file"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scripts/{id}":{"get":{"tags":["Scripts"],"summary":"Get a script with its sections","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The script","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Scripts"],"summary":"Rename a script or change its text or lines","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScriptRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Script"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Scripts"],"summary":"Delete a script","description":"Agents that follow it stop doing so.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"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 credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/scripts":{"get":{"tags":["Scripts"],"summary":"The scripts an agent follows, in order","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scripts in order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScriptSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Scripts"],"summary":"Choose the scripts an agent follows","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAgentScriptsRequest"}}}},"responses":{"200":{"description":"Scripts in order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScriptSummary"}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/scripts/{id}/generate-workflow":{"post":{"tags":["Scripts"],"summary":"Draft an agent's workflow from a script with AI","description":"Build with AI, given the script: returns the same result as `POST /agents/{id}/workflow/assist`, with lines marked say exactly kept word for word. Costs one Build with AI message. Nothing is saved: the editor applies it to the draft.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateWorkflowFromScriptRequest"}}}},"responses":{"200":{"description":"The assistant's answer","content":{"application/json":{"schema":{"type":"object","properties":{"reply":{"type":"string"},"graph":{"type":["object","null"],"additionalProperties":{},"description":"A valid graph, or null when nothing changed"},"changes":{"type":"array","items":{"type":"string"}},"added_fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"fields":{"type":"array","items":{"$ref":"#/components/schemas/CallField"}},"ai_credits":{"type":"object","properties":{"remaining":{"type":"number"},"limit":{"type":"number"},"per":{"type":"string","enum":["period","lifetime"]}},"required":["remaining","limit","per"]}},"required":["reply","graph","changes","added_fields","fields","ai_credits"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/members":{"get":{"tags":["Members"],"summary":"List team members","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Members","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Members"],"summary":"Add a member by email","description":"Creates the user if needed and adds them to the team. Owner, admin and editor roles consume an editor seat; viewers are free and unlimited. People normally join through an invitation (POST /v1/invitations) instead.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","maxLength":200},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/members/{user_id}":{"patch":{"tags":["Members"],"summary":"Change a member's role","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"user_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["role"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Members"],"summary":"Remove a member","description":"API keys the member created here (and, for an agency, in its client workspaces they reached through this membership) are revoked too.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"user_id","in":"path"}],"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invitations":{"get":{"tags":["Invitations"],"summary":"Pending invitations (open or expired, not yet accepted or withdrawn)","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Invitations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Invitations"],"summary":"Invite someone by email","description":"Emails a link that's valid for 7 days. An invitation for a seat role (owner, admin, editor) holds an editor seat until it's accepted, withdrawn or expires. A workspace can send 20 invitation emails a day, one person 5, at least 10 minutes apart (429 `rate_limited`; resends and withdrawn invitations count).","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"Invited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invitations/{id}/resend":{"post":{"tags":["Invitations"],"summary":"Send a new link (the old one stops working) and restart the 7 days","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Resent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invitations/{id}":{"delete":{"tags":["Invitations"],"summary":"Withdraw an invitation","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Withdrawn"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams":{"get":{"tags":["Teams"],"summary":"List teams in the workspace","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Teams","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Team"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Teams"],"summary":"Create a team","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":280},"color":{"type":"string","enum":["gray","blue","green","amber","red","violet"]}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams/{id}":{"patch":{"tags":["Teams"],"summary":"Rename or recolor a team","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":280},"color":{"type":"string","enum":["gray","blue","green","amber","red","violet"]}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Teams"],"summary":"Delete a team (agents that alerted it stop alerting anyone)","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams/{id}/members":{"post":{"tags":["Teams"],"summary":"Add a workspace member to a team","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string","format":"uuid"}},"required":["user_id"]}}}},"responses":{"200":{"description":"Updated team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams/{id}/members/{user_id}":{"delete":{"tags":["Teams"],"summary":"Remove someone from a team","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"user_id","in":"path"}],"responses":{"200":{"description":"Updated team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/teams/{id}/on-call":{"put":{"tags":["Teams"],"summary":"Set who transferred calls ring, and how","description":"Replaces the team's on-call list. People are tried one at a time, in this order. With a weekly rotation, the first person here is on call now, and the list moves down one place at each handoff.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamOnCallInput"}}}},"responses":{"200":{"description":"Updated team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspace":{"get":{"tags":["Workspace"],"summary":"The current workspace, its seats and the caller's access","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Workspace"],"summary":"Rename the workspace, change its slug or its settings","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"slug":{"type":"string","minLength":3,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"recognize_callers":{"type":"boolean"},"caller_booking_changes":{"type":"boolean"},"text_back":{"type":"boolean"},"text_back_message":{"type":["string","null"],"maxLength":160},"follow_up_user_id":{"type":["string","null"],"format":"uuid"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspace/delete":{"post":{"tags":["Workspace"],"summary":"Delete the workspace","description":"Owners only, signed in (not with an API key), and `confirm` must be the workspace's name. The workspace, and an agency's client workspaces, close at once: no one can open them, their numbers are released, and the plan is set to cancel at the end of the period. Everything in them is permanently deleted after `purge_after`; until then support can still send an export.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","maxLength":200}},"required":["confirm"]}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted_at":{"type":"string","format":"date-time"},"purge_after":{"type":"string","format":"date-time"}},"required":["deleted_at","purge_after"],"title":"WorkspaceDeletion"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/clients":{"get":{"tags":["Client workspaces"],"summary":"An agency's client workspaces, archived ones included","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Clients","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientWorkspace"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Client workspaces"],"summary":"Create a client workspace under this agency","description":"The agency's owners and admins can open it straight away as admins; invite the client's own people from inside it.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"slug":{"type":"string","minLength":3,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"from_template":{"allOf":[{"$ref":"#/components/schemas/CreateFromTemplate"},{"type":"object","properties":{"template_id":{"type":"string","format":"uuid"}},"required":["template_id"]}],"description":"Also start an agent in the new workspace from one of the agency's agent templates (needs `agents:write` too). Its workflow waits as a draft until nothing needs setting up; see `from_template` in the response."}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedClientWorkspace"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/clients/usage":{"get":{"tags":["Client workspaces"],"summary":"Each client's calls and minutes for a month","description":"Without `month`, the agency's current billing period (the one caps count against). With `month` (YYYY-MM), that calendar month in UTC. Archived clients are included.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"required":false,"name":"month","in":"query"}],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUsage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/clients/{id}":{"patch":{"tags":["Client workspaces"],"summary":"Rename, archive or restore a client workspace","description":"Archiving hides the workspace and closes it to everyone. Its phone numbers stop answering (callers hear it's unavailable) until it's restored or they're released. Restoring one counts against the plan's client workspace limit again (402 `client_workspace_limit` when it's full). `cap` replaces the client's monthly minute cap.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"archived":{"type":"boolean"},"cap":{"type":"object","properties":{"monthly_minutes":{"type":["integer","null"],"minimum":1,"maximum":1000000},"at_cap":{"type":"string","enum":["continue","forward"]},"fallback_number":{"type":["string","null"],"maxLength":32}},"required":["monthly_minutes","at_cap"]}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientWorkspace"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/brand":{"get":{"tags":["White-label"],"summary":"The agency's white-label settings","description":"Refreshes a sending domain's status from the mail provider until it verifies.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["White-label"],"summary":"Change the brand's name, colour, support email, website or Powered by line","description":"Null clears a field. Clearing the name turns the white-label off.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrandRequest"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/brand/logos/{variant}":{"put":{"tags":["White-label"],"summary":"Upload the square or wide logo (PNG or SVG, up to 256 KB)","description":"SVGs are cleaned of scripts, links and anything else that isn't drawing.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["square","wide"]},"required":true,"name":"variant","in":"path"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Uploaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["White-label"],"summary":"Remove a logo","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["square","wide"]},"required":true,"name":"variant","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/brand/mail-domain":{"put":{"tags":["White-label"],"summary":"Send clients' email from your own domain","description":"Registers the domain with the mail provider and returns the DNS records to add. Replaces an earlier domain. Mail keeps going from Ladoo's address until it verifies.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","maxLength":200}},"required":["domain"]}}}},"responses":{"200":{"description":"Registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["White-label"],"summary":"Stop sending from your domain","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/brand/mail-domain/verify":{"post":{"tags":["White-label"],"summary":"Check the sending domain's DNS records now","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Checked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agency/stripe":{"get":{"tags":["Client billing"],"summary":"The agency's linked Stripe account","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyStripe"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Client billing"],"summary":"Unlink the agency's Stripe account","description":"Ladoo stops creating client subscriptions and sending usage. Subscriptions already on the agency's account stay there. The agency's own Ladoo plan isn't affected.","security":[{"ApiKey":[]}],"responses":{"204":{"description":"Unlinked"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agency/stripe/authorize":{"post":{"tags":["Client billing"],"summary":"Start linking the agency's Stripe account","description":"Returns the Stripe URL to send the browser to. Stripe sends it back to the dashboard's /settings/clients/stripe-callback with `code` and `state`.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Where to go","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agency/stripe/callback":{"post":{"tags":["Client billing"],"summary":"Finish linking the agency's Stripe account","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"state":{"type":"string","minLength":1}},"required":["code","state"]}}}},"responses":{"200":{"description":"Linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgencyStripe"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/clients/{id}/billing":{"put":{"tags":["Client billing"],"summary":"Bill a client through the agency's Stripe, or change its price","description":"The first call creates the customer and subscription on the agency's Stripe account; later calls change the price from the next invoice.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientBillingInput"}}}},"responses":{"200":{"description":"Billing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientBilling"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Client billing"],"summary":"Stop billing a client","description":"Its subscription on the agency's Stripe ends at the end of the current period.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stopped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientBilling"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys":{"get":{"tags":["API keys"],"summary":"Active API keys (the secret part is never shown again)","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key","description":"The new key can do no more than the caller can do here. The full key is in this response only.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKey"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys/{id}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key; requests using it fail from now on","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Revoked"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/test-sessions/{room_name}":{"delete":{"tags":["Testing"],"summary":"Give back a test session's minutes when the agent never joined","description":"A session holds its minutes from when it's created. If the agent never picks up, this gives them back right away instead of when the token expires, and the room can't start a call afterwards. Once the agent has joined it answers 409 `test_session_started`: the minutes free up when that call ends.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^test-[0-9a-f]{12}$"},"required":true,"name":"room_name","in":"path"}],"responses":{"204":{"description":"Released"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/test-sessions":{"post":{"tags":["Testing"],"summary":"Start a browser test session (voice or text) with an agent","description":"Mints a short-lived LiveKit token for a fresh room with the agent dispatched. The session is recorded as a call with kind=test and counts against the plan's test minutes; it ends on its own when they run out. The agent doesn't need a phone number.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTestSessionRequest"}}}},"responses":{"201":{"description":"Session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSession"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/voices":{"get":{"tags":["Voices"],"summary":"List TTS voices available to agents","description":"Voices in the ElevenLabs account, sorted by name, limited to those usable with the agent TTS model (professional clones must be trained for it). `search` matches name, description and labels. Upstream responses are cached for a few minutes.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"search","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of voices","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Voice"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/voices/{id}":{"get":{"tags":["Voices"],"summary":"Get one voice","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9]{1,64}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The voice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Voice"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/voices/{id}/speech":{"post":{"tags":["Voices"],"summary":"Hear a short phrase in a voice","description":"Synthesizes up to 200 characters with the agent TTS model, e.g. to check how a pronunciation sounds before publishing. Identical requests are cached for a few minutes. Each workspace (with an agency's clients) can play 50 a day on the Free plan and 500 on paid plans (429 `voice_preview_limit`).","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9]{1,64}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}}},"responses":{"200":{"description":"MP3 audio","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/crm":{"get":{"tags":["Integrations"],"summary":"The workspace's LeadConnector connection","security":[{"ApiKey":[]}],"responses":{"200":{"description":"The connection, or null","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CrmConnection"},"configured":{"type":"boolean","description":"Whether this server can connect LeadConnector (its app keys are set)."},"connect_available":{"type":"boolean","description":"Whether you can connect LeadConnector now. False while Ladoo's app is still a draft that other agencies can't install; the dashboard shows it as coming soon. A workspace that was already connected can always reconnect."}},"required":["connection","configured","connect_available"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Integrations"],"summary":"Change the LeadConnector settings","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"calendar_id":{"type":["string","null"],"minLength":1,"description":"Calendar the agent books into. Null turns booking off."},"pipeline_id":{"type":["string","null"],"minLength":1,"description":"Pipeline for opportunities. Null: calls create no opportunities."},"new_lead_stage_id":{"type":["string","null"],"minLength":1},"booked_stage_id":{"type":["string","null"],"minLength":1,"description":"Stage an opportunity moves to when the call books. Null: don't move it."},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20},"outcome_tags":{"type":"boolean","description":"Also tag contacts by outcome, such as `ladoo-booked`."}}}},"required":["settings"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CrmConnection"}},"required":["connection"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Integrations"],"summary":"Disconnect LeadConnector","description":"Forgets the tokens and the imported contacts, so Ladoo stops reading and writing. Ladoo also tries to uninstall its app from the LeadConnector account (that one only); `ghl_app` says whether it did. Nothing else in your CRM is changed.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Disconnected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDisconnect"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/crm/options":{"get":{"tags":["Integrations"],"summary":"Calendars and pipelines to choose from","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Choices, live from LeadConnector","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmOptions"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/crm/people-import":{"get":{"tags":["Integrations"],"summary":"Ladoo people who aren't in LeadConnector yet","description":"Who adding your Ladoo people to your CRM would send, and the latest import. Owners and admins only.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"The preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmPeopleImportPreview"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Integrations"],"summary":"Add Ladoo people to LeadConnector","description":"Queues a background import of everyone the preview lists. New people get a contact; people your CRM already has (same phone or email) only get fields they have blank. Everyone gets the `ladoo-import` tag. With `include_notes`, each contact also gets one note with that person's conversation summaries. Team notes are never sent. Owners and admins only.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"include_notes":{"type":"boolean","default":false}}}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"import":{"$ref":"#/components/schemas/CrmPeopleImport"}},"required":["import"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integration-requests":{"post":{"tags":["Integration requests"],"summary":"Ask Ladoo to build an integration","description":"Dashboard only (signed in). Saves the request and emails it to Ladoo support, with replies going to `contact_email`. At most 10 per workspace a day.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequestInput"}}}},"responses":{"201":{"description":"Request sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/apps/enabled":{"get":{"tags":["Apps"],"summary":"Whether this workspace has the Apps hub","security":[{"ApiKey":[]}],"responses":{"200":{"description":"On or off","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/apps":{"get":{"tags":["Apps"],"summary":"Search the apps a workspace can connect","description":"Featured apps first, then one-click apps, then apps that need an API key.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["crm","calendars","field_service","messaging","payments","sheets_docs","email","other"]},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","pattern":"^\\d{1,5}$"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":48},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Apps","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/App"}},"categories":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"]}},"total":{"type":"integer"},"next_cursor":{"type":["string","null"]}},"required":["data","categories","total","next_cursor"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/apps/connections":{"get":{"tags":["Apps"],"summary":"The workspace's app connections","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Connections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AppConnection"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/apps/connections/{id}":{"get":{"tags":["Apps"],"summary":"One app connection, with its latest status","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppConnection"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Apps"],"summary":"Disconnect an app","description":"Revokes the sign-in and turns the app's actions off for every agent.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/apps/{slug}":{"get":{"tags":["Apps"],"summary":"An app and the actions agents can use in it","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","example":"hubspot"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"The app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppDetail"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/apps/{slug}/connect":{"post":{"tags":["Apps"],"summary":"Start connecting an app","description":"Returns a sign-in link to open in a pop-up. It expires after about 10 minutes, so create it when the owner clicks. After sign-in the pop-up returns to `{dashboard}/apps/callback?connection_id=…`; poll the connection until it isn't `initiated`.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","example":"hubspot"},"required":true,"name":"slug","in":"path"}],"responses":{"201":{"description":"Started","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/AppConnection"},"redirect_url":{"type":"string","format":"uri"}},"required":["connection","redirect_url"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/apps":{"get":{"tags":["Apps"],"summary":"The app actions an agent may use","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Apps with actions on","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentApp"}}},"required":["data"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}/apps/{slug}/actions":{"put":{"tags":["Apps"],"summary":"Choose which of an app's actions an agent may use","description":"An empty list turns the app off for this agent.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","example":"hubspot"},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"actions":{"type":"array","items":{"type":"string","pattern":"^[A-Z0-9_]{1,128}$","example":"HUBSPOT_CREATE_CONTACT"},"maxItems":20}},"required":["actions"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentApp"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendar":{"get":{"tags":["Integrations"],"summary":"The workspace's booking calendars","security":[{"ApiKey":[]}],"responses":{"200":{"description":"The connections, and which providers this server can connect","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/CalendarConnection"},"description":"Every connected calendar, oldest first."},"connection":{"allOf":[{"$ref":"#/components/schemas/CalendarConnection"},{"type":["object","null"],"description":"The oldest of `connections`, for clients from before several."}]},"providers":{"type":"array","items":{"type":"string","enum":["google","microsoft","ics"],"description":"`ics` is a calendar link: a private iCal address, with bookings kept in Ladoo."},"description":"Providers that can be connected here: Google and Outlook when their OAuth app is set up, and `ics` always."}},"required":["connections","connection","providers"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Integrations"],"summary":"Change the booking settings (one connection)","description":"For a workspace with one calendar. With several, 409 `several_calendars`.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"calendar_id":{"type":["string","null"],"minLength":1,"description":"Calendar the agent books into. Null turns booking off."},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"mon":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"tue":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"wed":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"thu":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"fri":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"sat":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."}},"required":["sun","mon","tue","wed","thu","fri","sat"]},"appointment_minutes":{"type":"integer","minimum":10,"maximum":480},"buffer_minutes":{"type":"integer","minimum":0,"maximum":240,"description":"Kept free before and after every appointment."},"max_days_ahead":{"type":"integer","minimum":1,"maximum":90,"description":"How far ahead callers can book, in days."},"min_notice_minutes":{"type":"integer","minimum":0,"maximum":10080,"description":"The soonest an appointment can start, in minutes from now."}}}},"required":["settings"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CalendarConnection"}},"required":["connection"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Integrations"],"summary":"Disconnect the booking calendar (one connection)","description":"For a workspace with one calendar (none: nothing to do). With several, 409 `several_calendars`: use DELETE /integrations/calendars/{id}.","security":[{"ApiKey":[]}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendar/{provider}/authorize":{"post":{"tags":["Integrations"],"summary":"Start connecting Google Calendar or Outlook","description":"Returns the sign-in URL to send the browser to. It comes back to the dashboard's /settings/integrations/calendar/callback with `code` and `state` (the registered redirect address; the dashboard then opens Calendar → Settings).","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","enum":["google","microsoft"]},"required":true,"name":"provider","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"connection_id":{"type":["string","null"],"format":"uuid","description":"Reconnect this connection (same account) instead of adding another calendar."}}}}}},"responses":{"200":{"description":"Where to go","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendar/callback":{"post":{"tags":["Integrations"],"summary":"Finish connecting Google Calendar or Outlook","description":"Adds the account beside the workspace's other calendars, or reconnects it when it is already connected and needs it. 409 `calendar_already_connected`: that account is already connected and working.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"state":{"type":"string","minLength":1}},"required":["code","state"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CalendarConnection"}},"required":["connection"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendar/options":{"get":{"tags":["Integrations"],"summary":"Calendars to book into (one connection)","description":"For a workspace with one calendar. With several, 409 `several_calendars`: use /integrations/calendars/{id}/options.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Calendars the account can add events to, live","content":{"application/json":{"schema":{"type":"object","properties":{"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["calendars"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendars/{id}/options":{"get":{"tags":["Integrations"],"summary":"Calendars to book into, in one connection","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calendars the account can add events to, live","content":{"application/json":{"schema":{"type":"object","properties":{"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["calendars"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream provider error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendars/{id}":{"patch":{"tags":["Integrations"],"summary":"Change one connection's booking settings","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"calendar_id":{"type":["string","null"],"minLength":1,"description":"Calendar the agent books into. Null turns booking off."},"timezone":{"type":"string"},"hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"mon":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"tue":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"wed":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"thu":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"fri":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"sat":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."}},"required":["sun","mon","tue","wed","thu","fri","sat"]},"appointment_minutes":{"type":"integer","minimum":10,"maximum":480},"buffer_minutes":{"type":"integer","minimum":0,"maximum":240,"description":"Kept free before and after every appointment."},"max_days_ahead":{"type":"integer","minimum":1,"maximum":90,"description":"How far ahead callers can book, in days."},"min_notice_minutes":{"type":"integer","minimum":0,"maximum":10080,"description":"The soonest an appointment can start, in minutes from now."}}},"if_hours":{"type":"object","properties":{"sun":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"mon":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"tue":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"wed":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"thu":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"fri":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."},"sat":{"type":["object","null"],"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["start","end"],"description":"Open hours that day, or null when closed."}},"required":["sun","mon","tue","wed","thu","fri","sat"],"description":"Change the settings only while the booking hours are still these, or already `settings.hours` (409 `hours_changed` otherwise), so an undo doesn't replace hours changed since."}},"required":["settings"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CalendarConnection"}},"required":["connection"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Integrations"],"summary":"Disconnect one calendar","description":"Deletes its tokens (and revokes Google's) or the calendar link's address, at once. The workspace's other calendars are untouched. Events already booked stay in the calendar. Agents that chose it stop booking into it and keep booking into the rest of their choice; one left with none takes messages.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendar/ics":{"post":{"tags":["Integrations"],"summary":"Connect a calendar link","description":"Books without signing in to Google or Microsoft. `url` is the calendar's private iCal address (https:// or webcal://); it is fetched to check it, then stored sealed, and read for busy times. Bookings are kept in Ladoo: subscribe to `feed` to see them. It is added beside the workspace's other calendars; `connection_id` replaces that calendar link's address instead, keeping its name, settings and subscribe address. 409 `calendar_already_connected`: that address is already connected.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"connection_id":{"type":["string","null"],"format":"uuid"}},"required":["url"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CalendarConnection"}},"required":["connection"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendar/feed/reset":{"post":{"tags":["Integrations"],"summary":"Change the subscribe address (one calendar link)","description":"A calendar link's new `feed`. The old address stops working at once. With several calendar links, 409 `several_calendars`.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"Reset","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CalendarConnection"}},"required":["connection"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/calendars/{id}/feed/reset":{"post":{"tags":["Integrations"],"summary":"Change a calendar link's subscribe address","description":"The old address stops working at once.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Reset","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/CalendarConnection"}},"required":["connection"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/booking-calendars":{"get":{"tags":["Integrations"],"summary":"Calendars an agent can book into","description":"Every connected calendar (your CRM, and Google Calendar, Outlook or a calendar link) with the calendars in it, for choosing an agent's calendars. A connection that can't be read right now is still listed, with `error`.","security":[{"ApiKey":[]}],"responses":{"200":{"description":"The connected calendars","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/BookingCalendarChoice"}}},"required":["connections"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/bookings":{"get":{"tags":["Calendar"],"summary":"Appointments Ladoo booked","description":"Appointments overlapping the range, oldest first: every appointment a call booked into Google Calendar, Outlook, your CRM or a calendar link (test calls left out). Cancelled ones are left out unless `include_cancelled`. Upcoming ones are checked against their calendars now and then, so one deleted there shows as `removed`.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Start of the range (inclusive)"},"required":true,"description":"Start of the range (inclusive)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"End of the range (exclusive). At most 42 days after `from`."},"required":true,"description":"End of the range (exclusive). At most 42 days after `from`.","name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Also list cancelled appointments"},"required":false,"description":"Also list cancelled appointments","name":"include_cancelled","in":"query"}],"responses":{"200":{"description":"The bookings, and the workspace's time zone","content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string","description":"The workspace's booking time zone"},"bookings":{"type":"array","items":{"$ref":"#/components/schemas/CalendarBooking"}}},"required":["timezone","bookings"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/bookings/{id}/cancel":{"post":{"tags":["Calendar"],"summary":"Cancel an appointment","description":"Removes the appointment from every calendar Ladoo wrote it to (only the event Ladoo created), and keeps it as cancelled. One calendar failing doesn't stop the others: `events` says what happened in each, and calling this again retries the ones that failed. Calling it on a finished cancel changes nothing. Your CRM may notify the contact, depending on its settings.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The appointment after the cancel","content":{"application/json":{"schema":{"type":"object","properties":{"booking":{"$ref":"#/components/schemas/CalendarBooking"}},"required":["booking"]}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/calls/{call_id}/bookings":{"get":{"tags":["Calendar"],"summary":"Appointments a call booked","description":"Including cancelled ones, oldest first.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"call_id","in":"path"}],"responses":{"200":{"description":"The call's appointments","content":{"application/json":{"schema":{"type":"object","properties":{"bookings":{"type":"array","items":{"$ref":"#/components/schemas/CalendarBooking"}}},"required":["bookings"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/busy":{"get":{"tags":["Calendar"],"summary":"When the connected calendar is busy","description":"Busy times from the connected Google Calendar, Outlook or calendar link, without details. Never fails because of the calendar: `status` says whether it could be read. Cached for a minute. Refused (403 `staff_view_hidden`) when Ladoo staff view the workspace.","security":[{"ApiKey":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Start of the range (inclusive)"},"required":true,"description":"Start of the range (inclusive)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"End of the range (exclusive). At most 42 days after `from`."},"required":true,"description":"End of the range (exclusive). At most 42 days after `from`.","name":"to","in":"query"}],"responses":{"200":{"description":"Busy times, or why there are none","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","not_connected","unavailable"],"description":"`not_connected`: no calendar to read (or the CRM, which isn't read here). `unavailable`: the calendar couldn't be read just now; `message` says why."},"message":{"type":["string","null"]},"busy":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]}}},"required":["status","message","busy"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/confirmations":{"get":{"tags":["Calendar"],"summary":"Booking confirmation settings","security":[{"ApiKey":[]}],"responses":{"200":{"description":"The settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingConfirmationSettings"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Calendar"],"summary":"Change booking confirmation settings","description":"Templates may use the placeholders {caller_name}, {date}, {time}, {business}, {address} and {agent}; anything else in braces is refused. A null template goes back to the default.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"boolean"},"text":{"type":"boolean"},"reminders":{"type":"boolean"},"reminder_hours":{"type":"integer","minimum":1,"maximum":168},"business_email":{"type":["string","null"],"maxLength":254},"business_address":{"type":["string","null"],"maxLength":300},"templates":{"type":"object","properties":{"en":{"$ref":"#/components/schemas/BookingEmailTemplate"},"es":{"$ref":"#/components/schemas/BookingEmailTemplate"}}}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingConfirmationSettings"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/confirmations/test":{"post":{"tags":["Calendar"],"summary":"Email yourself a test confirmation","description":"Sends the confirmation, with sample details, to the signed-in person's own email. `template` tries words that aren't saved yet. Not for API keys.","security":[{"ApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"type":"string","enum":["en","es"],"default":"en"},"template":{"$ref":"#/components/schemas/BookingEmailTemplate"}}}}}},"responses":{"200":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","properties":{"sent_to":{"type":"string"}},"required":["sent_to"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/public/v1/chat-widgets/{widget_id}":{"get":{"tags":["Chat widget"],"summary":"A chat widget's public appearance and whether it's taking chats","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"widget_id","in":"path"}],"responses":{"200":{"description":"The widget","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicChatWidget"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/public/v1/chat-widgets/{widget_id}/sessions":{"post":{"tags":["Chat widget"],"summary":"Start a website chat","description":"Called when a visitor sends their first message. Counts one conversation against the plan. 403 `origin_not_allowed` when `origin` isn't in the widget's allowed websites, 402 `chat_unavailable` when the plan doesn't cover it or the allowance is used up, 429 when one visitor or widget starts too many chats.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"widget_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatSessionRequest"}}}},"responses":{"201":{"description":"Session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSession"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Dependency not configured or unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/public/v1/brands/{slug}":{"get":{"tags":["White-label"],"summary":"An agency's brand, for its branded sign-in page","parameters":[{"schema":{"type":"string","maxLength":48},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Brand","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Brand"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/public/v1/brands/{agency_id}/logos/{variant}":{"get":{"tags":["White-label"],"summary":"A brand logo (PNG or sanitized SVG)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"agency_id","in":"path"},{"schema":{"type":"string","enum":["square","wide"]},"required":true,"name":"variant","in":"path"}],"responses":{"200":{"description":"The image"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/public/v1/status":{"get":{"tags":["Public"],"summary":"Ladoo's service status (tryladoo.com/status)","description":"Current state and daily uptime for the last 90 days per component. No credentials; readable from any website. Cached for 60 seconds.","responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceStatus"}}}}}}},"/public/v1/email-fix/{token}":{"get":{"tags":["Email fix"],"summary":"What a booking email's 'Not you?' link is about","description":"Changes nothing (mail scanners open links).","parameters":[{"schema":{"type":"string","maxLength":400},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"The link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailFix"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Email fix"],"summary":"Say the address isn't yours, or give the right one","description":"`not_mine` stops emails to the address for this person; `new_email` saves another one, which the business confirms with the caller before sending anything to it. 409 `already_fixed` once the email was changed.","parameters":[{"schema":{"type":"string","maxLength":400},"required":true,"name":"token","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailFixAction"}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailFix"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{},"servers":[{"url":"https://api.tryladoo.com"}],"tags":[{"name":"Calls"},{"name":"People"},{"name":"Calendar"},{"name":"Webhooks"},{"name":"Agents"},{"name":"Workflows"},{"name":"Knowledge"},{"name":"Scripts"},{"name":"Agent tests"},{"name":"Phone numbers"},{"name":"Voices"},{"name":"Workspace"},{"name":"Members"},{"name":"Invitations"},{"name":"Teams"},{"name":"API keys"},{"name":"Client workspaces"},{"name":"Client billing"},{"name":"White-label"},{"name":"Agent templates"},{"name":"Apps"},{"name":"Audit log"},{"name":"Billing"},{"name":"Blocked callers"},{"name":"Chat widgets"},{"name":"Email fix"},{"name":"Integration requests"},{"name":"Integrations"},{"name":"Testing"},{"name":"Account","description":"For the Ladoo dashboard itself: these need a signed-in person, and API keys get 401 from them."},{"name":"Chat widget","description":"Called by the website chat widget from visitors' browsers. No API key needed."},{"name":"Public","description":"Open to anyone, with no API key."}]}