{"openapi":"3.1.0","info":{"title":"Mirakash API","version":"1.0.0","summary":"Voice and chat agents, their conversations, outbound campaigns, knowledge and human handoffs — over REST and MCP.","description":"Mirakash runs voice and chat agents: they answer and place phone calls, chat on websites and messaging apps, answer and send email from your own domain, look things up in your documents, and hand a conversation to a person when they should. This API is the same product without the console — 54 operations over **REST** and, unchanged, as tools on an **MCP server** for AI clients.\n\nEvery operation in this reference is generated from one registry in the Mirakash codebase. The REST endpoint, the MCP tool and this page are three views of the same definition, so none of them can describe something the others do not do.\n\n## Quickstart\n\n**1. Create an API key.** A workspace admin creates one in **Settings → API keys** in the [Mirakash console](https://app.mirakash.com/settings?tab=apikeys). Choose *read-only* or *read and write*. The key (`mk_live_…`) is shown once — copy it then; Mirakash keeps only a hash.\n\n**2. Check it.**\n\n```bash\ncurl https://app.mirakash.com/api/v1/whoami \\\n  -H \"Authorization: Bearer $MIRAKASH_API_KEY\"\n```\n\n```json\n{ \"data\": { \"organizationId\": \"acme\", \"scopes\": [\"read\", \"write\"], \"authenticatedVia\": \"api-key\", \"keyId\": \"…\", \"userId\": null } }\n```\n\n**3. Find an agent and talk to it.**\n\n```bash\ncurl https://app.mirakash.com/api/v1/agents -H \"Authorization: Bearer $MIRAKASH_API_KEY\"\n\ncurl -X POST https://app.mirakash.com/api/v1/agents/AGENT_ID/reply \\\n  -H \"Authorization: Bearer $MIRAKASH_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"message\": \"Do you have a table for four on Friday?\"}'\n```\n\n## Authentication\n\nSend the key on every request:\n\n```http\nAuthorization: Bearer mk_live_…\n```\n\n- **One workspace per key.** A key reaches only the workspace it was created in. `GET /whoami` tells you which.\n- **Two scopes.** `read` lists and fetches. `write` changes things, places calls and runs workflows. A read-only key gets `403 forbidden` on a write operation — every operation below shows the scope it needs.\n- **Keys are tied to a person.** Revoking a key, or removing the admin who created it from the workspace, stops it at once.\n- **Keep it on a server.** CORS is open on this API so that browser-side tools (like this page's *Test request*) work, and that is only safe because the credential is a bearer token rather than a cookie. A key shipped in a public web page is a key anyone can read.\n\nA browser already signed in to the Mirakash console can call the same endpoints with its session instead of a key. A signed-in person is then held to their **workspace role** as well — each operation lists the lowest role that may call it, and it is the same rule the console applies to the same action.\n\n## Requests and responses\n\n- **Base URL:** `https://app.mirakash.com/api/v1`\n- **Inputs.** `GET` takes its inputs in the query string; `POST` and `PATCH` take a JSON body. Path parameters are part of the URL and are not repeated in the body.\n- **Success** is `200` with the result under `data`:\n\n```json\n{ \"data\": { … } }\n```\n\n- **Timestamps** are ISO 8601 strings in UTC. **IDs** are opaque strings — store them as given.\n- **New fields appear without a version change.** Read responses leniently and ignore what you do not recognise.\n- **Credentials stay in the console.** Secrets stored for you — the values of an HTTP tool's request headers, a webhook signing secret, a credential field in a workflow step, a key in a URL's query string — come back as `[redacted]` on every endpoint and every MCP tool. An `{{ENV_VAR}}` reference and descriptive headers such as `Content-Type` are shown as written.\n- **Every change is recorded.** Each non-`GET` call — over REST, or as an MCP tool — writes an `api.write` entry, naming the key, to the workspace's audit trail in the console. Reads are not recorded there.\n\n## Errors\n\nFailures carry an HTTP status and the same JSON shape on every endpoint:\n\n```json\n{ \"error\": { \"code\": \"invalid_request\", \"message\": \"agentId: Required\", \"details\": { \"agentId\": \"Required\" } } }\n```\n\n| Status | `code` | Meaning |\n|---|---|---|\n| 400 | `invalid_request` | The input failed validation, or the body is not JSON. `details` maps each bad field to what is wrong with it. |\n| 401 | `unauthorized` | No credential, or an API key that is unknown, revoked or expired. |\n| 403 | `forbidden` | A read-only key on a write operation, or a signed-in role below the operation's. |\n| 404 | `not_found` | No such object in this workspace — or no such path; `GET /capabilities` lists every one. |\n| 405 | `method_not_allowed` | The path exists with other methods; the `Allow` header names them. |\n| 409 | `conflict` | The object is not in a state this change applies to. |\n| 429 | `rate_limited` | Too many requests. Back off and retry. |\n| 500 | `internal` | Our fault. The message deliberately carries no detail. |\n| 501 | `not_implemented` | The operation exists but is not available on this deployment. |\n\n## Operations with real-world effects\n\nThese place real calls, send real messages or change what live callers hear, and none of them can be undone through the API. Build a confirmation step in front of them; MCP clients are told the same thing through `destructiveHint`.\n\n| Endpoint | MCP tool | What it does |\n|---|---|---|\n| `POST /agents/{agentId}/status` | `agents_setStatus` | Pause, resume, or archive an agent |\n| `POST /agents/{agentId}/publish` | `agents_publish` | Publish an agent, take it live |\n| `POST /campaigns/{campaignId}/status` | `campaigns_setStatus` | Start, pause, or stop a campaign |\n| `POST /campaigns/{campaignId}/contacts` | `campaigns_addContacts` | Add contacts to a voice campaign's dial list |\n| `POST /campaigns/{campaignId}/tick` | `campaigns_tick` | Advance a running campaign by one round |\n| `POST /campaigns/{campaignId}/email-contacts` | `campaigns_addEmailContacts` | Add addresses to an email campaign |\n| `DELETE /campaigns/{campaignId}/contacts/{contactId}` | `campaigns_removeContact` | Remove one contact from a campaign |\n| `POST /campaigns/{campaignId}/contacts/remove` | `campaigns_removeContacts` | Remove several contacts from a campaign |\n| `POST /campaigns/{campaignId}/purpose` | `campaigns_setPurpose` | Mark an email campaign as relationship or marketing mail |\n| `POST /escalations/{escalationId}/assign` | `escalations_assign` | Hand an escalation to a provider |\n| `DELETE /email/domains/{domain}` | `email_domains_remove` | Stop sending from a domain |\n| `DELETE /email/channels/{channelId}/forwarding-address` | `email_receiving_removeForwardingAddress` | Remove an email channel's forwarding address |\n| `POST /workflows/{workflowId}/run` | `workflows_run` | Execute a workflow for real |\n\n## MCP server\n\nThe same operations are tools on a Model Context Protocol server, for AI clients such as Claude Code, Cursor, VS Code and the OpenAI Responses API.\n\n| | |\n|---|---|\n| Endpoint | `https://app.mirakash.com/api/mcp` |\n| Transport | Streamable HTTP — `POST` JSON-RPC, JSON responses. No server-to-client stream, so `GET` answers `405`. Stateless: no session id. |\n| Protocol versions | `2025-06-18`, `2025-03-26`, `2024-11-05` |\n| Authentication | The same API key: `Authorization: Bearer mk_live_…`. A bad key is an HTTP `401`. |\n| Tool names | The operation name with `_` for `.` — `agents.list` is `agents_list`. Each operation below shows its tool. |\n| Read-only keys | See only the read tools. |\n\n**Claude Code**\n\n```bash\nclaude mcp add --transport http mirakash https://app.mirakash.com/api/mcp \\\n  --header \"Authorization: Bearer $MIRAKASH_API_KEY\"\n```\n\n**Cursor** — `~/.cursor/mcp.json` (keep this file out of version control):\n\n```json\n{\n  \"mcpServers\": {\n    \"mirakash\": {\n      \"url\": \"https://app.mirakash.com/api/mcp\",\n      \"headers\": { \"Authorization\": \"Bearer mk_live_…\" }\n    }\n  }\n}\n```\n\n**VS Code** — `.vscode/mcp.json`, prompting for the key instead of storing it:\n\n```json\n{\n  \"inputs\": [\n    { \"type\": \"promptString\", \"id\": \"mirakash-key\", \"description\": \"Mirakash API key\", \"password\": true }\n  ],\n  \"servers\": {\n    \"mirakash\": {\n      \"type\": \"http\",\n      \"url\": \"https://app.mirakash.com/api/mcp\",\n      \"headers\": { \"Authorization\": \"Bearer ${input:mirakash-key}\" }\n    }\n  }\n}\n```\n\n**Any client, by hand:**\n\n```bash\ncurl -X POST https://app.mirakash.com/api/mcp \\\n  -H \"Authorization: Bearer $MIRAKASH_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\"}'\n```\n\nClaude.ai and ChatGPT add remote connectors through an OAuth sign-in, which this server does not offer yet; it takes API keys only. Use one of the clients above, or the platform APIs that accept a bearer token.\n\nMore detail, including how tool results and errors come back: [mirakash.com/docs/mcp](https://mirakash.com/docs/mcp).","termsOfService":"https://mirakash.com/terms","contact":{"name":"Mirakash","url":"https://mirakash.com/contact"}},"externalDocs":{"description":"Connect an AI client to the Mirakash MCP server","url":"https://mirakash.com/docs/mcp"},"servers":[{"url":"https://app.mirakash.com/api/v1","description":"Production"}],"tags":[{"name":"system","x-displayName":"Account","description":"Who a credential is and what this API can do. Call `GET /whoami` first when an integration behaves unexpectedly — a 403 on everything is almost always a read-only key or the wrong workspace."},{"name":"usage","x-displayName":"Usage","description":"How many minutes this workspace has used and how many it has left, as Settings → Billing shows them. A dashboard reading `GET /usage` shows what the console shows."},{"name":"agents","x-displayName":"Agents","description":"An agent is a configured voice-and-chat assistant: its instructions, voice, language, tools and the channels it answers on. Agents start as drafts; publishing one takes it live on its numbers and channels. `POST /agents/{agentId}/reply` talks to an agent in text, the same way a website visitor would."},{"name":"conversations","x-displayName":"Conversations","description":"Every call and chat an agent handled — phone, browser, website chat, WhatsApp, SMS — with its transcript, outcome, and whether a person had to step in. Responses include the caller's number or address, so treat them as personal data on your side."},{"name":"knowledge","x-displayName":"Knowledge","description":"The documents and web pages agents answer from. Search returns the passages an agent would be grounded on, with their sources."},{"name":"campaigns","x-displayName":"Campaigns","description":"Outbound calling and email: an agent, a list of people, and a pace. A campaign is created as a draft and dials or sends nothing until it is set running. By default a voice campaign dials only inside each contact's own local calling hours (`respectLocalWindow`), and numbers on the workspace's opt-out list are never dialled — they are counted as `suppressed`. An email campaign sends from one of the workspace's email channels on a verified domain, only to addresses with a recorded consent, with an unsubscribe link in every email; replies come back to the campaign's agent as conversations."},{"name":"email","x-displayName":"Email","description":"Sending from the workspace's own domain, and how mail reaches its agents. Add a domain to get the DNS records to publish; it verifies on its own once they are public, and `POST /email/domains/{domain}/dns-check` says which record is missing or wrong and why. A setup link hands the records to whoever runs the DNS without giving them a login. Replies come back on a reply subdomain, or through a forwarding address that works before the DNS is done. Health shows bounces and complaints, which pause campaigns when they climb."},{"name":"escalations","x-displayName":"Escalations","description":"Conversations an agent handed to a human: the queue, who could take each one, and closing them out."},{"name":"numbers","x-displayName":"Phone numbers","description":"The phone numbers this workspace can answer and call from."},{"name":"channels","x-displayName":"Channels","description":"The messaging and web channels connected to this workspace."},{"name":"compliance","x-displayName":"Compliance status","description":"The workspace's identity verification, its per-country registrations (10DLC in the US, DLT in India and so on) and whether telephony is suspended. When a call or campaign is refused, the reason is usually here — read it before starting a campaign."},{"name":"tools","x-displayName":"Tools","description":"The workspace's tool library — the actions agents can take during a conversation."},{"name":"workflows","x-displayName":"Workflows","description":"Multi-step automations built in the console. Running one through the API runs it for real, with the same effects as running it there."}],"x-tagGroups":[{"name":"Start here","tags":["system","usage"]},{"name":"Build","tags":["agents","knowledge","tools","workflows"]},{"name":"Operate","tags":["conversations","escalations","campaigns"]},{"name":"Telephony","tags":["numbers","channels","compliance"]},{"name":"Email","tags":["email"]}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"mk_live_…","description":"A workspace API key (`mk_live_…`), created by a workspace admin in Settings → API keys. Shown once at creation; keep it server-side."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/whoami":{"get":{"operationId":"system_whoami","summary":"Who this credential is, and what it may do","description":"**MCP tool:** `system_whoami` · **API key scope:** `read`\n\nThe workspace this key or session is scoped to, the scopes it holds, and how it authenticated. Call this first when a connector is behaving unexpectedly — a 403 on everything is almost always a read-only key.","tags":["system"],"x-mcp-tool":"system_whoami","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"organizationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace every call with this credential is scoped to."},"scopes":{"type":"array","items":{"type":"string","enum":["read","write"]},"description":"`read`, or `read` and `write`."},"authenticatedVia":{"type":"string","enum":["api-key","session"],"description":"An API key, or a signed-in person's session."},"keyId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The API key's id when authenticated with one; null for a session."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The signed-in person's id for a session; null for an API key."}},"required":["organizationId","scopes","authenticatedVia","keyId","userId"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/capabilities":{"get":{"operationId":"system_capabilities","summary":"Everything this API can do","description":"**MCP tool:** `system_capabilities` · **API key scope:** `read`\n\nThe full operation catalogue: name, method and path, what each one is for, the scope it needs, and whether it changes the world irreversibly. The same list backs the MCP tools and the OpenAPI document, so nothing here can be out of date with either.","tags":["system"],"x-mcp-tool":"system_capabilities","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"includeSchemas","in":"query","required":false,"schema":{"description":"Include each operation's full JSON Schema. Large — off by default.","type":"boolean"},"description":"Include each operation's full JSON Schema. Large — off by default."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"operations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Dotted operation name, e.g. `agents.list`. The MCP tool is the same with `_` for `.`."},"method":{"type":"string","enum":["GET","POST","PATCH","DELETE"]},"path":{"type":"string","description":"Full path, e.g. `/api/v1/agents/{agentId}`."},"summary":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string","enum":["read","write"]},"destructive":{"type":"boolean","description":"True when calling it has real-world effects that cannot be undone from here."},"inputSchema":{"description":"JSON Schema of the input; only with `includeSchemas=true`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","method","path","summary","description","scope","destructive"]}}},"required":["operations"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"operationId":"usage_get","summary":"Minutes used and remaining","description":"**MCP tool:** `usage_get` · **API key scope:** `read` · **Signed-in role:** Admin or above\n\nHow many minutes this workspace has used and how many it has left: the numbers Settings → Billing shows, from the same allowance every call and chat turn is charged to, rounded to whole minutes as the console rounds them, with the exact seconds beside them.","tags":["usage"],"x-mcp-tool":"usage_get","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"minutes":{"type":"object","properties":{"credit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Every minutes this workspace has been given or bought, in total."},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The minutes it has spent: calls, and chat turns at their billed length."},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The minutes it has left, never below zero. Null when the workspace has no limit."}},"required":["credit","used","remaining"],"description":"Whole minutes, rounded as Settings → Billing shows them."},"seconds":{"type":"object","properties":{"credit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Every seconds this workspace has been given or bought, in total."},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The seconds it has spent: calls, and chat turns at their billed length."},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The seconds it has left, never below zero. Null when the workspace has no limit."}},"required":["credit","used","remaining"],"description":"The exact seconds behind the minutes."}},"required":["minutes","seconds"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents":{"get":{"operationId":"agents_list","summary":"List the workspace's agents","description":"**MCP tool:** `agents_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nEvery agent in the workspace, newest change first, as a short summary: id, name, handle, status (LIVE / DRAFT / PAUSED / ARCHIVED), direction, language, and whether it has tools and knowledge. Start here to find an agent's id, then use agents.get for the full configuration or agents.reply to talk to it.","tags":["agents"],"x-mcp-tool":"agents_list","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"description":"Only agents in this state.","type":"string","enum":["LIVE","DRAFT","PAUSED","ARCHIVED"]},"description":"Only agents in this state."},{"name":"q","in":"query","required":false,"schema":{"description":"Case-insensitive match on name, handle, or description.","type":"string"},"description":"Case-insensitive match on name, handle, or description."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string","description":"A short slug for the agent, unique on the platform."},"description":{"type":"string"},"status":{"type":"string","enum":["DRAFT","LIVE","PAUSED","ARCHIVED"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"],"description":"Whether the agent answers calls, places them, or both."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary language as a BCP-47 tag, e.g. `de-DE`."},"channels":{"anyOf":[{"type":"array","items":{"type":"string","enum":["phone","web","whatsapp","sms","email"]}},{"type":"null"}],"description":"Where the agent answers. Null for agents saved before channels existed."},"toolCount":{"type":"number","description":"How many tools the agent carries."},"knowledgeEnabled":{"type":"boolean","description":"Whether the agent retrieves from its knowledge sources."},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","handle","description","status","direction","language","channels","toolCount","knowledgeEnabled","updatedAt"]}},"total":{"type":"number"}},"required":["agents","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"agents_create","summary":"Create a draft agent","description":"**MCP tool:** `agents_create` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nCreates an agent in DRAFT with sensible defaults, optionally seeded with a name, description, and system prompt. A draft answers nowhere until it is published, so this is safe to call while working something out. Use agents.update to fill it in and agents.publish to take it live.","tags":["agents"],"x-mcp-tool":"agents_create","x-scope":"write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Display name, e.g. 'Front desk'."},"description":{"description":"One line on what this agent is for.","type":"string","maxLength":500},"instructions":{"description":"The agent's system prompt — who it is and how it should behave. Omit to start from the platform default.","type":"string","maxLength":20000}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string","description":"A short slug for the agent, unique on the platform."},"description":{"type":"string"},"status":{"type":"string","enum":["DRAFT","LIVE","PAUSED","ARCHIVED"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"],"description":"Whether the agent answers calls, places them, or both."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary language as a BCP-47 tag, e.g. `de-DE`."},"channels":{"anyOf":[{"type":"array","items":{"type":"string","enum":["phone","web","whatsapp","sms","email"]}},{"type":"null"}],"description":"Where the agent answers. Null for agents saved before channels existed."},"toolCount":{"type":"number","description":"How many tools the agent carries."},"knowledgeEnabled":{"type":"boolean","description":"Whether the agent retrieves from its knowledge sources."},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","handle","description","status","direction","language","channels","toolCount","knowledgeEnabled","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{agentId}":{"get":{"operationId":"agents_get","summary":"Fetch one agent's full configuration","description":"**MCP tool:** `agents_get` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nThe complete agent: identity and language, voice, model settings, the system prompt and playbook, the tools it may call, and its knowledge configuration. This is a large object — prefer agents.list when you only need to identify an agent.","tags":["agents"],"x-mcp-tool":"agents_get","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The agent's id."},"description":"The agent's id."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string","description":"A short slug for the agent, unique on the platform."},"name":{"type":"string"},"description":{"type":"string"},"avatarColor":{"type":"string"},"avatarIcon":{"type":"string"},"status":{"type":"string","enum":["DRAFT","LIVE","PAUSED","ARCHIVED"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"],"description":"Whether the agent answers calls, places them, or both."},"channels":{"description":"Where the agent answers. Absent on agents saved before channels existed.","type":"array","items":{"type":"string","enum":["phone","web","whatsapp","sms","email"]}},"identity":{"type":"object","properties":{"persona":{"type":"string"},"instructions":{"type":"string","description":"The system prompt that steers the agent."},"greeting":{"type":"string"},"primaryLanguage":{"type":"string","description":"BCP-47 tag, e.g. `de-DE`."},"additionalLanguages":{"type":"array","items":{"type":"string"}},"tone":{"type":"string"},"domain":{"description":"Free-text kind of business the agent works in, e.g. `clinic-inbound`.","type":"string"},"knownContact":{"type":"object","description":"The record an outbound agent already holds about the person it is calling."},"knownContactUrl":{"description":"Endpoint fetched at call time to fill `knownContact`.","type":"string"}},"required":["persona","instructions","greeting","primaryLanguage","additionalLanguages","tone"]},"voice":{"type":"object","properties":{"ttsProvider":{"type":"string","enum":["elevenlabs","cartesia","playht","rime","lmnt","deepgram","openai","azure","sarvam","self-host-kokoro","self-host-orpheus"]},"voiceId":{"type":"string"},"voiceName":{"type":"string"},"vendorVoice":{"description":"The name of a vendor voice (a cloned voice's), with the id and vendor it names. It names the voice in `voiceId` only while its `id` equals `voiceId`; otherwise it is left over from an earlier choice and names nothing.","type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"}},"required":["id","name"]},"ttsModel":{"type":"string"},"speed":{"type":"number","description":"Speaking rate, 0.5 to 2."},"stability":{"type":"number","description":"0 to 1."},"sttProvider":{"type":"string","enum":["cartesia","deepgram-eu","assemblyai-eu","gladia-eu","sarvam","self-host-parakeet","self-host-kyutai","whisperx"]},"sttModel":{"type":"string"},"brain":{"description":"`native` answers on Gemini Live native audio whatever the vendors above; `auto` (the default) decides from them.","type":"string","enum":["auto","native"]},"backgroundSound":{"description":"Ambient sound mixed under the agent's voice. Absent means silence.","type":"object","properties":{"kind":{"type":"string","enum":["off","office","call-center","cafe","custom"]},"volume":{"type":"number","description":"Mix level under the voice, 0 to 1."},"customUrl":{"description":"For `custom`: the looping clip to play.","type":"string"}},"required":["kind","volume"]},"followCallerLanguage":{"description":"Switch mid-call to the caller's language, among `identity.additionalLanguages`.","type":"boolean"},"languageVoices":{"description":"The voice for each additional language, keyed by base language code such as `hi`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"voiceId":{"type":"string"},"ttsModel":{"type":"string"}}}}},"required":["ttsProvider","voiceId","voiceName","ttsModel","speed","stability","sttProvider","sttModel"]},"llm":{"type":"object","properties":{"provider":{"type":"string","enum":["azure-openai-eu","gemini-live-eu","self-host","openai","sarvam"]},"model":{"type":"string"},"temperature":{"type":"number"},"maxTokens":{"type":"number"}},"required":["provider","model","temperature","maxTokens"]},"playbook":{"type":"object","description":"Staged sales playbook: methodology and stages."},"skills":{"type":"array","items":{"type":"object","description":"A reusable core-agent skill, with this agent's overrides."}},"knowledge":{"type":"object","properties":{"ragEnabled":{"type":"boolean","description":"Whether the agent retrieves from its knowledge sources."},"webSearch":{"type":"boolean"},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["file","url","integration","text"]},"label":{"type":"string"},"ref":{"description":"File id, URL or integration id, depending on `kind`.","type":"string"},"enabled":{"type":"boolean"}},"required":["id","kind","label","enabled"]}},"knowledgeBaseIds":{"description":"Shared knowledge bases the agent also draws on (knowledge.bases.list).","type":"array","items":{"type":"string"}},"confidence":{"description":"When retrieval comes back weak: answer anyway (`off`), say what is uncertain (`caveat`, the default), or bring in a person (`handoff`).","type":"string","enum":["off","caveat","handoff"]},"answerCache":{"description":"`auto` (the default) may reuse an earlier answer once measurement shows it is safe; `off` never does.","type":"string","enum":["auto","off"]},"siteLearning":{"description":"`auto` (the default) reads the site the widget is embedded on into the knowledge base; `off` never does.","type":"string","enum":["auto","off"]}},"required":["ragEnabled","webSearch","sources"]},"tools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function","webhook","transfer_to_human","transfer_call","transfer_to_agent","end_call","send_dtmf","send_message","knowledge_lookup","calendar","crm_lookup","label_emotion","schedule_follow_up","save_record","route_next_call","lookup_records","send_photo","send_catalogue","opt_out","send_document","verify_caller","place_order","request_payment","order_status","ask_choice","ask_form","show_media","present","show_compare","hide_media","guide_page","drive_page","use_computer"],"description":"What kind of tool: an HTTP `webhook`, or a built-in such as `transfer_to_human` or `send_message`."},"name":{"type":"string"},"description":{"type":"string"},"endpoint":{"description":"The URL an HTTP-backed tool calls.","type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"description":"Extra request headers sent with an HTTP-backed tool's call. Values come back as `[redacted]` except `{{ENV_VAR}}` references and descriptive headers such as `Content-Type`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"shareCallerNumber":{"description":"Send the conversation's phone number as the `X-Mirakash-Caller` header (HTTP tools), or hand it to the workflow a skill runs, where a connector step can match on `{{caller_number}}`.","type":"boolean"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","enum"]},"description":{"type":"string"},"required":{"type":"boolean"},"enumValues":{"description":"The allowed values when `type` is `enum`.","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"enabled":{"type":"boolean"},"libraryToolId":{"description":"Set when the tool comes from the workspace's tool library (tools.list).","type":"string"},"workflowId":{"description":"Set when calling the tool runs a workflow (workflows.get).","type":"string"},"mcpSourceId":{"description":"Set when the tool lives on an external MCP server registered with the workspace.","type":"string"},"mcpToolName":{"description":"The tool's name on that MCP server.","type":"string"},"datasetKey":{"description":"`lookup_records`, `send_photo` and `send_catalogue`: the workspace data table the tool reads.","type":"string"},"whatsappCatalogId":{"description":"`send_catalogue` only: the WhatsApp Commerce catalogue the table is fed into.","type":"string"},"orderingKey":{"description":"`place_order` only: the ordering profile the tool sells from.","type":"string"},"routineKey":{"description":"`use_computer` only: the routine the tool runs.","type":"string"}},"required":["id","type","name","enabled"]}},"widget":{"type":"object","description":"Web widget settings: appearance, interactive surfaces, and what it may show."},"handoff":{"type":"object","description":"Which other agents in the workspace this one may hand a live call to."},"behavior":{"type":"object","description":"Turn-taking, barge-in, latency profile, call limits and voicemail handling."},"guardrails":{"type":"object","description":"AI disclosure, recording consent, prohibited topics, rules, redaction and retention."},"compliance":{"type":"object","description":"Deployment profile, data residency, lawful basis and consent requirements."},"telephony":{"type":"object","description":"Carrier, phone numbers, caller ID, routing, live transfer and callback settings."},"evaluation":{"type":"object","description":"The QA rubric calls are scored against, and the pass threshold."},"analysis":{"type":"object","description":"Post-call analysis: summary, success evaluation, data extraction, rating question, end-of-call webhook."},"version":{"type":"number","description":"Incremented on every publish."},"lastDeployedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"organizationId":{"description":"The workspace that owns the agent.","type":"string"}},"required":["id","handle","name","description","avatarColor","avatarIcon","status","direction","identity","voice","llm","knowledge","tools","behavior","guardrails","compliance","telephony","evaluation","analysis","version","lastDeployedAt","createdAt","updatedAt","createdBy"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"agents_update","summary":"Change an agent's name, description, or instructions","description":"**MCP tool:** `agents_update` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nA shallow patch of the fields most worth editing from outside the console. Anything omitted is left alone. Editing a LIVE agent changes what callers hear on the next call, so prefer editing a draft and publishing it.","tags":["agents"],"x-mcp-tool":"agents_update","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The agent's id."},"description":"The agent's id."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"instructions":{"description":"Replaces the agent's system prompt outright.","type":"string","maxLength":20000}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string","description":"A short slug for the agent, unique on the platform."},"description":{"type":"string"},"status":{"type":"string","enum":["DRAFT","LIVE","PAUSED","ARCHIVED"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"],"description":"Whether the agent answers calls, places them, or both."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary language as a BCP-47 tag, e.g. `de-DE`."},"channels":{"anyOf":[{"type":"array","items":{"type":"string","enum":["phone","web","whatsapp","sms","email"]}},{"type":"null"}],"description":"Where the agent answers. Null for agents saved before channels existed."},"toolCount":{"type":"number","description":"How many tools the agent carries."},"knowledgeEnabled":{"type":"boolean","description":"Whether the agent retrieves from its knowledge sources."},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","handle","description","status","direction","language","channels","toolCount","knowledgeEnabled","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{agentId}/status":{"post":{"operationId":"agents_setStatus","summary":"Pause, resume, or archive an agent","description":"**MCP tool:** `agents_setStatus` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nMoves an agent between LIVE, PAUSED, DRAFT and ARCHIVED. Pausing a LIVE agent stops it answering immediately — calls to its numbers stop being handled — so this reaches real callers. Publishing is a separate operation because it also stamps a version.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["agents"],"x-mcp-tool":"agents_setStatus","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The agent's id."},"description":"The agent's id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["LIVE","DRAFT","PAUSED","ARCHIVED"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string","description":"A short slug for the agent, unique on the platform."},"description":{"type":"string"},"status":{"type":"string","enum":["DRAFT","LIVE","PAUSED","ARCHIVED"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"],"description":"Whether the agent answers calls, places them, or both."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary language as a BCP-47 tag, e.g. `de-DE`."},"channels":{"anyOf":[{"type":"array","items":{"type":"string","enum":["phone","web","whatsapp","sms","email"]}},{"type":"null"}],"description":"Where the agent answers. Null for agents saved before channels existed."},"toolCount":{"type":"number","description":"How many tools the agent carries."},"knowledgeEnabled":{"type":"boolean","description":"Whether the agent retrieves from its knowledge sources."},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","handle","description","status","direction","language","channels","toolCount","knowledgeEnabled","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{agentId}/publish":{"post":{"operationId":"agents_publish","summary":"Publish an agent, take it live","description":"**MCP tool:** `agents_publish` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nMarks the agent LIVE and stamps the deploy time. From this point its numbers and channels route real traffic to the current configuration. This affects the outside world; confirm with the operator before calling it.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["agents"],"x-mcp-tool":"agents_publish","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The agent's id."},"description":"The agent's id."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"handle":{"type":"string","description":"A short slug for the agent, unique on the platform."},"description":{"type":"string"},"status":{"type":"string","enum":["DRAFT","LIVE","PAUSED","ARCHIVED"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"],"description":"Whether the agent answers calls, places them, or both."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary language as a BCP-47 tag, e.g. `de-DE`."},"channels":{"anyOf":[{"type":"array","items":{"type":"string","enum":["phone","web","whatsapp","sms","email"]}},{"type":"null"}],"description":"Where the agent answers. Null for agents saved before channels existed."},"toolCount":{"type":"number","description":"How many tools the agent carries."},"knowledgeEnabled":{"type":"boolean","description":"Whether the agent retrieves from its knowledge sources."},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","handle","description","status","direction","language","channels","toolCount","knowledgeEnabled","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{agentId}/reply":{"post":{"operationId":"agents_reply","summary":"Send a message to an agent and get its reply","description":"**MCP tool:** `agents_reply` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nRuns one real turn of the agent: its own prompt, model, tools and knowledge, exactly as a caller would get. Pass the conversation so far in `history` (oldest first) and the new message in `message`; the reply comes back with the model used, any tools it actually invoked, whether it asked to escalate to a human, and the cost of the turn. Note that tools run FOR REAL — an agent wired to book appointments will book one.","tags":["agents"],"x-mcp-tool":"agents_reply","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"The agent's id."},"description":"The agent's id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":8000,"description":"What the person just said."},"history":{"description":"The conversation so far, oldest first. Omit to start a new one.","maxItems":200,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","agent","system"]},"text":{"type":"string"}},"required":["role","text"]}}},"required":["message"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reply":{"type":"string","description":"What the agent said."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The model that wrote the reply, e.g. `anthropic · claude-haiku-4-5`. Null when none was reported."},"escalated":{"type":"boolean","description":"A guardrail or a tool asked to hand the conversation to a human this turn."},"endCall":{"type":"boolean","description":"The agent asked to end the conversation (its `end_call` tool)."},"notes":{"type":"array","items":{"type":"string"},"description":"Compliance, guardrail and debug notes about the turn."},"toolInvocations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"ok":{"type":"boolean"},"summary":{"type":"string"},"record":{"description":"For a side-effecting call that ran: one line of what was asked and what came back.","type":"string"}},"required":["name","ok","summary"]},"description":"Tools that actually ran during the turn."},"cost":{"anyOf":[{"type":"object","properties":{"llmInput":{"type":"number","description":"Model input tokens, in USD."},"llmOutput":{"type":"number","description":"Model output tokens, in USD."},"tts":{"type":"number","description":"Text-to-speech, in USD. 0 for text."},"stt":{"type":"number","description":"Speech-to-text, in USD. 0 for text."},"transport":{"type":"number","description":"Telephony or other transport, in USD."},"tools":{"type":"number","description":"Tool calls, in USD."},"total":{"type":"number","description":"Sum of the lines above, in USD."},"currency":{"type":"string","const":"usd"},"source":{"type":"string","enum":["text","voice","pipeline"]},"model":{"description":"Model label, e.g. `anthropic · claude-haiku-4-5`.","type":"string"},"usage":{"description":"The raw token counts behind the figures.","type":"object","properties":{"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cachedInputTokens":{"description":"The part of `inputTokens` the provider served from its prompt cache.","type":"number"},"promptTextTokens":{"type":"number"},"promptAudioTokens":{"type":"number"},"responseTextTokens":{"type":"number"},"responseAudioTokens":{"type":"number"},"promptResidualTokens":{"description":"Input tokens the provider counted but did not attribute to text or audio; billed as text.","type":"number"},"responseResidualTokens":{"type":"number"},"totalTokens":{"type":"number"}}},"stack":{"description":"Which vendor billed each line, in that vendor's own units.","type":"object","properties":{"llm":{"type":"string"},"stt":{"type":"object","properties":{"vendor":{"type":"string"},"model":{"type":"string"},"seconds":{"type":"number"},"handedTo":{"type":"array","items":{"type":"string"}}},"required":["vendor"]},"tts":{"type":"object","properties":{"vendor":{"type":"string"},"model":{"type":"string"},"characters":{"type":"number"},"handedTo":{"type":"array","items":{"type":"string"}}},"required":["vendor"]},"transport":{"type":"object","properties":{"vendor":{"type":"string"},"minutes":{"type":"number"}},"required":["vendor"]}}},"unpriced":{"description":"Lines whose vendor has no known rate, so they were counted as $0 and the total is low.","type":"array","items":{"type":"string"}}},"required":["llmInput","llmOutput","tts","stt","transport","tools","total","currency","source"]},{"type":"null"}],"description":"The turn's itemised cost. Null when the provider reported no usage."}},"required":["reply","model","escalated","endCall","notes","toolInvocations","cost"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations":{"get":{"operationId":"conversations_list","summary":"List conversations (calls and chats)","description":"**MCP tool:** `conversations_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nConversations, newest first, with the agent, channel, duration, outcome, sentiment and score. Filter by agent, channel, outcome, flagged or escalated, a date range (`from`, `to`), or `q`, text matched in the summary, the customer ref or the agent's name. Use conversations.get for the full transcript of one. A page holds up to `take` conversations; `matching` is how many the filters hold in all. To read the rest, pass `nextCursor` back as `cursor` with the same filters, until `nextCursor` is null. A phone call is saved when it ends, under the time it started. So a conversation can appear after you have paged or synced past its start time, and the same one can come back with a new outcome. To sync by `from`/`to`, overlap each window with the one before by your longest call, and skip ids you already have.","tags":["conversations"],"x-mcp-tool":"conversations_list","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"query","required":false,"schema":{"description":"Only this agent's conversations.","type":"string"},"description":"Only this agent's conversations."},{"name":"channel","in":"query","required":false,"schema":{"description":"Surface it happened on — e.g. 'phone', 'widget', 'whatsapp'.","type":"string"},"description":"Surface it happened on — e.g. 'phone', 'widget', 'whatsapp'."},{"name":"outcome","in":"query","required":false,"schema":{"description":"Only conversations that ended this way: `CONTAINED` (resolved without a human), `ESCALATED` (handed to a human), `ABANDONED` (the caller left), `VOICEMAIL`, `FAILED` (never got going, or its record was lost), or `IN_PROGRESS`.","type":"string","enum":["IN_PROGRESS","CONTAINED","ESCALATED","ABANDONED","VOICEMAIL","FAILED"]},"description":"Only conversations that ended this way: `CONTAINED` (resolved without a human), `ESCALATED` (handed to a human), `ABANDONED` (the caller left), `VOICEMAIL`, `FAILED` (never got going, or its record was lost), or `IN_PROGRESS`."},{"name":"flaggedOnly","in":"query","required":false,"schema":{"description":"Only conversations flagged for review.","type":"boolean"},"description":"Only conversations flagged for review."},{"name":"escalatedOnly","in":"query","required":false,"schema":{"description":"Only ones handed to a human.","type":"boolean"},"description":"Only ones handed to a human."},{"name":"q","in":"query","required":false,"schema":{"description":"Text to find in the summary, the customer ref or the agent's name, in any letter case.","type":"string"},"description":"Text to find in the summary, the customer ref or the agent's name, in any letter case."},{"name":"from","in":"query","required":false,"schema":{"description":"Only conversations that started at or after this time. An ISO 8601 time with its zone, e.g. `2026-11-01T00:00:00+05:30`. For \"today\" or \"the last 7 days\", send the midnight that starts it in your own time zone and leave `to` out.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only conversations that started at or after this time. An ISO 8601 time with its zone, e.g. `2026-11-01T00:00:00+05:30`. For \"today\" or \"the last 7 days\", send the midnight that starts it in your own time zone and leave `to` out."},{"name":"to","in":"query","required":false,"schema":{"description":"Only conversations that started before this time (so `from` 1 Nov and `to` 16 Nov is 1 to 15 November). Same format as `from`. Leave it out to run up to now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only conversations that started before this time (so `from` 1 Nov and `to` 16 Nov is 1 to 15 November). Same format as `from`. Leave it out to run up to now."},{"name":"take","in":"query","required":false,"schema":{"default":50,"description":"How many to return in this page, newest first (at most 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return in this page, newest first (at most 200)."},{"name":"cursor","in":"query","required":false,"schema":{"description":"The previous page's `nextCursor`, to read the page after it. Leave it out (or empty) for the first page.","type":"string"},"description":"The previous page's `nextCursor`, to read the page after it. Leave it out (or empty) for the first page."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"conversations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"agentHandle":{"type":"string"},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"]},"channel":{"type":"string","description":"Where it happened, e.g. `voice` (a phone call), `widget` (website chat), `chat`, or a messaging channel. Imported human-rep calls are `external`."},"language":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"durationSec":{"type":"number"},"outcome":{"type":"string","enum":["IN_PROGRESS","CONTAINED","ESCALATED","ABANDONED","VOICEMAIL","FAILED"],"description":"How it ended. `VOICEMAIL`: an answering machine or network announcement picked up; never billed. `FAILED`: the call never got going (the session was refused or the agent could not start), or its record was lost; never billed."},"reviewStatus":{"type":"string","enum":["UNREVIEWED","IN_REVIEW","COMPLETED"]},"escalated":{"type":"boolean","description":"Handed to a human."},"containment":{"type":"boolean","description":"Resolved without a human."},"sentiment":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"-1 (negative) to 1 (positive)."},"qaScorePct":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Score from the AI (or latest) scorecard, 0 to 100."},"issueCount":{"type":"number"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerRef":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The other party, as a pseudonymised phone number or email."},"answeredBy":{"anyOf":[{"type":"string","enum":["human","machine","fax","unknown"]},{"type":"null"}],"description":"Answering-machine detection's verdict. Null when detection never ran, e.g. on a chat."},"billable":{"type":"boolean","description":"False when the customer was not charged for this conversation; `billing.reason` says why."},"billing":{"anyOf":[{"type":"object","properties":{"billable":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["machine","fax","unanswered","failed","test","below_minimum","zero_duration"]},{"type":"null"}],"description":"Why it was not billed, when `billable` is false."},"rawSec":{"type":"number","description":"The measured length."},"billedSec":{"type":"number","description":"Seconds charged, after minimum and rounding. 0 when not billable."},"billedMinutes":{"type":"number","description":"`billedSec / 60`, unrounded."},"waivedSec":{"type":"number","description":"Seconds not charged."},"granularity":{"type":"string","enum":["second","six_second","minute"],"description":"The increment billing rounds up to."},"note":{"type":"string","description":"One-line explanation of the arithmetic."}},"required":["billable","reason","rawSec","billedSec","billedMinutes","waivedSec","granularity","note"]},{"type":"null"}],"description":"The metering decision, when one was recorded."}},"required":["id","agentId","agentName","agentHandle","direction","channel","language","startedAt","durationSec","outcome","reviewStatus","escalated","containment","sentiment","qaScorePct","issueCount","summary","customerRef","answeredBy","billable","billing"]}},"total":{"type":"number","description":"How many came back in this page."},"matching":{"type":"number","description":"How many conversations the filters hold in all, across every page."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass this as `cursor` for the next page. Null on the last page."}},"required":["conversations","total","matching","nextCursor"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{conversationId}":{"get":{"operationId":"conversations_get","summary":"Fetch one conversation with its transcript","description":"**MCP tool:** `conversations_get` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nThe whole conversation: every turn with timing and speaker, the tools the agent invoked, the scorecard if it has been judged, any issues raised against it, and the cost of the call.","tags":["conversations"],"x-mcp-tool":"conversations_get","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"agentHandle":{"type":"string"},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BOTH"]},"channel":{"type":"string","description":"Where it happened, e.g. `voice` (a phone call), `widget` (website chat), `chat`, or a messaging channel. Imported human-rep calls are `external`."},"language":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"durationSec":{"type":"number"},"outcome":{"type":"string","enum":["IN_PROGRESS","CONTAINED","ESCALATED","ABANDONED","VOICEMAIL","FAILED"],"description":"How it ended. `VOICEMAIL`: an answering machine or network announcement picked up; never billed. `FAILED`: the call never got going (the session was refused or the agent could not start), or its record was lost; never billed."},"reviewStatus":{"type":"string","enum":["UNREVIEWED","IN_REVIEW","COMPLETED"]},"escalated":{"type":"boolean","description":"Handed to a human."},"containment":{"type":"boolean","description":"Resolved without a human."},"sentiment":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"-1 (negative) to 1 (positive)."},"qaScorePct":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Score from the AI (or latest) scorecard, 0 to 100."},"issueCount":{"type":"number"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"customerRef":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The other party, as a pseudonymised phone number or email."},"answeredBy":{"anyOf":[{"type":"string","enum":["human","machine","fax","unknown"]},{"type":"null"}],"description":"Answering-machine detection's verdict. Null when detection never ran, e.g. on a chat."},"billable":{"type":"boolean","description":"False when the customer was not charged for this conversation; `billing.reason` says why."},"billing":{"anyOf":[{"type":"object","properties":{"billable":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["machine","fax","unanswered","failed","test","below_minimum","zero_duration"]},{"type":"null"}],"description":"Why it was not billed, when `billable` is false."},"rawSec":{"type":"number","description":"The measured length."},"billedSec":{"type":"number","description":"Seconds charged, after minimum and rounding. 0 when not billable."},"billedMinutes":{"type":"number","description":"`billedSec / 60`, unrounded."},"waivedSec":{"type":"number","description":"Seconds not charged."},"granularity":{"type":"string","enum":["second","six_second","minute"],"description":"The increment billing rounds up to."},"note":{"type":"string","description":"One-line explanation of the arithmetic."}},"required":["billable","reason","rawSec","billedSec","billedMinutes","waivedSec","granularity","note"]},{"type":"null"}],"description":"The metering decision, when one was recorded."},"endedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ordinal":{"type":"number"},"role":{"type":"string","enum":["AGENT","CUSTOMER","HUMAN","SYSTEM"]},"content":{"type":"string"},"startMs":{"type":"number"},"endMs":{"type":"number"},"sentiment":{"anyOf":[{"type":"number"},{"type":"null"}]},"flagged":{"type":"boolean"},"citations":{"description":"Agent turns only: the passages the agent was reading. Null means retrieval was not running; empty means it found nothing.","anyOf":[{"type":"array","items":{"type":"object","properties":{"sourceId":{"type":"string"},"sourceLabel":{"type":"string"},"score":{"type":"number","description":"The retrieval score, on its own ranker's scale."},"method":{"type":"string","enum":["vector","lexical"]},"used":{"type":"boolean","description":"Whether the reply carried this passage's distinctive words."},"overlap":{"type":"number","description":"Share of the passage's distinctive terms that appear in the reply, 0 to 1."},"copies":{"description":"How many identical passages were collapsed into this one. Absent means one.","type":"number"}},"required":["sourceId","sourceLabel","score","used","overlap"]}},{"type":"null"}]}},"required":["id","ordinal","role","content","startMs","endMs","sentiment","flagged"]},"description":"The transcript, in order."},"toolInvocations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ok":{"type":"boolean"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"ordinal":{"type":"number"}},"required":["id","name","ok","summary","ordinal"]}},"scorecards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reviewerType":{"type":"string","enum":["AI","HUMAN"]},"reviewerRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalScore":{"type":"number"},"maxScore":{"type":"number"},"pct":{"type":"number","description":"0 to 100."},"items":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"question":{"type":"string"},"score":{"type":"number"},"maxScore":{"type":"number"},"remark":{"type":"string"}},"required":["ref","question","score","maxScore"]}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","reviewerType","reviewerRef","totalScore","maxScore","pct","items","createdAt"]},"description":"QA scorecards, newest first."},"issues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string","enum":["AI_FLAG","RULE","HUMAN"]},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","source","severity","category","evidence"]}},"analysis":{"description":"Post-call analysis. The summary itself is the top-level `summary`.","anyOf":[{"type":"object","properties":{"successEvaluation":{"type":"object","properties":{"rubric":{"type":"string"},"result":{"type":"string"},"passed":{"type":"boolean"}},"required":["rubric","result","passed"]},"extractedData":{"description":"Fields pulled out of the transcript, as the agent's extraction settings name them.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"model":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"widget":{"description":"Website-widget conversations: where the visitor was, and what they answered on screen.","type":"object","properties":{"sessionId":{"type":"string"},"pageUrl":{"type":"string"},"answers":{"type":"array","items":{}},"collected":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"labels":{"description":"The question the visitor read, per `collected` key.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}}},"wrapUp":{"description":"The wrap-up note, when one was written.","type":"object","properties":{"summary":{"type":"string"},"outcome":{"type":"string","enum":["resolved","pending","escalated","unclear"]},"nextStep":{"anyOf":[{"type":"string"},{"type":"null"}]},"commitments":{"type":"array","items":{"type":"string"}},"dropped":{"type":"array","items":{"type":"string"},"description":"Claims the transcript did not support, refused rather than written."},"by":{"type":"string","const":"model"},"generatedAt":{"type":"string","format":"date-time"}},"required":["summary","outcome","nextStep","commitments","dropped","by","generatedAt"]}}},{"type":"null"}]},"cost":{"description":"Itemised cost. Null when none was recorded.","anyOf":[{"type":"object","properties":{"llmInput":{"type":"number","description":"Model input tokens, in USD."},"llmOutput":{"type":"number","description":"Model output tokens, in USD."},"tts":{"type":"number","description":"Text-to-speech, in USD. 0 for text."},"stt":{"type":"number","description":"Speech-to-text, in USD. 0 for text."},"transport":{"type":"number","description":"Telephony or other transport, in USD."},"tools":{"type":"number","description":"Tool calls, in USD."},"total":{"type":"number","description":"Sum of the lines above, in USD."},"currency":{"type":"string","const":"usd"},"source":{"type":"string","enum":["text","voice","pipeline"]},"model":{"description":"Model label, e.g. `anthropic · claude-haiku-4-5`.","type":"string"},"usage":{"description":"The raw token counts behind the figures.","type":"object","properties":{"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"cachedInputTokens":{"description":"The part of `inputTokens` the provider served from its prompt cache.","type":"number"},"promptTextTokens":{"type":"number"},"promptAudioTokens":{"type":"number"},"responseTextTokens":{"type":"number"},"responseAudioTokens":{"type":"number"},"promptResidualTokens":{"description":"Input tokens the provider counted but did not attribute to text or audio; billed as text.","type":"number"},"responseResidualTokens":{"type":"number"},"totalTokens":{"type":"number"}}},"stack":{"description":"Which vendor billed each line, in that vendor's own units.","type":"object","properties":{"llm":{"type":"string"},"stt":{"type":"object","properties":{"vendor":{"type":"string"},"model":{"type":"string"},"seconds":{"type":"number"},"handedTo":{"type":"array","items":{"type":"string"}}},"required":["vendor"]},"tts":{"type":"object","properties":{"vendor":{"type":"string"},"model":{"type":"string"},"characters":{"type":"number"},"handedTo":{"type":"array","items":{"type":"string"}}},"required":["vendor"]},"transport":{"type":"object","properties":{"vendor":{"type":"string"},"minutes":{"type":"number"}},"required":["vendor"]}}},"unpriced":{"description":"Lines whose vendor has no known rate, so they were counted as $0 and the total is low.","type":"array","items":{"type":"string"}}},"required":["llmInput","llmOutput","tts","stt","transport","tools","total","currency","source"]},{"type":"null"}]},"recording":{"description":"Audio, when it was captured and stored. Null means transcript only.","anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"Our own authenticated route to the audio, not a storage-vendor URL."},"durationMs":{"type":"number"},"format":{"type":"string"},"sampleRate":{"type":"number"},"channels":{"type":"number","description":"2 is stereo: caller on the left, agent on the right."},"bytes":{"type":"number"},"truncated":{"type":"boolean","description":"The call outran the recorder's cap, so the end is missing."},"consent":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the caller was told about being recorded, verbatim."}},"required":["url","durationMs","format","sampleRate","channels","bytes","truncated","consent"]},{"type":"null"}]},"lessons":{"description":"What this call taught: tactics mined from the transcript against its score.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tactic":{"type":"string","description":"The move, in one line."},"worked":{"type":"boolean","description":"True: repeat it. False: a mistake to avoid."},"pct":{"type":"number","description":"The call's score when the lesson was extracted."},"dimensionRef":{"description":"The rubric criterion it maps to.","anyOf":[{"type":"string"},{"type":"null"}]},"evidence":{"anyOf":[{"type":"string"},{"type":"null"}]},"takeaway":{"anyOf":[{"type":"string"},{"type":"null"}]},"shared":{"type":"boolean","description":"Whether other agents may learn from it."},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"segment":{"anyOf":[{"type":"object","properties":{"role":{"description":"What they were to the matter, e.g. parent, patient, buyer.","type":"string"},"ageBand":{"description":"Only ever when they said so.","type":"string"},"gender":{"type":"string"},"region":{"type":"string"},"descriptor":{"description":"What shaped the call, e.g. `price-sensitive`.","type":"string"}},"description":"Who was on the other end, read only from what they said. Usually sparse."},{"type":"null"}]},"toolChain":{"type":"array","items":{"type":"string"},"description":"The tools that ran, in order."},"createdAt":{"type":"string","format":"date-time"},"timesSeen":{"type":"number","description":"Finished calls that produced this same lesson with this same outcome."},"repeats":{"type":"number","description":"Of those, calls that began after the lesson already existed."},"lastSeenAt":{"type":"string","format":"date-time"},"counters":{"type":"array","items":{"type":"object","properties":{"worked":{"type":"boolean"},"segment":{"anyOf":[{"type":"object","properties":{"role":{"description":"What they were to the matter, e.g. parent, patient, buyer.","type":"string"},"ageBand":{"description":"Only ever when they said so.","type":"string"},"gender":{"type":"string"},"region":{"type":"string"},"descriptor":{"description":"What shaped the call, e.g. `price-sensitive`.","type":"string"}},"description":"Who was on the other end, read only from what they said. Usually sparse."},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"pct":{"anyOf":[{"type":"number"},{"type":"null"}]},"at":{"type":"string","format":"date-time"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["worked","segment","conversationId","pct","at","note"]},"description":"Observations of the same tactic that went the other way."}},"required":["id","tactic","worked","pct","shared","toolChain","createdAt","timesSeen","repeats","lastSeenAt","counters"]}},"latency":{"description":"How long the caller waited, per stage. Null means not measured, not fast.","anyOf":[{"type":"object","properties":{"turns":{"type":"number"},"stt":{"description":"Caller's last word to final transcript, in ms.","type":"object","properties":{"count":{"type":"number"},"p50":{"type":"number"},"p95":{"type":"number"},"max":{"type":"number"}},"required":["count","p50","p95","max"]},"llm":{"description":"The agent turn, tools included, in ms.","type":"object","properties":{"count":{"type":"number"},"p50":{"type":"number"},"p95":{"type":"number"},"max":{"type":"number"}},"required":["count","p50","p95","max"]},"tts":{"description":"Text handed to the voice to its first audio, in ms.","type":"object","properties":{"count":{"type":"number"},"p50":{"type":"number"},"p95":{"type":"number"},"max":{"type":"number"}},"required":["count","p50","p95","max"]},"response":{"description":"Caller's last word to the agent's first sound, in ms.","type":"object","properties":{"count":{"type":"number"},"p50":{"type":"number"},"p95":{"type":"number"},"max":{"type":"number"}},"required":["count","p50","p95","max"]},"worst":{"description":"The slowest turn.","type":"object","properties":{"sttMs":{"type":"number"},"llmMs":{"type":"number"},"ttsMs":{"type":"number"},"responseMs":{"type":"number"}}}},"required":["turns"]},{"type":"null"}]},"redaction":{"description":"What PII redaction removed: counts and kinds, never the content. Null means nothing was found.","anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"mode":{"type":"string"},"hits":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"count":{"type":"number"}},"required":["kind","count"]},"description":"Kinds of personal data found, with counts."},"spans":{"type":"number","description":"Spans removed from the text."},"muteWindows":{"type":"number","description":"Windows of audio silenced, or to be silenced."},"audio":{"type":"string","enum":["pending","applied","skipped","not-needed"]},"audioNote":{"description":"Why the audio was not silenced, when it was not.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["at","mode","hits","spans","muteWindows","audio"]},{"type":"null"}]}},"required":["id","agentId","agentName","agentHandle","direction","channel","language","startedAt","durationSec","outcome","reviewStatus","escalated","containment","sentiment","qaScorePct","issueCount","summary","customerRef","answeredBy","billable","billing","endedAt","model","segments","toolInvocations","scorecards","issues"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/metrics":{"get":{"operationId":"conversations_metrics","summary":"Aggregate quality and volume metrics","description":"**MCP tool:** `conversations_metrics` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nRoll-up across conversations: volume, average duration, containment, escalation rate and average score. Pass an agentId to scope it to one agent. This is the right call for 'how are we doing' — it is one query instead of reading the list and counting. Imported human-rep calls (channel \"external\") are the human benchmark, not an agent's work: they count in cohortSplit only, so totalCalls and reviewBacklog can be lower than a count of conversations.list, which returns them. With `from` (no later than now, allowing a minute of clock drift) and optionally `to`, the figures cover that range, at most 366 days, and `volumeByDay` and `agentTraffic` have a day for each date in it. A few figures are about the workspace as it stands and ignore the range: `reviewBacklog`, `activityByDay`, `graduation`, `drift` (always the last 28 days), the human side of `cohortSplit`, and `satisfaction.askedEver`. Without `from`, everything covers all history and `volumeByDay` the last 14 days.","tags":["conversations"],"x-mcp-tool":"conversations_metrics","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"description":"Only conversations that started at or after this time. An ISO 8601 time with its zone, e.g. `2026-11-01T00:00:00+05:30`. For \"today\" or \"the last 7 days\", send the midnight that starts it in your own time zone and leave `to` out.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only conversations that started at or after this time. An ISO 8601 time with its zone, e.g. `2026-11-01T00:00:00+05:30`. For \"today\" or \"the last 7 days\", send the midnight that starts it in your own time zone and leave `to` out."},{"name":"to","in":"query","required":false,"schema":{"description":"Only conversations that started before this time (so `from` 1 Nov and `to` 16 Nov is 1 to 15 November). Same format as `from`. Leave it out to run up to now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only conversations that started before this time (so `from` 1 Nov and `to` 16 Nov is 1 to 15 November). Same format as `from`. Leave it out to run up to now."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"period":{"description":"The range these figures cover. Only when `from` was given.","type":"object","properties":{"days":{"type":"number","description":"Calendar days the range touches: the length of `volumeByDay`."},"since":{"type":"string","format":"date-time","description":"`from`, as UTC."},"until":{"description":"`to`, as UTC. Absent when the range runs up to now.","type":"string","format":"date-time"}},"required":["days","since"]},"previousPeriod":{"description":"What the range is compared with, for \"up / down from the previous period\": the same stretch as many whole days earlier as the range lasts, up to the same time of day. For a range still running, that is the part of it so far; for a range of whole days that has ended, the days just before it. `since` and `until` say which. Only when `from` was given.","type":"object","properties":{"since":{"type":"string","format":"date-time","description":"Where the span compared with starts, as UTC."},"until":{"type":"string","format":"date-time","description":"Where it ends, exclusive, as UTC."},"calls":{"type":"number"},"contained":{"type":"number"}},"required":["since","until","calls","contained"]},"totalCalls":{"type":"number","description":"Agent conversations in scope. Imported human-rep calls count only in `cohortSplit`."},"containmentPct":{"type":"number","description":"Share resolved without a human, 0 to 100."},"escalationPct":{"type":"number","description":"Share handed to a human, 0 to 100."},"containedCount":{"type":"number"},"escalatedCount":{"type":"number"},"unreviewedCount":{"type":"number"},"reviewBacklog":{"type":"number","description":"Agent conversations whose review is not finished."},"avgQaScorePct":{"anyOf":[{"type":"number"},{"type":"null"}]},"avgHandleSec":{"type":"number","description":"Average duration, in seconds."},"csatProxy":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"1 to 5, derived from mean sentiment. Not a rating anyone gave: that is `satisfaction.score`."},"reviewedPct":{"type":"number"},"flaggedCount":{"type":"number"},"volumeByDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"number"},"inbound":{"type":"number"},"outbound":{"type":"number"},"qaPct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["day","count","inbound","outbound","qaPct"]},"description":"A day for each date in the range (the last 14 days without `from`), oldest first. A day is a UTC date."},"outcomeBreakdown":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":"string","enum":["IN_PROGRESS","CONTAINED","ESCALATED","ABANDONED","VOICEMAIL","FAILED"],"description":"How it ended. `VOICEMAIL`: an answering machine or network announcement picked up; never billed. `FAILED`: the call never got going (the session was refused or the agent could not start), or its record was lost; never billed."},"count":{"type":"number"}},"required":["outcome","count"]}},"durationByDirection":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["TOTAL","INBOUND","OUTBOUND"]},"avgSec":{"type":"number"},"calls":{"type":"number"}},"required":["direction","avgSec","calls"]}},"outcomeByDirection":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["TOTAL","INBOUND","OUTBOUND"]},"total":{"type":"number"},"counts":{"type":"array","items":{"type":"object","properties":{"outcome":{"type":"string","enum":["IN_PROGRESS","CONTAINED","ESCALATED","ABANDONED","VOICEMAIL","FAILED"],"description":"How it ended. `VOICEMAIL`: an answering machine or network announcement picked up; never billed. `FAILED`: the call never got going (the session was refused or the agent could not start), or its record was lost; never billed."},"count":{"type":"number"}},"required":["outcome","count"]}}},"required":["direction","total","counts"]}},"perAgent":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"agentName":{"type":"string"},"calls":{"type":"number"},"containmentPct":{"type":"number"},"avgQaScorePct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["agentId","agentName","calls","containmentPct","avgQaScorePct"]}},"agentTraffic":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string"},"description":"`YYYY-MM-DD`, oldest first."},"agents":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"agentName":{"type":"string"},"total":{"type":"number"},"pct":{"type":"number","description":"The agent's share of the window's traffic."},"daily":{"type":"array","items":{"type":"number"},"description":"One count per entry of `days`."}},"required":["agentId","agentName","total","pct","daily"]}}},"required":["days","agents"],"description":"Per-agent daily volume over the active window, busiest agent first."},"activityByDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"number"}},"required":["day","count"]},"description":"Conversation counts, only for days with any."},"cohortSplit":{"type":"object","properties":{"ai":{"type":"object","properties":{"calls":{"type":"number"},"avgScorePct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["calls","avgScorePct"]},"human":{"type":"object","properties":{"calls":{"type":"number"},"avgScorePct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["calls","avgScorePct"]},"criteria":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"question":{"type":"string"},"aiPct":{"anyOf":[{"type":"number"},{"type":"null"}]},"humanPct":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["ref","question","aiPct","humanPct"]}}},"required":["ai","human","criteria"],"description":"Agent conversations against imported human-rep calls, overall and per scorecard criterion."},"economics":{"type":"object","properties":{"pricedCalls":{"type":"number","description":"Conversations with an itemised cost: the population everything here is computed over."},"unpricedCalls":{"type":"number","description":"Conversations with no cost record, left out rather than counted as free."},"understatedCalls":{"type":"number","description":"Priced conversations with a vendor line nobody has a rate for, so their total is low."},"missingRates":{"type":"array","items":{"type":"object","properties":{"line":{"type":"string"},"calls":{"type":"number"}},"required":["line","calls"]}},"totalCostUsd":{"type":"number"},"byLine":{"type":"array","items":{"type":"object","properties":{"line":{"type":"string","enum":["llm","tts","stt","transport","tools"]},"usd":{"type":"number"}},"required":["line","usd"]}},"resolvedCalls":{"type":"number","description":"Priced conversations resolved without a human."},"costPerResolutionUsd":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"`totalCostUsd / resolvedCalls`. Null when nothing was resolved."},"costPerCallUsd":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"`totalCostUsd / pricedCalls`."}},"required":["pricedCalls","unpricedCalls","understatedCalls","missingRates","totalCostUsd","byLine","resolvedCalls","costPerResolutionUsd","costPerCallUsd"],"description":"What the work cost, and what one resolved conversation cost."},"latencyByLanguage":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string","description":"BCP-47 tag, e.g. `ml-IN`, or `unknown`."},"calls":{"type":"number","description":"Calls that carried a latency reading."},"turns":{"type":"number"},"typicalMs":{"type":"number","description":"Median across calls of each call's own p50 reply time."},"worstMs":{"type":"number","description":"Maximum across calls of each call's own p95."},"transcribers":{"type":"array","items":{"type":"string"}},"voices":{"type":"array","items":{"type":"string"}}},"required":["language","calls","turns","typicalMs","worstMs","transcribers","voices"]},"description":"Reply time per language, slowest first."},"satisfaction":{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Mean of the ratings callers gave, 1 to 5. Null when nobody has rated a call."},"asked":{"type":"number","description":"Calls where the agent asked for a rating."},"askedEver":{"type":"number"},"answered":{"type":"number"},"responseRatePct":{"anyOf":[{"type":"number"},{"type":"null"}]},"proxy":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The sentiment-derived figure, as `csatProxy`."}},"required":["score","asked","askedEver","answered","responseRatePct","proxy"],"description":"Ratings callers actually gave, kept apart from the sentiment proxy."},"topics":{"type":"object","properties":{"topics":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string"},"calls":{"type":"number"},"sharePct":{"type":"number","description":"Share of the labelled calls, 0 to 100."},"containmentPct":{"type":"number"},"avgCostUsd":{"anyOf":[{"type":"number"},{"type":"null"}]},"csat":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Mean rating on this topic, 1 to 5."}},"required":["topic","calls","sharePct","containmentPct","avgCostUsd","csat"]}},"unlabelled":{"type":"number","description":"Calls with no topic."}},"required":["topics","unlabelled"],"description":"What people contacted the workspace about, most common first."},"drift":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["containment","csat","qa","handleTime","costPerResolution"]},"before":{"type":"number"},"after":{"type":"number"},"change":{"type":"number"},"worse":{"type":"boolean","description":"The change is in the direction an operator would mind."},"p":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Two-sided p-value of the test in `test`; null where none applies."},"test":{"type":"string","enum":["two-proportion","welch","none"]},"n":{"type":"object","properties":{"before":{"type":"number"},"after":{"type":"number"}},"required":["before","after"],"description":"Calls behind each side."}},"required":["metric","before","after","change","worse","p","test","n"]},"description":"Metrics that moved significantly since the previous window."},"graduation":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","description":"One topic, with the evidence on whether the agent can handle it alone."}},"unlabelled":{"type":"number"},"labelled":{"type":"number"},"readySharePct":{"type":"number","description":"Share of labelled calls on topics judged ready, 0 to 100."}},"required":["rows","unlabelled","labelled","readySharePct"],"description":"Which topics the agent could be left to handle alone, read pessimistically."},"money":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string"},"rate":{"type":"object","properties":{"perUsd":{"type":"number"},"source":{"type":"string","enum":["workspace","snapshot"]},"snapshotDate":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["perUsd","source","snapshotDate"]},"costPerResolution":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalCost":{"type":"number"},"comparison":{"anyOf":[{"type":"object","properties":{"talkMinutes":{"type":"number"},"agentHours":{"type":"number","description":"Hours the workspace's own team would have been paid for to cover them."},"humanCost":{"type":"number"},"platformCost":{"type":"number"},"saved":{"type":"number","description":"Negative when the platform cost more."},"savedPct":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"},"occupancyPct":{"type":"number"}},"required":["talkMinutes","agentHours","humanCost","platformCost","saved","savedPct","currency","occupancyPct"]},{"type":"null"}],"description":"Against the workspace's own team cost. Null when the workspace has not entered one."}},"required":["currency","rate","costPerResolution","totalCost","comparison"]},{"type":"null"}],"description":"The same costs in the workspace's own currency."}},"required":["totalCalls","containmentPct","escalationPct","containedCount","escalatedCount","unreviewedCount","reviewBacklog","avgQaScorePct","avgHandleSec","csatProxy","reviewedPct","flaggedCount","volumeByDay","outcomeBreakdown","durationByDirection","outcomeByDirection","perAgent","agentTraffic","activityByDay","cohortSplit","economics","latencyByLanguage","satisfaction","topics","drift","graduation","money"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/knowledge/bases":{"get":{"operationId":"knowledge_bases_list","summary":"List knowledge bases","description":"**MCP tool:** `knowledge_bases_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nEvery knowledge base in the workspace with its name, description and folder position. A base is a folder of ingested documents — pages, files, crawled sites — that agents can be grounded on. Use the ids from here with knowledge.search.","tags":["knowledge"],"x-mcp-tool":"knowledge_bases_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"bases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string","enum":["WORKSPACE","AGENT"],"description":"`WORKSPACE`: company-wide, attachable to many agents. `AGENT`: owned by one agent."},"ownerAgentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The agent that owns the base, if any."},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Folder tile colour token, e.g. `blue`."},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Folder icon key, e.g. `book`."},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The base this one is nested in. Null at the root."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","scope","ownerAgentId","color","icon","parentId","createdAt","updatedAt"]}},"total":{"type":"number"}},"required":["bases","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/knowledge/bases/{kbId}":{"get":{"operationId":"knowledge_bases_get","summary":"Fetch a knowledge base with its sources","description":"**MCP tool:** `knowledge_bases_get` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nOne base, the documents ingested into it, each source's sync state, and how many searchable chunks it currently holds. A source with zero chunks was accepted but never successfully ingested — which is the usual reason an agent 'ignores' a document it was given.","tags":["knowledge"],"x-mcp-tool":"knowledge_bases_get","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"kbId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"base":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string","enum":["WORKSPACE","AGENT"],"description":"`WORKSPACE`: company-wide, attachable to many agents. `AGENT`: owned by one agent."},"ownerAgentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The agent that owns the base, if any."},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Folder tile colour token, e.g. `blue`."},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Folder icon key, e.g. `book`."},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The base this one is nested in. Null at the root."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","scope","ownerAgentId","color","icon","parentId","createdAt","updatedAt"]},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kbId":{"type":"string"},"kind":{"type":"string","description":"e.g. `text`, `url`, `notion`, `http`, `integration`, `chat-attachment`."},"label":{"type":"string"},"ref":{"type":"string","description":"The text itself, a URL, or a connector reference, depending on `kind`."},"syncStatus":{"type":"string","description":"`idle`, `syncing`, `synced`, `pending` or `error`."},"lastSyncedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kbId","kind","label","ref","syncStatus","lastSyncedAt","createdAt"]},"description":"The documents ingested into the base, oldest first."},"chunkCount":{"type":"number","description":"Searchable passages the base holds right now."}},"required":["base","sources","chunkCount"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/knowledge/search":{"post":{"operationId":"knowledge_search","summary":"Search the workspace's knowledge and get grounded snippets","description":"**MCP tool:** `knowledge_search` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nRanked passages for a question, from the same retrieval the agents use — embeddings when they are available, lexical ranking when they are not. Address it either by `kbIds` (search these bases) or by `agentId` (search exactly what that agent can see, its own sources plus every base attached to it). Each snippet comes back with the source it came from, so an answer built on these can cite them.","tags":["knowledge"],"x-mcp-tool":"knowledge_search","x-scope":"read","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":1000,"description":"The question, in the user's own words."},"kbIds":{"description":"Knowledge bases to search.","type":"array","items":{"type":"string"}},"agentId":{"description":"Search everything this agent is grounded on, instead of naming bases.","type":"string"},"limit":{"default":6,"type":"integer","minimum":1,"maximum":20}},"required":["query"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"snippets":{"type":"array","items":{"type":"object","properties":{"sourceId":{"type":"string","description":"The knowledge source the passage came from."},"sourceLabel":{"type":"string","description":"That source's display name, for citing."},"content":{"type":"string","description":"The passage text."}},"required":["sourceId","sourceLabel","content"]},"description":"Ranked passages."},"scope":{"anyOf":[{"type":"object","properties":{"agentId":{"type":"string"}},"required":["agentId"]},{"type":"object","properties":{"kbIds":{"type":"array","items":{"type":"string"}}},"required":["kbIds"]}],"description":"What was searched: the agent named, or the knowledge bases. With neither given, every base in the workspace except the Copilot chat's own."}},"required":["snippets","scope"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns":{"get":{"operationId":"campaigns_list","summary":"List outbound campaigns","description":"**MCP tool:** `campaigns_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nEvery campaign with its agent, channel (voice or email), status (draft / running / paused / completed), pacing, and a breakdown of its contact list by state — pending, dialing, done, failed, exhausted, suppressed, blocked. An email campaign also carries what happened to what it sent: sent, bounced, complained, unsubscribed. The counts are how you tell a campaign that is working from one that is quietly failing.","tags":["campaigns"],"x-mcp-tool":"campaigns_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The caller ID presented."},"maxConcurrent":{"type":"number"},"callsPerMinute":{"type":"number"},"predictive":{"type":"boolean","description":"Over-dials in the expectation that most numbers will not answer."},"targetAbandonRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The abandon-rate ceiling predictive pacing holds to. Null means the platform default."},"localPresence":{"type":"boolean","description":"Chooses the caller ID per dial from the workspace's numbers, preferring the callee's area."},"dialedCount":{"type":"number"},"connectedCount":{"type":"number"},"abandonedCount":{"type":"number","description":"Connections that ended in silence."},"maxAttempts":{"type":"number"},"retryAfterMinutes":{"type":"number"},"respectLocalWindow":{"type":"boolean","description":"Dials only within calling hours where the contact is."},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastTickAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the campaign last ran a dialling round."},"feed":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"everyMinutes":{"type":"number"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["url","everyMinutes","headers"]},{"type":"null"}],"description":"The contact feed, or null. A header value typed in plain reads as a placeholder."},"feedPolledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the feed was last asked."},"feedStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last poll did, in counts, or why it failed."},"channel":{"type":"string","enum":["voice","email"],"description":"`voice` rings people; `email` writes to them. Fixed at creation."},"emailChannelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email: the channel it sends from."},"subjectTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["relationship","marketing"],"description":"Email: mail people expect from a business they deal with, or marketing, which has its own gate."},"trackOpens":{"type":"boolean"},"marketingAttestedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when someone confirmed the list agreed to marketing email."},"aiBrief":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiApprovedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when a person approved the agent's samples for the current brief."},"emailsPerMinute":{"type":"number"},"warmup":{"type":"boolean"},"sentCount":{"type":"number","description":"Email: sent so far."},"bouncedCount":{"type":"number"},"complainedCount":{"type":"number","description":"Email: marked as spam by the recipient."},"unsubscribedCount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"description":"Contacts by status. Present on reads, absent on writes.","type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"dialing":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"exhausted":{"type":"number"},"suppressed":{"type":"number"},"blocked":{"type":"number"}},"required":["total","pending","dialing","done","failed","exhausted","suppressed","blocked"]}},"required":["id","name","agentId","status","fromNumber","maxConcurrent","callsPerMinute","predictive","targetAbandonRate","localPresence","dialedCount","connectedCount","abandonedCount","maxAttempts","retryAfterMinutes","respectLocalWindow","startsAt","endsAt","notes","startedAt","completedAt","lastTickAt","feed","feedPolledAt","feedStatus","channel","emailChannelId","subjectTpl","bodyTpl","purpose","trackOpens","marketingAttestedAt","aiBrief","aiApprovedAt","emailsPerMinute","warmup","sentCount","bouncedCount","complainedCount","unsubscribedCount","createdAt","updatedAt"]}},"total":{"type":"number"}},"required":["campaigns","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"campaigns_create","summary":"Create a campaign (draft, nothing dials or sends yet)","description":"**MCP tool:** `campaigns_create` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nCreates a campaign against an existing agent. It starts in draft: nothing is dialled or sent until campaigns.setStatus moves it to running. Pacing defaults are conservative and clamped server-side, so a wrong number here cannot become a carrier incident. With `channel: \"email\"` it writes instead of ringing: give it an email channel and a subject and body (or an `aiBrief`), then add addresses with campaigns.addEmailContacts. An email campaign takes no caller ID and no feed; a voice campaign takes none of the email fields.","tags":["campaigns"],"x-mcp-tool":"campaigns_create","x-scope":"write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"agentId":{"type":"string","minLength":1,"description":"The agent that will place the calls, or answer the replies."},"channel":{"description":"`voice` (default) rings the list; `email` writes to it. Cannot be changed later.","type":"string","enum":["voice","email"]},"fromNumber":{"description":"Caller ID in E.164. Omit to use the agent's own number.","type":"string"},"callsPerMinute":{"type":"integer","minimum":1,"maximum":120},"maxConcurrent":{"type":"integer","minimum":1,"maximum":50},"maxAttempts":{"type":"integer","minimum":1,"maximum":10},"retryAfterMinutes":{"type":"integer","minimum":5,"maximum":1440},"respectLocalWindow":{"description":"Only dial inside legal calling hours for the contact's own timezone. Default true.","type":"boolean"},"predictive":{"description":"Dial more numbers than there are free slots, expecting most not to answer. Default false. The over-dial multiplier is derived from this campaign's own measured connect rate and eases off as its abandon rate approaches the ceiling.","type":"boolean"},"targetAbandonRate":{"description":"Share of ANSWERED calls allowed to end in silence before pacing goes flat, e.g. 0.02. Clamped down to the platform ceiling of 0.03 — it can be lowered, never raised.","type":"number","minimum":0,"maximum":1},"localPresence":{"description":"Choose the caller ID per dial from numbers this workspace already holds, preferring one that shares the destination's dialling prefix. Never synthesises a number.","type":"boolean"},"notes":{"type":"string","maxLength":2000},"feed":{"description":"A URL the runner asks, every few minutes while the campaign is running, for more people to call. It must answer `{\"contacts\": [{\"phone\": \"+15551234567\", \"name\": \"Sam\", \"ref\": \"order-123\", \"variables\": {\"store\": \"...\"}}]}` — at most 500 contacts, 1 MB, within 10 seconds. A number already on the list is skipped unless its earlier contact finished and the feed now lists it under a different `ref`, which puts it back in the queue. Opted-out and blocked contacts never go back. Every dial still passes calling hours, the opt-out list and the frequency cap. A campaign with a feed does not complete itself when its list runs dry. Null removes the feed. Setting one needs access to the whole workspace, not an agent-scoped key.","anyOf":[{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"HTTPS URL the runner GETs. May start with an environment variable, e.g. `{{FEED_BASE_URL}}/stuck`."},"everyMinutes":{"description":"Minutes between polls, clamped to 5–1440. Default 15.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"headers":{"description":"Up to 5 request headers. Values may name environment variables (`{{FEED_KEY}}`), resolved at poll time, so no key is stored on the campaign. Host, Cookie and transport headers are refused.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":500}}},"required":["url"]},{"type":"null"}]},"emailChannelId":{"description":"Email: the email channel it sends from (`channels.list`); that channel's address is the From and replies come back to its agent. Needed before the campaign can send, and the address must be on a domain this workspace verified (`email.domains.list`).","anyOf":[{"type":"string"},{"type":"null"}]},"subjectTpl":{"description":"Email: the subject. `{{name}}` and any contact variable fill in per person; `{{name|there}}` gives a fallback.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"bodyTpl":{"description":"Email: the body, plain text, with the same placeholders. A contact missing a value with no fallback is skipped rather than sent a gap. The footer — the business's name and postal address and an unsubscribe link — is added to every email and cannot be removed.","anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"emailsPerMinute":{"description":"Email: the pace, 1–120 a minute. Default 20.","type":"integer","minimum":1,"maximum":120},"warmup":{"description":"Email: start slow on a newly verified domain and build up over days, as mailbox providers expect. Default true.","type":"boolean"},"trackOpens":{"description":"Email: count opens — only for contacts who agreed to it (the `tracking` vouch). No click tracking. Default false.","type":"boolean"},"aiBrief":{"description":"Email: what the agent should write, in a sentence or two, instead of one fixed body. It writes each first email from this and the details the brief names, and a body that links anywhere but the workspace's own domains, or invents a number, is refused. A person must read and approve samples in the console before the campaign will send; changing the brief withdraws that approval.","anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name","agentId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The caller ID presented."},"maxConcurrent":{"type":"number"},"callsPerMinute":{"type":"number"},"predictive":{"type":"boolean","description":"Over-dials in the expectation that most numbers will not answer."},"targetAbandonRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The abandon-rate ceiling predictive pacing holds to. Null means the platform default."},"localPresence":{"type":"boolean","description":"Chooses the caller ID per dial from the workspace's numbers, preferring the callee's area."},"dialedCount":{"type":"number"},"connectedCount":{"type":"number"},"abandonedCount":{"type":"number","description":"Connections that ended in silence."},"maxAttempts":{"type":"number"},"retryAfterMinutes":{"type":"number"},"respectLocalWindow":{"type":"boolean","description":"Dials only within calling hours where the contact is."},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastTickAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the campaign last ran a dialling round."},"feed":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"everyMinutes":{"type":"number"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["url","everyMinutes","headers"]},{"type":"null"}],"description":"The contact feed, or null. A header value typed in plain reads as a placeholder."},"feedPolledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the feed was last asked."},"feedStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last poll did, in counts, or why it failed."},"channel":{"type":"string","enum":["voice","email"],"description":"`voice` rings people; `email` writes to them. Fixed at creation."},"emailChannelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email: the channel it sends from."},"subjectTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["relationship","marketing"],"description":"Email: mail people expect from a business they deal with, or marketing, which has its own gate."},"trackOpens":{"type":"boolean"},"marketingAttestedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when someone confirmed the list agreed to marketing email."},"aiBrief":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiApprovedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when a person approved the agent's samples for the current brief."},"emailsPerMinute":{"type":"number"},"warmup":{"type":"boolean"},"sentCount":{"type":"number","description":"Email: sent so far."},"bouncedCount":{"type":"number"},"complainedCount":{"type":"number","description":"Email: marked as spam by the recipient."},"unsubscribedCount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"description":"Contacts by status. Present on reads, absent on writes.","type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"dialing":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"exhausted":{"type":"number"},"suppressed":{"type":"number"},"blocked":{"type":"number"}},"required":["total","pending","dialing","done","failed","exhausted","suppressed","blocked"]}},"required":["id","name","agentId","status","fromNumber","maxConcurrent","callsPerMinute","predictive","targetAbandonRate","localPresence","dialedCount","connectedCount","abandonedCount","maxAttempts","retryAfterMinutes","respectLocalWindow","startsAt","endsAt","notes","startedAt","completedAt","lastTickAt","feed","feedPolledAt","feedStatus","channel","emailChannelId","subjectTpl","bodyTpl","purpose","trackOpens","marketingAttestedAt","aiBrief","aiApprovedAt","emailsPerMinute","warmup","sentCount","bouncedCount","complainedCount","unsubscribedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}":{"get":{"operationId":"campaigns_get","summary":"Fetch one campaign with a page of its contacts","description":"**MCP tool:** `campaigns_get` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nThe campaign's settings and counts, plus the first page of its contact list with each contact's dial state and attempt count. Use `contactStatus` to pull only the failures, or only what is still pending.","tags":["campaigns"],"x-mcp-tool":"campaigns_get","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"contactStatus","in":"query","required":false,"schema":{"type":"string","enum":["pending","dialing","done","failed","exhausted","suppressed","blocked"]}},{"name":"take","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The caller ID presented."},"maxConcurrent":{"type":"number"},"callsPerMinute":{"type":"number"},"predictive":{"type":"boolean","description":"Over-dials in the expectation that most numbers will not answer."},"targetAbandonRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The abandon-rate ceiling predictive pacing holds to. Null means the platform default."},"localPresence":{"type":"boolean","description":"Chooses the caller ID per dial from the workspace's numbers, preferring the callee's area."},"dialedCount":{"type":"number"},"connectedCount":{"type":"number"},"abandonedCount":{"type":"number","description":"Connections that ended in silence."},"maxAttempts":{"type":"number"},"retryAfterMinutes":{"type":"number"},"respectLocalWindow":{"type":"boolean","description":"Dials only within calling hours where the contact is."},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastTickAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the campaign last ran a dialling round."},"feed":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"everyMinutes":{"type":"number"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["url","everyMinutes","headers"]},{"type":"null"}],"description":"The contact feed, or null. A header value typed in plain reads as a placeholder."},"feedPolledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the feed was last asked."},"feedStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last poll did, in counts, or why it failed."},"channel":{"type":"string","enum":["voice","email"],"description":"`voice` rings people; `email` writes to them. Fixed at creation."},"emailChannelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email: the channel it sends from."},"subjectTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["relationship","marketing"],"description":"Email: mail people expect from a business they deal with, or marketing, which has its own gate."},"trackOpens":{"type":"boolean"},"marketingAttestedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when someone confirmed the list agreed to marketing email."},"aiBrief":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiApprovedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when a person approved the agent's samples for the current brief."},"emailsPerMinute":{"type":"number"},"warmup":{"type":"boolean"},"sentCount":{"type":"number","description":"Email: sent so far."},"bouncedCount":{"type":"number"},"complainedCount":{"type":"number","description":"Email: marked as spam by the recipient."},"unsubscribedCount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"description":"Contacts by status. Present on reads, absent on writes.","type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"dialing":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"exhausted":{"type":"number"},"suppressed":{"type":"number"},"blocked":{"type":"number"}},"required":["total","pending","dialing","done","failed","exhausted","suppressed","blocked"]}},"required":["id","name","agentId","status","fromNumber","maxConcurrent","callsPerMinute","predictive","targetAbandonRate","localPresence","dialedCount","connectedCount","abandonedCount","maxAttempts","retryAfterMinutes","respectLocalWindow","startsAt","endsAt","notes","startedAt","completedAt","lastTickAt","feed","feedPolledAt","feedStatus","channel","emailChannelId","subjectTpl","bodyTpl","purpose","trackOpens","marketingAttestedAt","aiBrief","aiApprovedAt","emailsPerMinute","warmup","sentCount","bouncedCount","complainedCount","unsubscribedCount","createdAt","updatedAt"]},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaignId":{"type":"string"},"phone":{"type":"string","description":"E.164. Empty on an email campaign's contact."},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The address, on an email campaign's contact only."},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Values handed to the agent for this contact."},"status":{"type":"string","enum":["pending","dialing","done","failed","exhausted","suppressed","blocked"],"description":"`exhausted`: every agreed attempt went unanswered. `suppressed`: the number is on the opt-out list. `blocked`: it cannot be dialled — undialable, or no calling window ever opens under the configured hours."},"attempts":{"type":"number"},"lastAttemptAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the last attempt was deferred, refused or failed."},"lastSid":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The carrier's id for the last call placed."},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","campaignId","phone","email","name","variables","status","attempts","lastAttemptAt","nextAttemptAt","lastReason","lastSid","conversationId","outcome","createdAt","updatedAt"]},"description":"Contacts with trouble attached sort first."}},"required":["campaign","contacts"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"campaigns_update","summary":"Change a campaign's settings","description":"**MCP tool:** `campaigns_update` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nPatches name, caller ID, pacing, retry policy or notes — or, on an email campaign, its channel, subject, body, brief and pace. Anything omitted is left alone. Pacing changes take effect on the next tick, including while the campaign is running. The channel itself cannot change.","tags":["campaigns"],"x-mcp-tool":"campaigns_update","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"callsPerMinute":{"type":"integer","minimum":1,"maximum":120},"maxConcurrent":{"type":"integer","minimum":1,"maximum":50},"maxAttempts":{"type":"integer","minimum":1,"maximum":10},"retryAfterMinutes":{"type":"integer","minimum":5,"maximum":1440},"respectLocalWindow":{"type":"boolean"},"predictive":{"type":"boolean"},"targetAbandonRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"localPresence":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"feed":{"description":"A URL the runner asks, every few minutes while the campaign is running, for more people to call. It must answer `{\"contacts\": [{\"phone\": \"+15551234567\", \"name\": \"Sam\", \"ref\": \"order-123\", \"variables\": {\"store\": \"...\"}}]}` — at most 500 contacts, 1 MB, within 10 seconds. A number already on the list is skipped unless its earlier contact finished and the feed now lists it under a different `ref`, which puts it back in the queue. Opted-out and blocked contacts never go back. Every dial still passes calling hours, the opt-out list and the frequency cap. A campaign with a feed does not complete itself when its list runs dry. Null removes the feed. Setting one needs access to the whole workspace, not an agent-scoped key.","anyOf":[{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000,"description":"HTTPS URL the runner GETs. May start with an environment variable, e.g. `{{FEED_BASE_URL}}/stuck`."},"everyMinutes":{"description":"Minutes between polls, clamped to 5–1440. Default 15.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"headers":{"description":"Up to 5 request headers. Values may name environment variables (`{{FEED_KEY}}`), resolved at poll time, so no key is stored on the campaign. Host, Cookie and transport headers are refused.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":500}}},"required":["url"]},{"type":"null"}]},"emailChannelId":{"description":"Email: the email channel it sends from (`channels.list`); that channel's address is the From and replies come back to its agent. Needed before the campaign can send, and the address must be on a domain this workspace verified (`email.domains.list`).","anyOf":[{"type":"string"},{"type":"null"}]},"subjectTpl":{"description":"Email: the subject. `{{name}}` and any contact variable fill in per person; `{{name|there}}` gives a fallback.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"bodyTpl":{"description":"Email: the body, plain text, with the same placeholders. A contact missing a value with no fallback is skipped rather than sent a gap. The footer — the business's name and postal address and an unsubscribe link — is added to every email and cannot be removed.","anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"emailsPerMinute":{"description":"Email: the pace, 1–120 a minute. Default 20.","type":"integer","minimum":1,"maximum":120},"warmup":{"description":"Email: start slow on a newly verified domain and build up over days, as mailbox providers expect. Default true.","type":"boolean"},"trackOpens":{"description":"Email: count opens — only for contacts who agreed to it (the `tracking` vouch). No click tracking. Default false.","type":"boolean"},"aiBrief":{"description":"Email: what the agent should write, in a sentence or two, instead of one fixed body. It writes each first email from this and the details the brief names, and a body that links anywhere but the workspace's own domains, or invents a number, is refused. A person must read and approve samples in the console before the campaign will send; changing the brief withdraws that approval.","anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The caller ID presented."},"maxConcurrent":{"type":"number"},"callsPerMinute":{"type":"number"},"predictive":{"type":"boolean","description":"Over-dials in the expectation that most numbers will not answer."},"targetAbandonRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The abandon-rate ceiling predictive pacing holds to. Null means the platform default."},"localPresence":{"type":"boolean","description":"Chooses the caller ID per dial from the workspace's numbers, preferring the callee's area."},"dialedCount":{"type":"number"},"connectedCount":{"type":"number"},"abandonedCount":{"type":"number","description":"Connections that ended in silence."},"maxAttempts":{"type":"number"},"retryAfterMinutes":{"type":"number"},"respectLocalWindow":{"type":"boolean","description":"Dials only within calling hours where the contact is."},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastTickAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the campaign last ran a dialling round."},"feed":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"everyMinutes":{"type":"number"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["url","everyMinutes","headers"]},{"type":"null"}],"description":"The contact feed, or null. A header value typed in plain reads as a placeholder."},"feedPolledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the feed was last asked."},"feedStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last poll did, in counts, or why it failed."},"channel":{"type":"string","enum":["voice","email"],"description":"`voice` rings people; `email` writes to them. Fixed at creation."},"emailChannelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email: the channel it sends from."},"subjectTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["relationship","marketing"],"description":"Email: mail people expect from a business they deal with, or marketing, which has its own gate."},"trackOpens":{"type":"boolean"},"marketingAttestedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when someone confirmed the list agreed to marketing email."},"aiBrief":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiApprovedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when a person approved the agent's samples for the current brief."},"emailsPerMinute":{"type":"number"},"warmup":{"type":"boolean"},"sentCount":{"type":"number","description":"Email: sent so far."},"bouncedCount":{"type":"number"},"complainedCount":{"type":"number","description":"Email: marked as spam by the recipient."},"unsubscribedCount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"description":"Contacts by status. Present on reads, absent on writes.","type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"dialing":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"exhausted":{"type":"number"},"suppressed":{"type":"number"},"blocked":{"type":"number"}},"required":["total","pending","dialing","done","failed","exhausted","suppressed","blocked"]}},"required":["id","name","agentId","status","fromNumber","maxConcurrent","callsPerMinute","predictive","targetAbandonRate","localPresence","dialedCount","connectedCount","abandonedCount","maxAttempts","retryAfterMinutes","respectLocalWindow","startsAt","endsAt","notes","startedAt","completedAt","lastTickAt","feed","feedPolledAt","feedStatus","channel","emailChannelId","subjectTpl","bodyTpl","purpose","trackOpens","marketingAttestedAt","aiBrief","aiApprovedAt","emailsPerMinute","warmup","sentCount","bouncedCount","complainedCount","unsubscribedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/status":{"post":{"operationId":"campaigns_setStatus","summary":"Start, pause, or stop a campaign","description":"**MCP tool:** `campaigns_setStatus` · **API key scope:** `write` · **Signed-in role:** depends on the change requested (see below)\n\nMoving a campaign to RUNNING is what makes it dial real phone numbers — or send real email — and start billing. PAUSED stops new calls and sends without losing the list's progress; COMPLETED ends it. An email campaign that is not ready (no verified sender, no subject, AI samples not approved, marketing without its gate) runs but sends nothing, and says why in campaigns.tick's `reason`; one that bounces or draws complaints past the limits pauses itself. Confirm with the operator before starting one.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_setStatus","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The caller ID presented."},"maxConcurrent":{"type":"number"},"callsPerMinute":{"type":"number"},"predictive":{"type":"boolean","description":"Over-dials in the expectation that most numbers will not answer."},"targetAbandonRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The abandon-rate ceiling predictive pacing holds to. Null means the platform default."},"localPresence":{"type":"boolean","description":"Chooses the caller ID per dial from the workspace's numbers, preferring the callee's area."},"dialedCount":{"type":"number"},"connectedCount":{"type":"number"},"abandonedCount":{"type":"number","description":"Connections that ended in silence."},"maxAttempts":{"type":"number"},"retryAfterMinutes":{"type":"number"},"respectLocalWindow":{"type":"boolean","description":"Dials only within calling hours where the contact is."},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastTickAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the campaign last ran a dialling round."},"feed":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"everyMinutes":{"type":"number"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["url","everyMinutes","headers"]},{"type":"null"}],"description":"The contact feed, or null. A header value typed in plain reads as a placeholder."},"feedPolledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the feed was last asked."},"feedStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last poll did, in counts, or why it failed."},"channel":{"type":"string","enum":["voice","email"],"description":"`voice` rings people; `email` writes to them. Fixed at creation."},"emailChannelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email: the channel it sends from."},"subjectTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["relationship","marketing"],"description":"Email: mail people expect from a business they deal with, or marketing, which has its own gate."},"trackOpens":{"type":"boolean"},"marketingAttestedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when someone confirmed the list agreed to marketing email."},"aiBrief":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiApprovedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when a person approved the agent's samples for the current brief."},"emailsPerMinute":{"type":"number"},"warmup":{"type":"boolean"},"sentCount":{"type":"number","description":"Email: sent so far."},"bouncedCount":{"type":"number"},"complainedCount":{"type":"number","description":"Email: marked as spam by the recipient."},"unsubscribedCount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"description":"Contacts by status. Present on reads, absent on writes.","type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"dialing":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"exhausted":{"type":"number"},"suppressed":{"type":"number"},"blocked":{"type":"number"}},"required":["total","pending","dialing","done","failed","exhausted","suppressed","blocked"]}},"required":["id","name","agentId","status","fromNumber","maxConcurrent","callsPerMinute","predictive","targetAbandonRate","localPresence","dialedCount","connectedCount","abandonedCount","maxAttempts","retryAfterMinutes","respectLocalWindow","startsAt","endsAt","notes","startedAt","completedAt","lastTickAt","feed","feedPolledAt","feedStatus","channel","emailChannelId","subjectTpl","bodyTpl","purpose","trackOpens","marketingAttestedAt","aiBrief","aiApprovedAt","emailsPerMinute","warmup","sentCount","bouncedCount","complainedCount","unsubscribedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/contacts":{"post":{"operationId":"campaigns_addContacts","summary":"Add contacts to a voice campaign's dial list","description":"**MCP tool:** `campaigns_addContacts` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nAppends contacts to a voice campaign (an email campaign takes campaigns.addEmailContacts). Each needs a phone number in E.164; name and free-form `variables` are optional and are available to the agent during the call. The agent says the name aloud, so a name is letters in any script, with spaces, hyphens, apostrophes, commas, full stops and middle dots: at least 2 letters, at most 80 characters and 8 words, and no digits, symbols or emoji. A contact whose name breaks these rules is rejected with the reason, like an unusable number; `N/A`, `#N/A`, `unknown` and the like count as no name. The name is saved tidied, so it can read back differently from what was sent: spaces collapsed, a zero-width space read as a space, other invisible characters removed, commas at the start dropped, spaces, commas and hyphens at the end dropped with a full stop after them (`Ali,`, `Ali -` and `Ali .` are saved as `Ali`), an accent mark left on its own dropped (`Ali¨` is saved as `Ali`), dashes and look-alike apostrophes made plain (`‘`, `` ` `` and `´` become `'`; `’` is kept; `Jean–Luc D´Souza` is saved as `Jean-Luc D'Souza`) and styled letters made plain (Unicode NFKC: `Ａｓｉｆ` is saved as `Asif`). Empty notes are not saved. A number without its `+` or `00` is refused rather than given a country its digits happen to spell, unless `defaultCountry` says which country such numbers are in: with `+91`, both `9846000000` and `919846000000` are read as +91 98460 00000. Numbers already on the list are skipped rather than duplicated (a row whose name is refused is rejected, even if its number is on the list), and the result reports how many were added, skipped, or rejected as unusable, and why.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_addContacts","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","minLength":3,"description":"E.164, e.g. +4915112345678."},"name":{"type":"string"},"variables":{"description":"Anything the agent should know about this contact — merged into its prompt as {{token}} values.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["phone"]}},"defaultCountry":{"description":"The country of numbers written without `+` or `00`, as a country code such as \"+91\". Without it, such numbers are rejected.","type":"string"}},"required":["contacts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"added":{"type":"number"},"rejected":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number","description":"1-based position in the list sent."},"phone":{"type":"string"},"reason":{"type":"string"}},"required":["row","phone","reason"]},"description":"Rows whose number could not be dialled, each with the reason."},"duplicates":{"type":"number","description":"Rows skipped: already on the campaign, or repeated within the list sent."}},"required":["added","rejected","duplicates"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/tick":{"post":{"operationId":"campaigns_tick","summary":"Advance a running campaign by one round","description":"**MCP tool:** `campaigns_tick` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nPlaces whatever calls — or sends whatever email — the campaign's pacing allows right now and returns what it did. The scheduler already ticks running campaigns on its own — this is for driving one manually, and it PLACES REAL CALLS and SENDS REAL EMAIL.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_tick","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"campaignId":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"dialed":{"type":"number","description":"Calls handed to the carrier this round (on email, emails sent)."},"sent":{"description":"Email campaigns: emails that went out this round.","type":"number"},"deferred":{"type":"number","description":"Contacts booked for later: a retry backoff, or waiting for their local calling window."},"blocked":{"type":"number","description":"Contacts that will never be dialled: opt-out, undialable, or no window under these hours."},"exhausted":{"type":"number","description":"Contacts that used their last attempt."},"reconciled":{"type":"number","description":"Finished calls matched back to their contact this round."},"budget":{"type":"number","description":"Dials the pace allowed. Zero with contacts waiting means the pace is the limit."},"connected":{"type":"number","description":"Connections matched this round."},"abandoned":{"type":"number","description":"Of those, connections that ended before anything was said."},"pace":{"description":"What set the budget, in one sentence.","type":"string"},"reason":{"description":"Present when the round did nothing for a reason other than no contacts being due.","type":"string"}},"required":["campaignId","status","dialed","deferred","blocked","exhausted","reconciled","budget","connected","abandoned"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/email-contacts":{"post":{"operationId":"campaigns_addEmailContacts","summary":"Add addresses to an email campaign","description":"**MCP tool:** `campaigns_addEmailContacts` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nAppends people to an email campaign. Each needs an address; `name` and `variables` fill the subject and body's placeholders. Addresses already on the list are skipped, unusable ones are rejected with the reason, and ones on the workspace's do-not-email list go in as `suppressed` and are never sent to. Nobody is emailed without a record that they agreed to it: `consent` vouches, for everyone in this call, that they agreed to be emailed by this business (`email`), to marketing email (`marketing`, which implies `email`), and to having opens counted (`tracking`, which rides on one of the others). A vouch is recorded per address with who made it, counts for every agent in the workspace, puts back contacts refused earlier for want of it, and needs access to the whole workspace. Without a vouch, only addresses already on record are sent to.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_addEmailContacts","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320},"name":{"type":"string"},"variables":{"description":"Values for the template's `{{placeholders}}`, and for the agent if they reply.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["email"]}},"consent":{"description":"What the operator vouches everyone in this call agreed to. Only literal `true`s count.","type":"object","properties":{"email":{"type":"boolean"},"marketing":{"type":"boolean"},"tracking":{"type":"boolean"}}}},"required":["contacts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"added":{"type":"number"},"rejected":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number","description":"1-based position in the list sent."},"email":{"type":"string"},"reason":{"type":"string"}},"required":["row","email","reason"]},"description":"Rows whose address could not be used, each with the reason."},"duplicates":{"type":"number","description":"Rows skipped: already on the campaign, or repeated within the list sent."},"suppressed":{"type":"number","description":"Addresses on the do-not-email list: added, marked so, never sent to."},"consented":{"description":"With a vouch: addresses this workspace had no record for before.","type":"number"},"reopened":{"description":"With a vouch: contacts refused earlier for missing consent, back in the queue.","type":"number"}},"required":["added","rejected","duplicates","suppressed"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/contacts/{contactId}":{"delete":{"operationId":"campaigns_removeContact","summary":"Remove one contact from a campaign","description":"**MCP tool:** `campaigns_removeContact` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nTakes one contact off a campaign's list, voice or email, as the campaign page's delete does: it is not called or written to again, and its attempts go with it. Calls and emails it already had stay in the conversation history. Contact ids are in `campaigns.get`. A contact being called right now is refused with 409; try again when the call ends. A contact that is not on this campaign, or already removed, is 404.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_removeContact","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"contactId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"removed":{"type":"boolean","const":true}},"required":["removed"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/contacts/remove":{"post":{"operationId":"campaigns_removeContacts","summary":"Remove several contacts from a campaign","description":"**MCP tool:** `campaigns_removeContacts` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nTakes up to 500 contacts off a campaign's list at once, as ticking them on the campaign page does. A contact being called right now stays, and so does an id that is not on this campaign: both are counted in `skipped` rather than failing the rest, so `removed` + `skipped` is the number of distinct ids sent. Contact ids are in `campaigns.get`.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_removeContacts","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}},"required":["contactIds"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Contacts taken off the list."},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Distinct ids left as they were: being called right now, or not on this campaign."}},"required":["removed","skipped"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{campaignId}/purpose":{"post":{"operationId":"campaigns_setPurpose","summary":"Mark an email campaign as relationship or marketing mail","description":"**MCP tool:** `campaigns_setPurpose` · **API key scope:** `write` · **Signed-in role:** Member or above\n\n`relationship` (the default) is mail a person expects from a business they deal with: an appointment, an order, an account. `marketing` is anything selling, and needs `attest: true` — the caller confirming that everyone on the list agreed to marketing email — from access not limited to particular agents. Each contact still needs their own recorded marketing consent, the sending domain a DMARC record, and the platform marketing switched on; the campaign sends nothing until all hold. Not while the campaign is running.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["campaigns"],"x-mcp-tool":"campaigns_setPurpose","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaignId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["relationship","marketing"]},"attest":{"description":"Marketing only: everyone on the list agreed to marketing email from this business.","type":"boolean"}},"required":["purpose"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"status":{"type":"string","enum":["DRAFT","RUNNING","PAUSED","COMPLETED"]},"fromNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The caller ID presented."},"maxConcurrent":{"type":"number"},"callsPerMinute":{"type":"number"},"predictive":{"type":"boolean","description":"Over-dials in the expectation that most numbers will not answer."},"targetAbandonRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The abandon-rate ceiling predictive pacing holds to. Null means the platform default."},"localPresence":{"type":"boolean","description":"Chooses the caller ID per dial from the workspace's numbers, preferring the callee's area."},"dialedCount":{"type":"number"},"connectedCount":{"type":"number"},"abandonedCount":{"type":"number","description":"Connections that ended in silence."},"maxAttempts":{"type":"number"},"retryAfterMinutes":{"type":"number"},"respectLocalWindow":{"type":"boolean","description":"Dials only within calling hours where the contact is."},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastTickAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the campaign last ran a dialling round."},"feed":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"everyMinutes":{"type":"number"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["url","everyMinutes","headers"]},{"type":"null"}],"description":"The contact feed, or null. A header value typed in plain reads as a placeholder."},"feedPolledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the feed was last asked."},"feedStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last poll did, in counts, or why it failed."},"channel":{"type":"string","enum":["voice","email"],"description":"`voice` rings people; `email` writes to them. Fixed at creation."},"emailChannelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Email: the channel it sends from."},"subjectTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyTpl":{"anyOf":[{"type":"string"},{"type":"null"}]},"purpose":{"type":"string","enum":["relationship","marketing"],"description":"Email: mail people expect from a business they deal with, or marketing, which has its own gate."},"trackOpens":{"type":"boolean"},"marketingAttestedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when someone confirmed the list agreed to marketing email."},"aiBrief":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiApprovedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Email: when a person approved the agent's samples for the current brief."},"emailsPerMinute":{"type":"number"},"warmup":{"type":"boolean"},"sentCount":{"type":"number","description":"Email: sent so far."},"bouncedCount":{"type":"number"},"complainedCount":{"type":"number","description":"Email: marked as spam by the recipient."},"unsubscribedCount":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"counts":{"description":"Contacts by status. Present on reads, absent on writes.","type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"dialing":{"type":"number"},"done":{"type":"number"},"failed":{"type":"number"},"exhausted":{"type":"number"},"suppressed":{"type":"number"},"blocked":{"type":"number"}},"required":["total","pending","dialing","done","failed","exhausted","suppressed","blocked"]}},"required":["id","name","agentId","status","fromNumber","maxConcurrent","callsPerMinute","predictive","targetAbandonRate","localPresence","dialedCount","connectedCount","abandonedCount","maxAttempts","retryAfterMinutes","respectLocalWindow","startsAt","endsAt","notes","startedAt","completedAt","lastTickAt","feed","feedPolledAt","feedStatus","channel","emailChannelId","subjectTpl","bodyTpl","purpose","trackOpens","marketingAttestedAt","aiBrief","aiApprovedAt","emailsPerMinute","warmup","sentCount","bouncedCount","complainedCount","unsubscribedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/escalations":{"get":{"operationId":"escalations_list","summary":"List handoffs waiting on a human","description":"**MCP tool:** `escalations_list` · **API key scope:** `read` · **Signed-in role:** Member or above\n\nConversations an agent handed to a person, with why it escalated, which provider it went to, and how long it has been sitting. Filter by status to get just the open queue.","tags":["escalations"],"x-mcp-tool":"escalations_list","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"description":"Lifecycle state. `QUEUED` is the open queue: waiting for a person to take it.","type":"string","enum":["QUEUED","ASSIGNED","RESOLVED","CANCELLED"]},"description":"Lifecycle state. `QUEUED` is the open queue: waiting for a person to take it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"escalations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["QUEUED","ASSIGNED","RESOLVED","CANCELLED"]},"queuedAt":{"type":"string","format":"date-time"},"assignedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"waitingSec":{"type":"number","description":"Time in the queue: until assignment, or until now while still queued."},"providerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignedHuman":{"anyOf":[{"type":"string"},{"type":"null"}]},"agentId":{"type":"string"},"agentName":{"type":"string"},"customerRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"qaScorePct":{"anyOf":[{"type":"number"},{"type":"null"}]},"caseData":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"skill":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"reason":{"type":"string"},"presented":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]},"description":"The case as shown to the person deciding, in order."},"data":{"description":"The raw structured payload, verbatim."},"decision":{"description":"Absent until a person approves or denies.","type":"object","properties":{"decision":{"type":"string","enum":["approved","denied"]},"approver":{"type":"string"},"decidedAt":{"type":"string","format":"date-time"}},"required":["decision","approver","decidedAt"]}},"required":["kind","skill","workflowId","workflowName","reason","presented"]},{"type":"null"}],"description":"Set when a workflow's human-handoff step opened the escalation: the case awaiting a decision."}},"required":["id","conversationId","reason","status","queuedAt","assignedAt","resolvedAt","waitingSec","providerId","providerName","assignedHuman","agentId","agentName","customerRef","language","summary","qaScorePct","caseData"]}},"total":{"type":"number"}},"required":["escalations","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/escalations/metrics":{"get":{"operationId":"escalations_metrics","summary":"How the handoff queue is doing","description":"**MCP tool:** `escalations_metrics` · **API key scope:** `read` · **Signed-in role:** Member or above\n\nHow many handoffs are queued, assigned and resolved, and the average wait from queued to assigned. The right call for 'is anything on fire'.","tags":["escalations"],"x-mcp-tool":"escalations_metrics","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"number"},"assigned":{"type":"number"},"resolved":{"type":"number"},"avgWaitSec":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Mean wait from queued to assigned, over assigned and resolved escalations."}},"required":["queued","assigned","resolved","avgWaitSec"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/escalations/{escalationId}/providers":{"get":{"operationId":"escalations_suggestProviders","summary":"Which providers could take this handoff","description":"**MCP tool:** `escalations_suggestProviders` · **API key scope:** `read` · **Signed-in role:** Member or above\n\nRanked providers for one escalation, matched on language, service and current load. Read-only — it suggests, it does not assign.","tags":["escalations"],"x-mcp-tool":"escalations_suggestProviders","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"escalationId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"qualityPct":{"anyOf":[{"type":"number"},{"type":"null"}]},"rating":{"anyOf":[{"type":"number"},{"type":"null"}]},"languages":{"type":"array","items":{"type":"string"}},"services":{"type":"array","items":{"type":"string"}},"aroundTheClock":{"type":"boolean"},"matchReason":{"type":"string","description":"Why it was suggested, e.g. `Speaks EN · 24/7` or `Broader coverage`."}},"required":["id","name","qualityPct","rating","languages","services","aroundTheClock","matchReason"]},"description":"Best fit first: language and service, then quality."}},"required":["providers"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/escalations/{escalationId}/assign":{"post":{"operationId":"escalations_assign","summary":"Hand an escalation to a provider","description":"**MCP tool:** `escalations_assign` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nRoutes the escalation to a provider, and optionally to a named human on their side. This is visible to that provider immediately — it puts work on someone else's desk.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["escalations"],"x-mcp-tool":"escalations_assign","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"escalationId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"providerId":{"type":"string","minLength":1},"assignedHuman":{"description":"Name of the person taking it, if known.","type":"string"}},"required":["providerId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","const":true,"description":"Always `true`. A failure is an error response instead."},"escalationId":{"type":"string"},"providerId":{"type":"string"}},"required":["ok","escalationId","providerId"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/escalations/{escalationId}/resolve":{"post":{"operationId":"escalations_resolve","summary":"Close an escalation as handled","description":"**MCP tool:** `escalations_resolve` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nMarks the handoff done and takes it off the open queue.","tags":["escalations"],"x-mcp-tool":"escalations_resolve","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"escalationId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","const":true,"description":"Always `true`. A failure is an error response instead."},"escalationId":{"type":"string"},"status":{"type":"string","const":"RESOLVED"}},"required":["ok","escalationId","status"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/escalations/{escalationId}/cancel":{"post":{"operationId":"escalations_cancel","summary":"Cancel an escalation that should not have been raised","description":"**MCP tool:** `escalations_cancel` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nWithdraws the handoff without recording it as handled — for the false alarms, so they do not count as work a person did.","tags":["escalations"],"x-mcp-tool":"escalations_cancel","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"escalationId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","const":true,"description":"Always `true`. A failure is an error response instead."},"escalationId":{"type":"string"},"status":{"type":"string","const":"CANCELLED"}},"required":["ok","escalationId","status"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/numbers":{"get":{"operationId":"numbers_list","summary":"List the phone numbers this workspace owns","description":"**MCP tool:** `numbers_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nEvery number on the workspace's connected carrier account, with the URL the carrier sends its calls to. Fails with a clear message when no carrier is connected, rather than pretending the workspace owns nothing.","tags":["numbers"],"x-mcp-tool":"numbers_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"numbers":{"type":"array","items":{"type":"object","properties":{"sid":{"type":"string","description":"The carrier's id for the number: a Twilio SID, or on Plivo the number itself."},"phoneNumber":{"type":"string","description":"E.164, e.g. `+919876543210`."},"friendlyName":{"type":"string"},"voiceUrl":{"type":"string","description":"Where the carrier sends this number's calls, best effort. Empty when unknown."}},"required":["sid","phoneNumber","friendlyName","voiceUrl"]}},"total":{"type":"number"}},"required":["numbers","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/channels":{"get":{"operationId":"channels_list","summary":"List configured channels","description":"**MCP tool:** `channels_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nThe ways in — phone, web widget, WhatsApp, Shopify, API, SMS — each with its type, when its configuration last changed, and the voice and sounds callers get on it.","tags":["channels"],"x-mcp-tool":"channels_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Display name. For a phone channel, the number itself."},"type":{"type":"string","enum":["phone","web","whatsapp","shopify","api","sms"]},"lastChanged":{"type":"string","format":"date-time","description":"When its configuration last changed."},"config":{"type":"object","properties":{"sipUri":{"description":"Inbound SIP URI the carrier routes to this channel.","type":"string"},"whitelistedIps":{"type":"array","items":{"type":"string"},"description":"Only these source IPs may originate calls into the channel."},"voice":{"type":"object","properties":{"provider":{"type":"string","description":"Text-to-speech engine id, e.g. `elevenlabs`."},"voice":{"type":"string","description":"Named voice or voice id."},"callerLanguage":{"type":"string"}},"required":["provider","voice","callerLanguage"],"description":"The voice callers hear on this channel, overriding the agent's."},"ambientSound":{"type":"object","properties":{"preset":{"type":"string"},"enabled":{"type":"boolean"}},"required":["preset","enabled"]},"endOfSpeechSound":{"type":"object","properties":{"preset":{"type":"string"},"enabled":{"type":"boolean"}},"required":["preset","enabled"]},"thinkingSound":{"type":"object","properties":{"preset":{"type":"string"},"delay":{"type":"number","description":"Seconds of silence before it plays."},"enabled":{"type":"boolean"}},"required":["preset","delay","enabled"],"description":"The filler played while the agent is thinking."},"speechFineTuning":{"type":"object","properties":{"endpointingMs":{"type":"number","description":"Silence before the caller counts as done speaking, in ms."},"interruptionSensitivity":{"type":"string","enum":["low","medium","high"]},"denoise":{"type":"boolean"}},"required":["endpointingMs","interruptionSensitivity","denoise"]},"interactionFineTuning":{"type":"object","properties":{"maxCallDurationMin":{"type":"number"},"silenceTimeoutSec":{"type":"number","description":"Hang up after this many seconds of caller silence."},"voicemailDetection":{"type":"boolean"}},"required":["maxCallDurationMin","silenceTimeoutSec","voicemailDetection"]}},"required":["whitelistedIps","voice","ambientSound","endOfSpeechSound","thinkingSound"]}},"required":["id","name","type","lastChanged","config"]}},"total":{"type":"number"}},"required":["channels","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/compliance":{"get":{"operationId":"compliance_status","summary":"Whether this workspace may place and receive real calls","description":"**MCP tool:** `compliance_status` · **API key scope:** `read` · **Signed-in role:** Admin or above\n\nThe workspace's KYC verification state, its per-country registrations (10DLC in the US, DLT in India, and so on), whether the platform is currently enforcing them, and whether telephony is suspended. If a call or campaign is being refused, the reason is usually here.","tags":["compliance"],"x-mcp-tool":"compliance_status","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"verification":{"type":"object","properties":{"organizationId":{"type":"string"},"status":{"type":"string","enum":["UNVERIFIED","PENDING","APPROVED","REJECTED","SUSPENDED"]},"legalName":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine1":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"useCase":{"anyOf":[{"type":"string"},{"type":"null"}]},"callCountries":{"type":"array","items":{"type":"string"}},"documents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"name":{"type":"string"},"ref":{"type":"string","description":"Storage key or URL of the document. Never its contents."},"uploadedAt":{"type":"string","format":"date-time"}},"required":["kind","name","ref","uploadedAt"]}},"submittedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reviewedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reviewedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"reviewNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["organizationId","status","legalName","registrationNumber","registrationCountry","taxId","addressLine1","addressLine2","city","region","postalCode","country","contactName","contactEmail","contactPhone","useCase","callCountries","documents","submittedAt","reviewedAt","reviewedBy","reviewNote","updatedAt"],"description":"The workspace's business verification (KYC) file and its review state."},"registrations":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string"},"regime":{"type":"string","enum":["US_10DLC","IN_DLT"],"description":"`US_10DLC`: US A2P messaging registration. `IN_DLT`: India's DLT registration (voice and SMS)."},"status":{"type":"string","enum":["NONE","PENDING","ACTIVE","REJECTED","EXPIRED"]},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The regime's primary id: Brand ID for 10DLC, Entity ID for DLT."},"secondaryId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Campaign ID for 10DLC; header or sender ID for DLT."},"provider":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"submittedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["organizationId","regime","status","externalId","secondaryId","provider","note","submittedAt","approvedAt","expiresAt","updatedAt"]},"description":"Per-country registrations."},"enforced":{"type":"boolean","description":"True when these checks block calls; false means they only warn."},"accountMode":{"type":"string","enum":["byo","managed_subaccount","none"],"description":"How the workspace's carrier account is held: its own (`byo`), a subaccount the platform manages, or none."},"accountStatus":{"type":"string","enum":["active","suspended","none"],"description":"`suspended` means the workspace's telephony is suspended."},"canSuspendAtCarrier":{"type":"boolean","description":"Whether telephony can also be suspended at the carrier itself."}},"required":["verification","registrations","enforced","accountMode","accountStatus","canSuspendAtCarrier"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/domains":{"get":{"operationId":"email_domains_list","summary":"List the workspace's own sending domains","description":"**MCP tool:** `email_domains_list` · **API key scope:** `read` · **Signed-in role:** Admin or above\n\nEvery domain this workspace sends email from, with its verification state, the DNS records to publish, where replies come back, and whether the mail service has paused it. Only a `verified` domain sends; an email channel whose address is on one sends as that address.","tags":["email"],"x-mcp-tool":"email_domains_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string","description":"The domain as stored: lower case, punycode for an internationalised name."},"unicode":{"type":"string","description":"The same name for display."},"status":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"mailFromDomain":{"type":"string","description":"The bounce subdomain (custom MAIL FROM), e.g. `bounce.example.com`."},"mailFromStatus":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["dkim","mail-from-mx","mail-from-spf","dmarc","reply-mx"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string","description":"The full record name."},"value":{"type":"string"},"priority":{"description":"MX records only.","type":"number"},"required":{"type":"boolean","description":"Needed before the domain can send. DMARC and the reply MX are not."},"use":{"type":"string","enum":["send","receive","campaigns"],"description":"`send`: sending at all. `receive`: replies come back to the agent. `campaigns`: DMARC, needed for marketing email."}},"required":["purpose","type","name","value","required","use"]},"description":"Every record to publish at the domain's DNS host."},"hostedZoneAssumed":{"type":"boolean"},"verificationError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The mail service's reason for a failed check, e.g. `HOST_NOT_FOUND`."},"createdAt":{"type":"string","format":"date-time"},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string","enum":["mail-from-not-set","tenant-not-ready"]}},"replyDomain":{"type":"string","description":"Where replies to this domain's mail come back, e.g. `reply.example.com`."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"An unverified claim is released at this time, so nobody can hold a name they do not own. Null once verified."},"tenantStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The domain's standing with the mail service: ENABLED, REINSTATED or DISABLED. DISABLED stops its mail."}},"required":["domain","unicode","status","mailFromDomain","mailFromStatus","records","hostedZoneAssumed","verificationError","createdAt","verifiedAt","lastCheckedAt","warnings","replyDomain","expiresAt","tenantStatus"]}},"total":{"type":"number"}},"required":["domains","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"email_domains_add","summary":"Add a sending domain and get its DNS records","description":"**MCP tool:** `email_domains_add` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nClaims a domain for this workspace and returns the records to publish at its DNS host: three DKIM CNAMEs and the bounce subdomain's MX and SPF (needed to send), DMARC (needed for marketing email), and the reply subdomain's MX (needed to receive replies). The domain verifies on its own once the records are public, usually within the hour; `email.domains.refresh` asks now. A claim that never verifies is released after 72 hours. Needs an approved business verification while the platform enforces one.","tags":["email"],"x-mcp-tool":"email_domains_add","x-scope":"write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"mailFromLabel":{"description":"The bounce subdomain's label. Default `bounce`, giving `bounce.example.com`.","type":"string","maxLength":63}},"required":["domain"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"domain":{"type":"string","description":"The domain as stored: lower case, punycode for an internationalised name."},"unicode":{"type":"string","description":"The same name for display."},"status":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"mailFromDomain":{"type":"string","description":"The bounce subdomain (custom MAIL FROM), e.g. `bounce.example.com`."},"mailFromStatus":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["dkim","mail-from-mx","mail-from-spf","dmarc","reply-mx"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string","description":"The full record name."},"value":{"type":"string"},"priority":{"description":"MX records only.","type":"number"},"required":{"type":"boolean","description":"Needed before the domain can send. DMARC and the reply MX are not."},"use":{"type":"string","enum":["send","receive","campaigns"],"description":"`send`: sending at all. `receive`: replies come back to the agent. `campaigns`: DMARC, needed for marketing email."}},"required":["purpose","type","name","value","required","use"]},"description":"Every record to publish at the domain's DNS host."},"hostedZoneAssumed":{"type":"boolean"},"verificationError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The mail service's reason for a failed check, e.g. `HOST_NOT_FOUND`."},"createdAt":{"type":"string","format":"date-time"},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string","enum":["mail-from-not-set","tenant-not-ready"]}},"replyDomain":{"type":"string","description":"Where replies to this domain's mail come back, e.g. `reply.example.com`."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"An unverified claim is released at this time, so nobody can hold a name they do not own. Null once verified."},"tenantStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The domain's standing with the mail service: ENABLED, REINSTATED or DISABLED. DISABLED stops its mail."}},"required":["domain","unicode","status","mailFromDomain","mailFromStatus","records","hostedZoneAssumed","verificationError","createdAt","verifiedAt","lastCheckedAt","warnings","replyDomain","expiresAt","tenantStatus"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/domains/{domain}/refresh":{"post":{"operationId":"email_domains_refresh","summary":"Ask the mail service whether a domain has verified","description":"**MCP tool:** `email_domains_refresh` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nReads the domain's state from the mail service now rather than waiting for the next automatic check (every ten minutes while it is pending). Returns the domain as `email.domains.list` does. To see which record is missing, use `email.domains.checkDns`.","tags":["email"],"x-mcp-tool":"email_domains_refresh","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"domain":{"type":"string","description":"The domain as stored: lower case, punycode for an internationalised name."},"unicode":{"type":"string","description":"The same name for display."},"status":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"mailFromDomain":{"type":"string","description":"The bounce subdomain (custom MAIL FROM), e.g. `bounce.example.com`."},"mailFromStatus":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["dkim","mail-from-mx","mail-from-spf","dmarc","reply-mx"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string","description":"The full record name."},"value":{"type":"string"},"priority":{"description":"MX records only.","type":"number"},"required":{"type":"boolean","description":"Needed before the domain can send. DMARC and the reply MX are not."},"use":{"type":"string","enum":["send","receive","campaigns"],"description":"`send`: sending at all. `receive`: replies come back to the agent. `campaigns`: DMARC, needed for marketing email."}},"required":["purpose","type","name","value","required","use"]},"description":"Every record to publish at the domain's DNS host."},"hostedZoneAssumed":{"type":"boolean"},"verificationError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The mail service's reason for a failed check, e.g. `HOST_NOT_FOUND`."},"createdAt":{"type":"string","format":"date-time"},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string","enum":["mail-from-not-set","tenant-not-ready"]}},"replyDomain":{"type":"string","description":"Where replies to this domain's mail come back, e.g. `reply.example.com`."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"An unverified claim is released at this time, so nobody can hold a name they do not own. Null once verified."},"tenantStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The domain's standing with the mail service: ENABLED, REINSTATED or DISABLED. DISABLED stops its mail."}},"required":["domain","unicode","status","mailFromDomain","mailFromStatus","records","hostedZoneAssumed","verificationError","createdAt","verifiedAt","lastCheckedAt","warnings","replyDomain","expiresAt","tenantStatus"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/domains/{domain}/records":{"get":{"operationId":"email_domains_records","summary":"The DNS records to publish, with what the last check saw","description":"**MCP tool:** `email_domains_records` · **API key scope:** `read` · **Signed-in role:** Admin or above\n\nOne row per record, with the value for the Host field most DNS providers ask for, and the verdict of the last public-DNS check (`found`, `missing`, `wrong`). Asks no DNS server: run `email.domains.checkDns` for a fresh answer.","tags":["email"],"x-mcp-tool":"email_domains_records","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["dkim","mail-from-mx","mail-from-spf","dmarc","reply-mx"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string"},"host":{"type":"string","description":"What goes in the Host field at most DNS providers: the name without the zone."},"value":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"required":{"type":"boolean"},"use":{"type":"string","enum":["send","receive","campaigns"],"description":"`send`: sending at all. `receive`: replies come back to the agent. `campaigns`: DMARC, needed for marketing email."},"state":{"anyOf":[{"type":"string","enum":["found","missing","wrong","unchecked"]},{"type":"null"}],"description":"What public DNS answered at the last check. Null when it was never checked."},"note":{"anyOf":[{"type":"string","enum":["domain-appended","proxied","other-mx-preferred","multiple-spf","value-has-quotes"]},{"type":"null"}],"description":"The usual mistake behind a `wrong` record, when it is recognisable."},"seen":{"type":"array","items":{"type":"string"},"description":"What public DNS answers there now. Live checks only."}},"required":["purpose","type","name","host","value","priority","required","use","state","note","seen"]}},"zone":{"type":"string","description":"The zone the `host` values are relative to."},"provider":{"anyOf":[{"type":"string","enum":["cloudflare","godaddy","namecheap","route53","google","squarespace","hostinger","ionos","wix","other"]},{"type":"null"}],"description":"The DNS host, recognised from the domain's name servers."},"requiredFound":{"type":"boolean","description":"Every record needed to send is in public DNS."},"checkedAt":{"type":"string","description":"ISO 8601, or empty when the domain was never checked."}},"required":["rows","zone","provider","requiredFound","checkedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/domains/{domain}/dns-check":{"post":{"operationId":"email_domains_checkDns","summary":"Check the domain's records in public DNS now","description":"**MCP tool:** `email_domains_checkDns` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nAsks public resolvers what they answer for each record, beside what is expected, and names the DNS host and the usual mistake when a record is wrong (the domain typed twice into the Host field, a proxied Cloudflare record, two SPF records). Reads DNS only; the verdicts are kept for `email.domains.records`.","tags":["email"],"x-mcp-tool":"email_domains_checkDns","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["dkim","mail-from-mx","mail-from-spf","dmarc","reply-mx"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string"},"host":{"type":"string","description":"What goes in the Host field at most DNS providers: the name without the zone."},"value":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"required":{"type":"boolean"},"use":{"type":"string","enum":["send","receive","campaigns"],"description":"`send`: sending at all. `receive`: replies come back to the agent. `campaigns`: DMARC, needed for marketing email."},"state":{"anyOf":[{"type":"string","enum":["found","missing","wrong","unchecked"]},{"type":"null"}],"description":"What public DNS answered at the last check. Null when it was never checked."},"note":{"anyOf":[{"type":"string","enum":["domain-appended","proxied","other-mx-preferred","multiple-spf","value-has-quotes"]},{"type":"null"}],"description":"The usual mistake behind a `wrong` record, when it is recognisable."},"seen":{"type":"array","items":{"type":"string"},"description":"What public DNS answers there now. Live checks only."}},"required":["purpose","type","name","host","value","priority","required","use","state","note","seen"]}},"zone":{"type":"string","description":"The zone the `host` values are relative to."},"provider":{"anyOf":[{"type":"string","enum":["cloudflare","godaddy","namecheap","route53","google","squarespace","hostinger","ionos","wix","other"]},{"type":"null"}],"description":"The DNS host, recognised from the domain's name servers."},"requiredFound":{"type":"boolean","description":"Every record needed to send is in public DNS."},"checkedAt":{"type":"string","description":"ISO 8601, or empty when the domain was never checked."}},"required":["rows","zone","provider","requiredFound","checkedAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/domains/{domain}":{"patch":{"operationId":"email_domains_setReplyLabel","summary":"Choose the subdomain replies come back to","description":"**MCP tool:** `email_domains_setReplyLabel` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nReplies to the agent's mail come back to `<label>.<domain>` (default `reply`), which needs its own MX record. Change the label when that subdomain is already in use. The records change with it.","tags":["email"],"x-mcp-tool":"email_domains_setReplyLabel","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"replyLabel":{"type":"string","minLength":1,"maxLength":63,"description":"One DNS label, e.g. `reply` or `mail-in`."}},"required":["replyLabel"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"domain":{"type":"string","description":"The domain as stored: lower case, punycode for an internationalised name."},"unicode":{"type":"string","description":"The same name for display."},"status":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"mailFromDomain":{"type":"string","description":"The bounce subdomain (custom MAIL FROM), e.g. `bounce.example.com`."},"mailFromStatus":{"type":"string","enum":["pending","verified","failed","temporarily_failed"],"description":"`pending` until the DKIM records are seen; only a `verified` domain sends."},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","enum":["dkim","mail-from-mx","mail-from-spf","dmarc","reply-mx"]},"type":{"type":"string","enum":["CNAME","MX","TXT"]},"name":{"type":"string","description":"The full record name."},"value":{"type":"string"},"priority":{"description":"MX records only.","type":"number"},"required":{"type":"boolean","description":"Needed before the domain can send. DMARC and the reply MX are not."},"use":{"type":"string","enum":["send","receive","campaigns"],"description":"`send`: sending at all. `receive`: replies come back to the agent. `campaigns`: DMARC, needed for marketing email."}},"required":["purpose","type","name","value","required","use"]},"description":"Every record to publish at the domain's DNS host."},"hostedZoneAssumed":{"type":"boolean"},"verificationError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The mail service's reason for a failed check, e.g. `HOST_NOT_FOUND`."},"createdAt":{"type":"string","format":"date-time"},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string","enum":["mail-from-not-set","tenant-not-ready"]}},"replyDomain":{"type":"string","description":"Where replies to this domain's mail come back, e.g. `reply.example.com`."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"An unverified claim is released at this time, so nobody can hold a name they do not own. Null once verified."},"tenantStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The domain's standing with the mail service: ENABLED, REINSTATED or DISABLED. DISABLED stops its mail."}},"required":["domain","unicode","status","mailFromDomain","mailFromStatus","records","hostedZoneAssumed","verificationError","createdAt","verifiedAt","lastCheckedAt","warnings","replyDomain","expiresAt","tenantStatus"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"email_domains_remove","summary":"Stop sending from a domain","description":"**MCP tool:** `email_domains_remove` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nRemoves the domain from this workspace and from the mail service. Every email channel on it stops sending at once, campaigns on it stop, and replies to its reply subdomain are no longer received. Adding it back means publishing new DKIM records. Confirm with the operator first.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["email"],"x-mcp-tool":"email_domains_remove","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"removed":{"type":"boolean","const":true}},"required":["removed"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/domains/{domain}/setup-link":{"post":{"operationId":"email_domains_createSetupLink","summary":"Make a link for whoever runs the DNS","description":"**MCP tool:** `email_domains_createSetupLink` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nA page, open for seven days without signing in, that shows this domain's records, checks them live and gives instructions for the recognised DNS host. It shows nothing about the workspace but the domain. Making one retires the domain's previous link. The URL is returned only here; send it to the person who manages the DNS.","tags":["email"],"x-mcp-tool":"email_domains_createSetupLink","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["url","expiresAt"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"email_domains_revokeSetupLinks","summary":"Close the domain's DNS setup links","description":"**MCP tool:** `email_domains_revokeSetupLinks` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nEvery open setup link for this domain stops working at once.","tags":["email"],"x-mcp-tool":"email_domains_revokeSetupLinks","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":253,"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."},"description":"The domain, e.g. `example.com`, as `email.domains.list` shows it."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"revoked":{"type":"number"}},"required":["revoked"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/health":{"get":{"operationId":"email_health","summary":"Seven days of delivery from the workspace's domains","description":"**MCP tool:** `email_health` · **API key scope:** `read` · **Signed-in role:** Admin or above\n\nSent, delivered, bounced and complaint counts for mail from this workspace's own domains over the last seven days, with the bounce and complaint rates and a band: `good`, `watch`, `bad`, or `quiet` when too little was sent to say. A campaign pauses itself past 5% bounces, 0.1% complaints, or three complaints.","tags":["email"],"x-mcp-tool":"email_health","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"windowDays":{"type":"number"},"sent":{"type":"number"},"delivered":{"type":"number"},"bounced":{"type":"number"},"complaints":{"type":"number"},"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"A share, 0–1. Null when too few were sent to say."},"complaintRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"band":{"type":"string","enum":["good","watch","bad","quiet"]}},"required":["windowDays","sent","delivered","bounced","complaints","bounceRate","complaintRate","band"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/receiving":{"get":{"operationId":"email_receiving_list","summary":"How mail reaches each email channel","description":"**MCP tool:** `email_receiving_list` · **API key scope:** `read` · **Signed-in role:** Admin or above\n\nEvery email channel with the address it sends as, its agent, whether its domain is verified, the reply subdomain replies come back to and whether its MX record was found, and its Mirakash forwarding address if it has one. A channel receives mail one of two ways: replies to its own mail at the reply subdomain, or anything forwarded to its forwarding address.","tags":["email"],"x-mcp-tool":"email_receiving_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"configured":{"type":"boolean","description":"This deployment receives mail at all. False: nothing below receives yet."},"platformDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The domain forwarding addresses are on."},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"address":{"type":"string","description":"The address the channel sends as."},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"type":"boolean"},"onVerifiedDomain":{"type":"boolean","description":"The address is on a domain this workspace verified, so mail can go out as it."},"replyDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where replies to its mail come back, once its domain has one."},"replyMxFound":{"type":"boolean","description":"The last DNS check found the reply subdomain's MX record."},"route":{"anyOf":[{"type":"object","properties":{"address":{"type":"string","description":"The Mirakash forwarding address. Mail forwarded here reaches the channel's agent."},"channelId":{"type":"string"},"kind":{"type":"string","const":"platform"},"lastReceivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["address","channelId","kind","lastReceivedAt"]},{"type":"null"}],"description":"Its forwarding address, once made."}},"required":["id","label","address","agentId","agentName","enabled","onVerifiedDomain","replyDomain","replyMxFound","route"]}}},"required":["configured","platformDomain","channels"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/email/channels/{channelId}/forwarding-address":{"post":{"operationId":"email_receiving_createForwardingAddress","summary":"Give an email channel a forwarding address","description":"**MCP tool:** `email_receiving_createForwardingAddress` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nMakes (or returns) the channel's Mirakash address. Forward a support mailbox — Gmail, Microsoft 365, anything — to it, and that mail reaches the channel's agent. It works before the domain's DNS is done. A mail provider's forwarding confirmation code shows on the console's Email domains page.","tags":["email"],"x-mcp-tool":"email_receiving_createForwardingAddress","x-scope":"write","security":[{"bearerAuth":[]}],"parameters":[{"name":"channelId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"An email channel's id (`email.receiving.list`)."},"description":"An email channel's id (`email.receiving.list`)."}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"address":{"type":"string"},"created":{"type":"boolean","description":"False when the channel already had one."}},"required":["address","created"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"email_receiving_removeForwardingAddress","summary":"Remove an email channel's forwarding address","description":"**MCP tool:** `email_receiving_removeForwardingAddress` · **API key scope:** `write` · **Signed-in role:** Admin or above\n\nMail still forwarded to the address is dropped from then on, without a bounce. A new one made later is a different address. Confirm with the operator first.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["email"],"x-mcp-tool":"email_receiving_removeForwardingAddress","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"channelId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"removed":{"type":"boolean","const":true}},"required":["removed"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tools":{"get":{"operationId":"tools_list","summary":"List the tool library","description":"**MCP tool:** `tools_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nReusable tools available to agents — HTTP calls, connector actions, built-ins like sending a message or transferring to a human. Each entry carries its parameters, so this is also how to find out what an agent's tool actually takes.","tags":["tools"],"x-mcp-tool":"tools_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Stable, unique slug agents reference the tool by, e.g. `find_patient`."},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["function","webhook","transfer_to_human","transfer_call","transfer_to_agent","end_call","send_dtmf","send_message","knowledge_lookup","calendar","crm_lookup","label_emotion","schedule_follow_up","save_record","route_next_call","lookup_records","send_photo","send_catalogue","opt_out","send_document","verify_caller","place_order","request_payment","order_status","ask_choice","ask_form","show_media","present","show_compare","hide_media","guide_page","drive_page","use_computer"],"description":"What kind of tool: an HTTP `webhook`, or a built-in such as `transfer_to_human` or `send_message`."},"endpoint":{"description":"The URL called. `{paramName}` placeholders are filled from the call's arguments.","type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"description":"Extra request headers sent with the call. Values come back as `[redacted]` except `{{ENV_VAR}}` references and descriptive headers such as `Content-Type`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"connectorKey":{"description":"The integration connector the tool belongs to, if any.","type":"string"},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","enum"]},"description":{"type":"string"},"required":{"type":"boolean"},"enumValues":{"description":"The allowed values when `type` is `enum`.","type":"array","items":{"type":"string"}}},"required":["name","type"]}},"enabled":{"type":"boolean"},"domain":{"description":"When set, the tool reaches only agents of the same domain, e.g. `clinic-inbound`.","type":"string"},"autoAttach":{"description":"`false`: the tool reaches only agents that reference it explicitly.","type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","key","name","description","type","parameters","enabled","createdAt","updatedAt"]}},"total":{"type":"number"}},"required":["tools","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workflows":{"get":{"operationId":"workflows_list","summary":"List workflows","description":"**MCP tool:** `workflows_list` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nMulti-step processes built in the console — a graph of agent turns, tool calls and conditions. Published workflows are the ones safe to run; drafts are still being edited.","tags":["workflows"],"x-mcp-tool":"workflows_list","x-scope":"read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"workflows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Stable across versions; one published version per key."},"version":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","published","archived"]},"trigger":{"type":"object","properties":{"type":{"type":"string","enum":["inbound_call","inbound_message","outbound_campaign","scheduled","webhook","conversation_event","manual"]},"channel":{"description":"`inbound_call` / `inbound_message`: which channel.","type":"string"},"number":{"description":"`inbound_call`: the phone number that answers.","type":"string"},"contactList":{"description":"`outbound_campaign`: the contact list to dial.","type":"string"},"event":{"description":"`conversation_event`: the platform event; `webhook`: the external event name.","type":"string"},"schedule":{"description":"`scheduled`: the recurrence.","type":"object","properties":{"everyDays":{"type":"number"},"atHour":{"type":"number"},"cron":{"type":"string"}}},"filter":{"description":"A condition the trigger must also meet: `{ all: [...] }`, `{ any: [...] }`, `{ not: ... }` or `{ fact, op, value }`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type"],"description":"How a conversation enters the workflow."},"nodeCount":{"type":"number"},"agentNodeCount":{"type":"number","description":"Agent and agent-handoff steps. More than one means a multi-agent workflow."},"lastRunAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"connectorKeys":{"description":"Integration connectors its tool steps use.","type":"array","items":{"type":"string"}},"requiresApproval":{"description":"True when it contains a human-handoff step, so a run can pause on a person's decision.","type":"boolean"},"autoAttach":{"description":"`false`: callable only by agents that attach it explicitly. Otherwise every agent may call it once published.","type":"boolean"}},"required":["id","key","version","name","description","status","trigger","nodeCount","agentNodeCount","lastRunAt","updatedAt"]}},"total":{"type":"number"}},"required":["workflows","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workflows/{workflowId}":{"get":{"operationId":"workflows_get","summary":"Fetch a workflow's graph","description":"**MCP tool:** `workflows_get` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nThe workflow with every node and edge — what it does, in what order, and what each step needs. Read this before running one you did not build.","tags":["workflows"],"x-mcp-tool":"workflows_get","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"Stable across versions; one published version per key."},"version":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["draft","published","archived"]},"trigger":{"type":"object","properties":{"type":{"type":"string","enum":["inbound_call","inbound_message","outbound_campaign","scheduled","webhook","conversation_event","manual"]},"channel":{"description":"`inbound_call` / `inbound_message`: which channel.","type":"string"},"number":{"description":"`inbound_call`: the phone number that answers.","type":"string"},"contactList":{"description":"`outbound_campaign`: the contact list to dial.","type":"string"},"event":{"description":"`conversation_event`: the platform event; `webhook`: the external event name.","type":"string"},"schedule":{"description":"`scheduled`: the recurrence.","type":"object","properties":{"everyDays":{"type":"number"},"atHour":{"type":"number"},"cron":{"type":"string"}}},"filter":{"description":"A condition the trigger must also meet: `{ all: [...] }`, `{ any: [...] }`, `{ not: ... }` or `{ fact, op, value }`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type"],"description":"How a conversation enters the workflow."},"entryNodeId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The step a run starts from."},"exitOnGoal":{"type":"boolean","description":"End the run as soon as a goal step is reached."},"draftOfId":{"description":"On a draft copy of a published workflow: the published workflow it will be published into.","anyOf":[{"type":"string"},{"type":"null"}]},"autoAttach":{"description":"`false`: callable only by agents that attach it explicitly. Otherwise every agent may call it once published.","type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["agent","sub_workflow","action","condition","branch","merge","delay","wait_event","goal","exit"]},"actionType":{"anyOf":[{"type":"string","enum":["agent_handoff","human_handoff","consult","collect_input","send_message","end_call","tool_call","computer_task","connector_action","set_variable","webhook","notify"]},{"type":"null"}],"description":"What an `action` step does. Null for every other type."},"name":{"type":"string"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Step-specific settings: agent id, delay, condition, action parameters and so on."},"edges":{"type":"array","items":{"type":"object","properties":{"to":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The next step. Null ends the run on this path."},"label":{"description":"Selects the edge: `true` / `false` after a condition, a case label or `default` after a branch.","type":"string"}},"required":["to"]}},"position":{"anyOf":[{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},{"type":"null"}],"description":"Where the step sits on the builder canvas. Ignored when running."}},"required":["id","type","actionType","name","config","edges","position"]}}},"required":["id","key","version","name","description","status","trigger","entryNodeId","exitOnGoal","createdAt","updatedAt","nodes"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workflows/{workflowId}/runs":{"get":{"operationId":"workflows_runs","summary":"List a workflow's past runs","description":"**MCP tool:** `workflows_runs` · **API key scope:** `read` · **Signed-in role:** Viewer or above\n\nRecent executions with status, duration and the node-by-node trace — where a failing workflow actually failed.","tags":["workflows"],"x-mcp-tool":"workflows_runs","x-scope":"read","security":[{"bearerAuth":[]}],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","exited","escalated","failed"]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string","format":"date-time"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"runId":{"type":"string"},"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nodeType":{"type":"string"},"actionType":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"status":{"type":"string","enum":["pending","scheduled","running","completed","skipped","waiting","failed"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"handoff":{"description":"True for agent and human hand-off steps.","type":"boolean"},"agentName":{"description":"The agent that handled the step.","anyOf":[{"type":"string"},{"type":"null"}]},"executedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","runId","nodeId","nodeType","actionType","name","status","executedAt"]},"description":"The step-by-step trace."}},"required":["id","workflowId","status","summary","startedAt","finishedAt","steps"]}},"total":{"type":"number"}},"required":["runs","total"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workflows/{workflowId}/run":{"post":{"operationId":"workflows_run","summary":"Execute a workflow for real","description":"**MCP tool:** `workflows_run` · **API key scope:** `write` · **Signed-in role:** Member or above\n\nRuns the workflow end to end against the supplied input and returns the full trace: every node, what it decided, what it called, and what came back. Tool nodes hit real endpoints and agent nodes run real turns, so a workflow that books, sends or charges will do so.\n\n> **Real-world effects.** This places calls, sends messages or changes what live callers hear, and it cannot be undone from here. MCP clients are told so (`destructiveHint`) and should ask before calling it.","tags":["workflows"],"x-mcp-tool":"workflows_run","x-scope":"write","x-destructive":true,"security":[{"bearerAuth":[]}],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"description":"Starting context — the variables the workflow's first nodes read.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"Success. The result is under `data`.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"workflowId":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","exited","escalated","failed"]},"output":{"description":"The last meaningful step output: an agent reply, a tool result, a sub-workflow's output."},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The run context after the walk: the input plus everything collected or set."},"steps":{"type":"array","items":{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nodeType":{"type":"string"},"actionType":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"status":{"type":"string","enum":["pending","scheduled","running","completed","skipped","waiting","failed"]},"ok":{"type":"boolean","description":"The step ran without error. A side-effect step left pending is `false`."},"detail":{"type":"string"},"output":{"description":"The step's real output."},"handoff":{"type":"boolean"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["nodeId","nodeType","actionType","name","status","ok"]},"description":"Every step executed, in order."},"summary":{"type":"string","description":"One line on how the run went."}},"required":["workflowId","status","output","variables","steps","summary"]}},"required":["data"]}}}},"400":{"description":"`invalid_request` — the input failed validation, or the body is not JSON. `details` names each bad field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized` — no credential, or an unknown, revoked or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden` — a read-only key, or a signed-in person whose role is below this operation's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found` — no such object in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict` — the object is not in a state this change applies to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited` — slow down and retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal` — our fault. The message never carries the detail; retrying may help.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}