{"openapi":"3.1.0","info":{"title":"smao Public API","version":"1.10.0","summary":"Programmatic access to assistants, selectable voices, contact data, calls and recordings, website chats, and usage statistics.","description":"The smao Public API gives you programmatic access to the resources you\nmanage in the dashboard: assistants, selectable voices, assistant configuration\n(prompts, knowledge items, glossary, pronunciation, forwardings, calendars, tools), contact data,\ncall history with transcripts and recordings, outbound call triggering,\nwebsite chats from the Inbox (read-only), and usage statistics.\n\n## Base URL\n\nBase URL: `https://api.smao.ai/api/v1`\n\n## Authentication\n\nAll endpoints (except `/openapi.*` and `/docs`) require a bearer token in the\n`Authorization` header:\n\n```\nAuthorization: Bearer <your_api_key>\n```\n\nAPI keys are created in the smao dashboard under *Settings → API Keys*.\nEach key is scoped to a single organization and a single role. If that\norganization is blocked, every request with its keys returns HTTP 403\n`organization_blocked` before any other check.\n\n## Response shape\n\n**Success (2xx):**\n```json\n{ \"data\": { … } }\n```\nor for paginated list endpoints:\n```json\n{ \"data\": [ … ], \"meta\": { \"has_more\": false, \"next_cursor\": null } }\n```\n\n**Error (4xx / 5xx):**\n```json\n{ \"error\": { \"code\": \"validation_failed\", \"message\": \"…\", \"details\": [] } }\n```\n\nHosted smao operational writes can be denied after trial exhaustion while\ndashboard history remains accessible. Assistant creation and knowledge-item\nand prompt creation or updates return HTTP 403 with `trial_exhausted`,\n`subscription_required`, or `organization_access_required` when operational\nadmission fails. Existing\npublic API read entitlements and tenant/role checks remain unchanged.\n\n## Field naming\n\nAPI-defined request and response field names use `snake_case`. Caller-defined\nJSON objects such as tool parameters and custom webhook headers retain the\nkeys supplied by the caller. Timestamps are ISO-8601 strings in UTC. Object\nIDs are 24-character lowercase hex strings, except chat IDs, which are the\nUUIDs the dashboard Inbox shows.\n\n## Pagination\n\nList endpoints use **opaque cursor pagination**. Send `?limit=N` on the first\nrequest; if `meta.has_more` is `true`, pass `meta.next_cursor` back as the\n`cursor` query parameter for the next page. Cursors are opaque - do not parse\nor construct them. A `cursor` that is not base64url is rejected with\n`validation_failed`, and so is a `/phone-numbers` cursor without a phone\nnumber; any other value that does not decode to a list position (a\ntimestamp and a row id) restarts at the first page.\n\n## Rate limiting\n\nMatched operations are rate-limited per API key. Once authentication and the\nfeature gate succeed and the limiter has evaluated the request, responses\ninclude:\n\n- `X-RateLimit-Limit` - bucket limit\n- `X-RateLimit-Remaining` - remaining requests in the current window\n- `X-RateLimit-Reset` - unix timestamp when the window resets\n\nDefault buckets (deployments may override these values):\n\n| Category | Limit | Applies to |\n|---|---|---|\n| `read` | 1000 / min | All GET endpoints |\n| `write` | 200 / min | POST / PATCH / DELETE on all resources except `POST /calls` |\n| `outbound_trigger` | 60 / hour | POST /calls |\n\n`POST /calls` also permits only one outbound call per assistant in any\n60-second window. When a bucket is exhausted you receive HTTP `429` with\n`error.code = rate_limit_exceeded`, the rate-limit headers, and\n`Retry-After`. The limiter fails closed: if its storage cannot be reached,\nyou receive the same `429` with the rate-limit headers and\n`Retry-After: 30`. The per-assistant cooldown, including a storage failure\nwhile reserving it, uses the same status/code but does not include\n`Retry-After`. Authentication failures, feature-gate\nfailures, and unmatched routes do not include the complete rate-limit\nheader set. The rate-limit headers and `Retry-After` may also be absent\nfrom a `429` when the limiter itself fails before it can evaluate the\nbucket, for example because of a misconfiguration.\n","contact":{"name":"smao Support","email":"support@smao.ai"},"license":{"name":"Proprietary","identifier":"LicenseRef-Proprietary"}},"servers":[{"url":"https://api.smao.ai/api/v1","description":"API server"}],"tags":[{"name":"Meta","description":"Health and connectivity."},{"name":"Contacts","description":"Create and manage contact records - phone numbers, names, emails, group assignment."},{"name":"Groups","description":"Organize contacts, knowledge items, forwardings, glossary entries, and pronunciation rules."},{"name":"Knowledge-items","description":"Knowledge-base entries used by assistants for RAG."},{"name":"Prompts","description":"Reusable assistant prompts. There is one kind of prompt. An assistant uses\nthe prompt its `prompt_id` names and can name a second one for the calls it\nplaces itself (`outbound_prompt_id`); the same prompt can be used for\neither or both.\n\nPrompts can be rated automatically on every save. See `rating_status`\non the `Prompt` schema.\n"},{"name":"Assistants","description":"Voice assistants that answer and place your phone calls."},{"name":"Voices","description":"Voices currently selectable for new assistants and voice changes."},{"name":"Forwardings","description":"Call-forwarding targets (phone or SIP) that assistants route to."},{"name":"Glossary","description":"Domain-specific terms and abbreviations assistants use during calls."},{"name":"Pronunciation","description":"Word-level pronunciation overrides that assistants apply when speaking during calls. Each rule matches one written token, not a multi-word phrase. Replacement text and spell-out affect both voice generations; IPA transcriptions are applied on v2 voices and ignored on v1 voices. A speaking rate can be stored on a rule but is currently not applied when the word is spoken."},{"name":"Calendars","description":"Opening-hours calendars - multi-schedule (opening/service/office/operating), weekly templates, and date-specific overrides that assistants consult during calls."},{"name":"Calls","description":"Read call history, fetch recordings, and trigger outbound calls."},{"name":"Chats","description":"Read-only access to website-widget chats from the dashboard Inbox - the chat, the visitor's details, and the messages the visitor saw. Requires the widgets feature and a role that can view Inbox conversations. Replying, takeover, assignment, and status changes stay in the dashboard."},{"name":"Statistics","description":"Aggregated call statistics - weekly and monthly usage breakdowns, per-assistant rollups, and last-24h hourly counts. Read-only, computed at query time."},{"name":"Tools","description":"Custom webhook tools that assistants invoke during calls. v1 supports webhook-type tools only (integration tools are created via the dashboard OAuth flow). Auth secrets are stored encrypted and never returned; responses show `has_secret` instead."}],"security":[{"bearerAuth":[]}],"paths":{"/ping":{"get":{"operationId":"getPing","tags":["Meta"],"summary":"Health check","description":"Confirms the API is reachable and your API key is valid.","responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","example":true},"now":{"type":"string","format":"date-time"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/contacts":{"get":{"operationId":"listContacts","tags":["Contacts"],"summary":"List contacts","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit200"},{"name":"group_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Filter by contacts group."}],"responses":{"200":{"description":"Page of contacts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageContact"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createContact","tags":["Contacts"],"summary":"Create a contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/contacts/{contact_id}":{"parameters":[{"$ref":"#/components/parameters/ContactId"}],"get":{"operationId":"getContact","tags":["Contacts"],"summary":"Get a contact","responses":{"200":{"description":"The contact.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateContact","tags":["Contacts"],"summary":"Update a contact","description":"Partial update - only included fields are changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdate"}}}},"responses":{"200":{"description":"Updated contact.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteContact","tags":["Contacts"],"summary":"Delete a contact","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/groups":{"get":{"operationId":"listGroups","tags":["Groups"],"summary":"List groups","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit200"},{"name":"type","in":"query","schema":{"type":"string","enum":["contacts","knowledges","forwardings","glossaries","pronunciations"]},"description":"Filter by group type."}],"responses":{"200":{"description":"Page of groups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageGroup"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createGroup","tags":["Groups"],"summary":"Create a group","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Group"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/groups/{group_id}":{"parameters":[{"$ref":"#/components/parameters/GroupId"}],"get":{"operationId":"getGroup","tags":["Groups"],"summary":"Get a group","responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Group"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateGroup","tags":["Groups"],"summary":"Update a group","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupUpdate"}}}},"responses":{"200":{"description":"Updated group.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Group"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteGroup","tags":["Groups"],"summary":"Delete a group","description":"Permanently deletes the group and all contacts, knowledge items,\nforwardings, glossary entries, or pronunciation rules it contains.\nKnowledge chunks are also removed. This operation is not reversible.\n\nFails with 409 `conflict` if the group is assigned to an assistant or is\nthe organization's last group of that type.\n","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/knowledge-items":{"get":{"operationId":"listKnowledgeItems","tags":["Knowledge-items"],"summary":"List knowledge items","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"},{"name":"group_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Filter by knowledges group."}],"responses":{"200":{"description":"Page of knowledge items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageKnowledgeItem"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createKnowledgeItem","tags":["Knowledge-items"],"summary":"Create a knowledge item","description":"Creates a new knowledge item and asynchronously embeds its text for\nretrieval. `sync_status.state` follows the lifecycle:\n\n`pending` → `syncing` → `synced` or `failed`. Automatic retries can still\nmove a `failed` item to `synced`. An inactive item\n(`active: false`) is not indexed and stays `pending`.\n\nPoll the item via `GET` to observe the transition. `pending` is\nnon-terminal: use a client-side polling timeout because a queueing\nfailure can leave the item pending. A later valid `PATCH` re-enqueues\nindexing; contact support if the state does not progress.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeItemCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KnowledgeItem"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/knowledge-items/{knowledge_item_id}":{"parameters":[{"$ref":"#/components/parameters/KnowledgeItemId"}],"get":{"operationId":"getKnowledgeItem","tags":["Knowledge-items"],"summary":"Get a knowledge item (with full text)","responses":{"200":{"description":"The knowledge item.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KnowledgeItemDetail"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateKnowledgeItem","tags":["Knowledge-items"],"summary":"Update a knowledge item","description":"Every update currently re-indexes the item, including changes limited\nto `name`, `group_id`, or `active`. `sync_status.state` resets to\n`pending` and follows the same lifecycle as a fresh create:\n\n`pending` → `syncing` → `synced` or `failed`. Automatic retries can still\nmove a `failed` item to `synced`. An inactive item\n(`active: false`) is not indexed and stays `pending`.\n\nUse a client-side polling timeout because a queueing failure can leave\nthe item pending.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeItemUpdate"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/KnowledgeItem"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteKnowledgeItem","tags":["Knowledge-items"],"summary":"Delete a knowledge item","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prompts":{"get":{"operationId":"listPrompts","tags":["Prompts"],"summary":"List prompts","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"}],"responses":{"200":{"description":"Page of prompts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePrompt"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createPrompt","tags":["Prompts"],"summary":"Create a prompt","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prompt"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/prompts/{prompt_id}":{"parameters":[{"$ref":"#/components/parameters/PromptId"}],"get":{"operationId":"getPrompt","tags":["Prompts"],"summary":"Get a prompt","responses":{"200":{"description":"The prompt.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prompt"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updatePrompt","tags":["Prompts"],"summary":"Update a prompt","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptUpdate"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Prompt"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deletePrompt","tags":["Prompts"],"summary":"Delete a prompt","description":"Before deleting, clear the `prompt_id` and `outbound_prompt_id`\nreferences from every assistant that uses the prompt. The server returns\n409 `conflict` while the prompt is still assigned in either place.\n","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/voices":{"get":{"operationId":"listVoices","tags":["Voices"],"summary":"List selectable voices","description":"Returns the voices the authenticated instance can assign to a new\nassistant or select during a voice change. Legacy voices retained by\nexisting assistants are not returned.\n","responses":{"200":{"description":"Selectable voices.","content":{"application/json":{"schema":{"type":"object","required":["data"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Voice"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/phone-numbers":{"get":{"operationId":"listPhoneNumbers","tags":["Assistants"],"summary":"List purchased phone numbers for new assistants","description":"Returns the purchased phone numbers your organization can give a new\nassistant: numbers your instance allocated to the organization that no\nassistant uses yet. Send a number's `id` as `phone_number_id` when\ncreating an assistant. The list is empty when the organization has\nnone. Without `phone_number_id`, the platform allocates a number,\nexcept for organizations that route calls through their own assigned\ncarrier: they must send a `phone_number_id` from this list. Ordered by\nnumber.\n","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"}],"responses":{"200":{"description":"Page of available purchased numbers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePhoneNumber"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/assistants":{"get":{"operationId":"listAssistants","tags":["Assistants"],"summary":"List assistants","description":"Returns a paginated list of assistants in your organization.","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"}],"responses":{"200":{"description":"Page of assistants.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageAssistant"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createAssistant","tags":["Assistants"],"summary":"Create an assistant","description":"Creates a new assistant and provisions a phone number for it. The\n`phone_number` field on the response is assigned by the platform -\ncallers cannot set or change it via this API. To use one of your\norganization's purchased numbers instead, send its `id` from\n`GET /phone-numbers` as `phone_number_id`: a number that is not\navailable to your organization returns 404, one taken meanwhile 409.\nOrganizations that route calls through their own assigned carrier must\nsend `phone_number_id`; the platform does not allocate a number for\nthem, and a request without it returns 400 `validation_failed`. While\nthe organization's first assistant is still being set up, or when its\nassigned carrier is no longer available, the request returns 409\n`conflict`.\nCross-resource refs (prompt_id, knowledge_group_ids, etc.) are\nvalidated to belong to your organization before the assistant is\nsaved.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Assistant"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/assistants/{assistant_id}":{"parameters":[{"$ref":"#/components/parameters/AssistantId"}],"get":{"operationId":"getAssistant","tags":["Assistants"],"summary":"Get an assistant","description":"Returns the configuration of an assistant in your organization.","responses":{"200":{"description":"The assistant.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Assistant"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateAssistant","tags":["Assistants"],"summary":"Update an assistant","description":"Partial update - only included fields are changed. `phone_number` and\n`carrier` are read-only and cannot be updated via this endpoint.\nCross-resource refs are validated to belong to your organization.\n\nWhen `introduction` is included, the successful response confirms that\nthe new opening text has been committed to the active assistant\nconfiguration used by the dashboard and by newly initialized calls.\nExisting localized translations are regenerated asynchronously;\nalready initialized or in-progress calls keep the configuration they\nloaded earlier.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantUpdate"}}}},"responses":{"200":{"description":"Updated assistant.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Assistant"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteAssistant","tags":["Assistants"],"summary":"Delete an assistant","description":"Fails with `409 conflict` while the assistant is in use: a website widget\nreferences it, an open chat is answered by it, one of its calls is still\nrunning, or a start-call node in one of the organization's analyses places\nits calls with it (the message names those analyses). Enterprise\nassistants, and lines managed for you by the platform, cannot be deleted\nat all and always answer `409 conflict`.\n","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/forwardings":{"get":{"operationId":"listForwardings","tags":["Forwardings"],"summary":"List forwardings","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"},{"name":"group_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Filter by forwardings group."}],"responses":{"200":{"description":"Page of forwardings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageForwarding"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createForwarding","tags":["Forwardings"],"summary":"Create a forwarding","description":"Creates a new forwarding target inside a forwardings-type group. The\nreferenced `group_id` must belong to your organization and have\n`type: forwardings`. When `destination_type` is `sip`, `sip_uri` is\nrequired. When `destination_type` is `sip_refer`, `sip_refer_target`\nis required. For a usable `phone` destination, provide a non-empty\n`phone_number`; current request validation also accepts an omitted or\nempty value, which produces a target that cannot be dialed.\n","requestBody":{"required":true,"content":{"application/json":{"example":{"group_id":"65a1234567890abcdef01234","type":"queue","destination_type":"phone","phone_number":"+12025550123"},"schema":{"$ref":"#/components/schemas/ForwardingCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Forwarding"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The referenced `group_id` does not exist in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Group not found"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/forwardings/{forwarding_id}":{"parameters":[{"$ref":"#/components/parameters/ForwardingId"}],"get":{"operationId":"getForwarding","tags":["Forwardings"],"summary":"Get a forwarding","responses":{"200":{"description":"The forwarding.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Forwarding"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateForwarding","tags":["Forwardings"],"summary":"Update a forwarding","description":"Partial update - only included fields are changed. `group_id` cannot\nbe changed via this endpoint; create a new forwarding in the target\ngroup instead. When changing to `destination_type: phone`, also send a\nnon-empty `phone_number`; the validator permits it to be omitted or\nempty, but the resulting target cannot be dialed. Returns 409\n`conflict` when the stored forwarding forbids the change: a field the\nemployee record owns on a forwarding with `identity_source: employee`,\nor a non-empty `dtmf_sequence` on a forwarding with warm transfer\nenabled in the dashboard.\n","requestBody":{"required":true,"content":{"application/json":{"example":{"timeout":30},"schema":{"$ref":"#/components/schemas/ForwardingUpdate"}}}},"responses":{"200":{"description":"Updated forwarding.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Forwarding"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteForwarding","tags":["Forwardings"],"summary":"Delete a forwarding","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/glossary":{"get":{"operationId":"listGlossary","tags":["Glossary"],"summary":"List glossary items","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"},{"name":"group_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Filter by glossaries group."}],"responses":{"200":{"description":"Page of glossary items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageGlossary"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createGlossary","tags":["Glossary"],"summary":"Create a glossary item","description":"Creates a new glossary item inside a glossaries-type group. The\nreferenced `group_id` must belong to your organization and have\n`type: glossaries`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Glossary"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The referenced `group_id` does not exist in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Group not found"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/glossary/{glossary_id}":{"parameters":[{"$ref":"#/components/parameters/GlossaryId"}],"get":{"operationId":"getGlossary","tags":["Glossary"],"summary":"Get a glossary item","responses":{"200":{"description":"The glossary item.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Glossary"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateGlossary","tags":["Glossary"],"summary":"Update a glossary item","description":"Partial update - only included fields are changed. `group_id` cannot\nbe changed via this endpoint; create a new glossary item in the target\ngroup instead.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlossaryUpdate"}}}},"responses":{"200":{"description":"Updated glossary item.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Glossary"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteGlossary","tags":["Glossary"],"summary":"Delete a glossary item","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pronunciation":{"get":{"operationId":"listPronunciation","tags":["Pronunciation"],"summary":"List pronunciation items","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"},{"name":"group_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Filter by pronunciations group."}],"responses":{"200":{"description":"Page of pronunciation items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagePronunciation"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createPronunciation","tags":["Pronunciation"],"summary":"Create a pronunciation item","description":"Creates a new pronunciation item inside a pronunciations-type group. The\nreferenced `group_id` must belong to your organization and have\n`type: pronunciations`.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Pronunciation"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The referenced `group_id` does not exist in your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Group not found"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/pronunciation/{pronunciation_id}":{"parameters":[{"$ref":"#/components/parameters/PronunciationId"}],"get":{"operationId":"getPronunciation","tags":["Pronunciation"],"summary":"Get a pronunciation item","responses":{"200":{"description":"The pronunciation item.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Pronunciation"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updatePronunciation","tags":["Pronunciation"],"summary":"Update a pronunciation item","description":"Partial update - only included fields are changed. `group_id` cannot\nbe changed via this endpoint; create a new pronunciation item in the\ntarget group instead.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PronunciationUpdate"}}}},"responses":{"200":{"description":"Updated pronunciation item.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Pronunciation"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deletePronunciation","tags":["Pronunciation"],"summary":"Delete a pronunciation item","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/calendars":{"get":{"operationId":"listCalendars","tags":["Calendars"],"summary":"List calendars","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"}],"responses":{"200":{"description":"Page of calendars.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCalendar"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createCalendar","tags":["Calendars"],"summary":"Create a calendar","description":"Creates a new calendar. You can optionally seed one or more schedules\n(opening hours, service hours, etc.) along with their weekly template\nand date-specific overrides in a single request. Calendar names must\nbe unique within your organization.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Calendar"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"A calendar with that name already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"A calendar with this name already exists"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/calendars/{calendar_id}":{"parameters":[{"$ref":"#/components/parameters/CalendarId"}],"get":{"operationId":"getCalendar","tags":["Calendars"],"summary":"Get a calendar","responses":{"200":{"description":"The calendar.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Calendar"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateCalendar","tags":["Calendars"],"summary":"Update a calendar","description":"Partial update - only included fields are changed. Passing\n`schedules` replaces the calendar's full schedules array.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarUpdate"}}}},"responses":{"200":{"description":"Updated calendar.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Calendar"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"A calendar with that name already exists, the new `schedules` omit\nthe `id` of a schedule that a website widget's availability uses,\nor, when `schedules` is sent, the organization is busy with a\nconflicting change such as its deletion.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"A calendar with this name already exists"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteCalendar","tags":["Calendars"],"summary":"Delete a calendar","description":"Deletes a calendar. Fails with `409 conflict` if the calendar is still\nassigned to one or more assistants or a website widget's availability\nuses it - unlink it from every assistant first (via the Assistants\nendpoint) and from the widget in the dashboard, then retry. Also\nreturns 409 while the organization is busy with a conflicting change\nsuch as its deletion.\n","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Calendar is still assigned to one or more assistants or used by a website widget's availability, or the organization is busy with a conflicting change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"This calendar is still being used by assistants"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/calls":{"get":{"operationId":"listCalls","tags":["Calls"],"summary":"List calls","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitCalls"},{"name":"assistant_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Filter by assistant."},{"name":"assistant_phone","in":"query","schema":{"type":"string","pattern":"^\\+\\d{6,20}$","example":"+491701234567"},"description":"Filter by assistant phone number. E.164 format - a leading `+` followed by 6–20 digits."},{"name":"created_from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"created_to","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Page of calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCall"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createCall","tags":["Calls"],"summary":"Trigger an outbound call","description":"Starts an outbound call. Provide exactly one of `assistant_id` or\n`assistant_phone` to select the assistant, and exactly one of `to` or\n`target_phone` for the destination number (`to` is preferred, `target_phone`\nis an alias retained for backwards compatibility).\n\n`introduction` sets the greeting for this call only, in place of the\nassistant's introduction; `details` adds context to the assistant's\nprompt for this call. Neither changes the assistant.\n\nThis operation uses the per-key `outbound_trigger` bucket (60 requests\nper hour by default) and a separate one-outbound-call-per-assistant\ncooldown over a rolling 60-second window. A cooldown rejection is 429\n`rate_limit_exceeded` without `Retry-After`.\n\nIf the normalized destination equals the selected assistant's normalized\nown phone number, or exactly matches a caller-blocking entry assigned to\nthat assistant, no call is created and the operation returns 409\n`outbound_target_blocked`. The own-number restriction is intrinsic.\nCaller-blocking lists and Assistant assignments are managed in Dashboard →\nSettings → Blocked callers; the Public API does not expose caller-blocking\nconfiguration. Retrying the same destination while it remains blocked\nreturns the same rejection.\n","requestBody":{"required":true,"content":{"application/json":{"examples":{"assistantIdTo":{"summary":"Assistant ID and preferred destination field","value":{"assistant_id":"65a1234567890abcdef01234","to":"+12025550123"}},"assistantIdTargetPhone":{"summary":"Assistant ID and legacy destination field","value":{"assistant_id":"65a1234567890abcdef01234","target_phone":"+12025550123"}},"assistantPhoneTo":{"summary":"Assistant phone and preferred destination field","value":{"assistant_phone":"+12025550120","to":"+12025550123"}},"assistantPhoneTargetPhone":{"summary":"Assistant phone and legacy destination field","value":{"assistant_phone":"+12025550120","target_phone":"+12025550123"}},"ownIntroduction":{"summary":"Own greeting and context for this call","value":{"assistant_id":"65a1234567890abcdef01234","to":"+12025550123","introduction":"Hello @firstName, this is @assistantName, the digital assistant of @companyName. I'm calling because your gas delivery arrives on Friday, November 7, between 8 and 12 in the morning.","details":"Order 4711: 3,000 litres of LPG. Delivery Friday, November 7, 8 to 12 a.m. The driver calls 30 minutes ahead. To change the date, the customer calls the office."}}},"schema":{"$ref":"#/components/schemas/TriggerOutbound"}}}},"responses":{"201":{"description":"Call created and queued.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","required":["call_id","assistant_id","assistant_phone","to","status","created_at"],"properties":{"call_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65f8fa6f1a9d8e0012ab34cd"},"assistant_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"},"assistant_phone":{"type":"string","pattern":"^\\+\\d{6,20}$","example":"+491701234567","description":"E.164 phone number the call is placed from."},"to":{"type":"string","pattern":"^\\+\\d{6,20}$","example":"+491701234999","description":"Normalized E.164 destination number."},"status":{"type":"string","example":"queued"},"created_at":{"type":"string","format":"date-time"}}}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The normalized destination is the selected assistant's own phone number or is blocked for that assistant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"outbound_target_blocked","message":"The target phone number is blocked for this assistant"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/calls/{call_id}":{"parameters":[{"$ref":"#/components/parameters/CallId"}],"get":{"operationId":"getCall","tags":["Calls"],"summary":"Get a call with transcript, analyses, and notes","responses":{"200":{"description":"The call.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CallDetail"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/calls/{call_id}/recording":{"parameters":[{"$ref":"#/components/parameters/CallId"}],"get":{"operationId":"getCallRecording","tags":["Calls"],"summary":"Download the call recording","description":"Returns the audio recording as a binary stream. Supports HTTP `Range`\nfor partial content. Returns 404 with JSON envelope when no recording\nexists for the call.\n","responses":{"200":{"description":"Audio stream. The actual `Content-Type` depends on the recording's\nstored format - current recordings are FLAC, legacy recordings may\nbe WAV. Clients should dispatch on the response `Content-Type` rather\nthan assuming a single format.\n","content":{"audio/flac":{"schema":{"type":"string","format":"binary"}},"audio/wav":{"schema":{"type":"string","format":"binary"}}}},"206":{"description":"Partial content (byte range response)."},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteCallRecording","tags":["Calls"],"summary":"Permanently delete the call recording","description":"**Irreversible.** Erases every audio artifact of the call from object\nstorage - the master recording, both channel recordings, the playback\ntranscode and the waveform data - and reports success only after the\ndeletion has been verified. The call itself is kept: transcript,\nanalyses, notes, metadata and diagnostics are untouched, and the call\nkeeps appearing in `GET /calls`.\n\nAfterwards `recording.available` on the call is `false` and\n`GET /calls/{call_id}/recording` returns 404.\n\nRequires an API key whose role carries the `call_logs.call_recording`\ndelete permission; keys without it receive 403. Repeating the call on an\nalready-erased recording succeeds without changing anything, and a call\nthat never had a recording returns 404. A call that is still running, or\nwhose recording is still being processed, is rejected with 409 - retry\nonce the call has ended. A 500 means the audio was **not** fully removed\nand nothing was changed; the recording stays downloadable and the call is\nsafe to retry.\n","responses":{"200":{"description":"The recording was deleted and the deletion was verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/chats":{"get":{"operationId":"listChats","tags":["Chats"],"summary":"List website chats","description":"Chats from the website widget, newest activity first (`last_message_at`\ndescending). Chats in which the visitor never wrote are not listed.\n\nThe order follows activity, so a chat that receives a message while you\npage moves back to the front: it shows up on your next sync, not in the\ncurrent pass. For incremental sync, keep the newest `last_message_at` you\nhave seen and pass it as `last_message_from` next time.\n","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitCalls"},{"name":"status","in":"query","schema":{"type":"string","enum":["open","closed"]},"description":"Only open or only closed chats. Omit for both."},{"name":"widget_id","in":"query","schema":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65f8fa6f1a9d8e0012ab34ce"},"description":"Filter by widget."},{"name":"needs_human","in":"query","schema":{"type":"boolean"},"description":"`true` - the chat waits for a reply from the team: the visitor was handed over or wrote in a chat the team answers, and no team member has replied or taken over since."},{"name":"last_message_from","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only chats whose last message is at or after this time."},{"name":"last_message_to","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only chats whose last message is at or before this time."}],"responses":{"200":{"description":"Page of chats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageChat"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/chats/{chat_id}":{"parameters":[{"$ref":"#/components/parameters/ChatId"}],"get":{"operationId":"getChat","tags":["Chats"],"summary":"Get a website chat with its messages","description":"The chat and the messages the visitor saw, oldest first: visitor\nmessages, AI replies, team replies, and system notices. Internal\nmessages such as the AI's tool calls are not included. Reading a chat\nnever marks it as read.\n","responses":{"200":{"description":"The chat.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChatDetail"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/statistics/summary":{"get":{"operationId":"getStatisticsSummary","tags":["Statistics"],"summary":"List available statistics filters","description":"Returns the filter values that populate statistics dashboards:\nevery ISO (week, year) pair, in German time (Europe/Berlin), in which\nat least one completed call of the organization started, plus every\nassistant in the organization. The `all`\nassistant sentinel is **not** returned - clients can always pass\n`assistant_id=all` to the `/usage` endpoint regardless of this list.\n","responses":{"200":{"description":"Filter values.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatisticsSummary"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/statistics/usage":{"get":{"operationId":"getStatisticsUsage","tags":["Statistics"],"summary":"Usage breakdown for a week + assistant filter","description":"Returns the monthly + weekly + last-24h breakdown for the selected\nweek/year window. `assistant_id=all` aggregates across every assistant;\npassing a concrete 24-hex ID filters to that assistant's calls only.\nSupplying an ID that does not belong to the caller's organization\nreturns 404.\n\nAll duration fields are whole **seconds** (rounded down), not minutes,\nrated the way smao invoices calls: each call counts its recorded assistant session\ntime with a minimum of 60 seconds, and the time stops once the platform\nhands the call off completely (a completed SIP REFER transfer). A call\nwithout recorded session time counts 0 seconds, for example a call\nbypassed to another destination before it reaches the assistant or one\nrejected by admission policy. Calls fall into weeks, days and hours by\ntheir start time in German time (Europe/Berlin); deleted calls count the\nusage recorded when they were deleted. `hourly_call_counts_last_24h`\nalways reflects the 24h window ending at request time - it ignores the\n`week`/`year` filter.\n","parameters":[{"name":"week","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":53,"example":17},"description":"ISO week number (1–53). The week runs Monday 00:00 to Sunday 24:00 in German time (Europe/Berlin)."},{"name":"year","in":"query","required":true,"schema":{"type":"integer","minimum":2020,"maximum":2100,"example":2026}},{"name":"assistant_id","in":"query","required":true,"description":"Either the sentinel `all` or a 24-hex assistant id.","schema":{"oneOf":[{"type":"string","enum":["all"]},{"type":"string","pattern":"^[a-f0-9]{24}$"}]},"examples":{"all":{"value":"all","summary":"Aggregate across every assistant"},"one":{"value":"65a1234567890abcdef01234","summary":"Filter to one assistant"}}}],"responses":{"200":{"description":"Usage breakdown.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatisticsUsage"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The supplied `assistant_id` does not exist in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Assistant not found"}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/statistics/assistants":{"get":{"operationId":"getStatisticsAssistants","tags":["Statistics"],"summary":"Per-assistant usage for a week","description":"Returns one breakdown row per assistant that had at least one completed\ncall starting in the selected week. Includes assistants that have since\nbeen deleted - their calls still count and the row carries\n`is_deleted: true`. Duration fields are integer seconds, rated as\ndescribed for `/statistics/usage`.\n","parameters":[{"name":"week","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":53,"example":17},"description":"ISO week number (1–53). The week runs Monday 00:00 to Sunday 24:00 in German time (Europe/Berlin)."},{"name":"year","in":"query","required":true,"schema":{"type":"integer","minimum":2020,"maximum":2100,"example":2026}}],"responses":{"200":{"description":"Per-assistant usage.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/StatisticsAssistantsUsage"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tools":{"get":{"operationId":"listTools","tags":["Tools"],"summary":"List tools","description":"Returns the organization's custom tools, ordered by `created_at` DESC.\nAuth configuration is summarized - the stored secret value is never\nreturned; `auth.has_secret` indicates whether a credential is set.\n","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/LimitDefault"}],"responses":{"200":{"description":"Page of tools.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageTool"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createTool","tags":["Tools"],"summary":"Create a tool","description":"Creates a new webhook-type tool. `tool_key` must be unique within your\norganization; reuse returns 409. Submit auth secrets on create or PATCH\nto set or rotate them.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCreate"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Tool"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"A tool with the requested `tool_key` already exists in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"A tool with that tool_key already exists."}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tools/{tool_id}":{"parameters":[{"$ref":"#/components/parameters/ToolId"}],"get":{"operationId":"getTool","tags":["Tools"],"summary":"Get a tool","responses":{"200":{"description":"The tool.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Tool"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateTool","tags":["Tools"],"summary":"Update a tool","description":"Partial update - only included fields are changed. `tool_key` and\n`execution_type` are immutable (create a new tool instead). To rotate\nan auth secret, submit a full `auth` object with the new value; the\nprevious secret is overwritten in place. A stored credential never\nfollows a URL change: a PATCH that changes `webhook.url` of a tool with a\nstored credential must include `auth` with that credential, otherwise it\nreturns 400 and nothing changes.\n\nA `webhook` object replaces the stored webhook configuration as a\nwhole: omitted `method`, `timeout_ms` and `retry_count` fall back to\n`POST`, `10000` and `0`, and omitted `headers` and `body_template` are\nremoved. Send the complete webhook configuration to change one field.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUpdate"}}}},"responses":{"200":{"description":"Updated tool.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Tool"}}}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteTool","tags":["Tools"],"summary":"Delete a tool","description":"Deletes the tool and removes its `_id` from any assistant's `tool_ids`\nlist so no assistant is left referencing a missing tool.\n","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptySuccess"}}}},"400":{"$ref":"#/components/responses/ValidationFailed"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/SubscriptionRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key in the `Authorization: Bearer <key>` header.\nKeys are created in the smao dashboard (*Settings → API Keys*).\n"}},"headers":{"XRateLimitLimit":{"description":"Maximum requests allowed in the current window for this bucket.","schema":{"type":"integer","example":1000}},"XRateLimitRemaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":997}},"XRateLimitReset":{"description":"Unix timestamp (seconds) when the window resets.","schema":{"type":"integer","example":1776902940}},"RetryAfter":{"description":"Seconds to wait before retrying after a 429 response.","schema":{"type":"integer","example":60}}},"parameters":{"Cursor":{"name":"cursor","in":"query","description":"Opaque cursor from a prior `meta.next_cursor`. Base64url-encoded\n(unpadded) - do not parse or construct it manually. A value that is not\nbase64url is rejected with `validation_failed`, and so is a\n`/phone-numbers` cursor without a phone number; any other value that does\nnot decode to a list position (a timestamp and a row id) restarts at the\nfirst page.\n","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]+$"}},"Limit200":{"name":"limit","in":"query","description":"Items per page (1–200, default 50).","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"LimitDefault":{"name":"limit","in":"query","description":"Items per page (1–100, default 50).","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"LimitCalls":{"name":"limit","in":"query","description":"Items per page (1–100, default 25).","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},"ContactId":{"name":"contact_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"GroupId":{"name":"group_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"KnowledgeItemId":{"name":"knowledge_item_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"PromptId":{"name":"prompt_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"AssistantId":{"name":"assistant_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"ForwardingId":{"name":"forwarding_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"GlossaryId":{"name":"glossary_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"PronunciationId":{"name":"pronunciation_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CalendarId":{"name":"calendar_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"CallId":{"name":"call_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"ChatId":{"name":"chat_id","in":"path","required":true,"description":"The chat's UUID, as the dashboard Inbox shows it and `listChats` returns it.","example":"3f2b8c1e-9a4d-4c6b-8f1e-2d7a5b9c0e41","schema":{"type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"}},"ToolId":{"name":"tool_id","in":"path","required":true,"example":"65f8fa6f1a9d8e0012ab34cd","schema":{"type":"string","pattern":"^[a-f0-9]{24}$"}}},"responses":{"Unauthorized":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"Missing API key"}}}}},"Forbidden":{"description":"The API key's role lacks permission, an operational write is unavailable (trial_exhausted, subscription_required, organization_access_required), or the key's organization is blocked (organization_blocked).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"No permission"}}}}},"NotFound":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Not found"}}}}},"ValidationFailed":{"description":"Request body or query parameters failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_failed","message":"Validation failed"}}}}},"Conflict":{"description":"Resource is in use or the operation would violate an invariant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"Group is assigned to an assistant"}}}}},"RateLimited":{"description":"Rate limit exceeded. Bucket exhaustion includes the rate-limit headers and `Retry-After`; so does a fail-closed limiter-storage error, with `Retry-After: 30`. The separate outbound per-assistant cooldown, including a storage failure while reserving it, uses the same 429/code without `Retry-After`. The rate-limit headers may be absent only when the limiter itself fails before it can evaluate the bucket, for example because of a misconfiguration; `Retry-After` is then absent too.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"Rate limit exceeded"}}}}},"SubscriptionRequired":{"description":"A feature required by this endpoint is not enabled for the organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"subscription_required","message":"This feature is not available in your current subscription. Please upgrade to a higher plan"}}}}},"InternalError":{"description":"Unexpected server error. The operation did not complete. Safe to retry\nidempotent reads; for mutations, check the resource state before retrying.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"An unexpected error occurred."}}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","validation_failed","conflict","outbound_target_blocked","rate_limit_exceeded","subscription_required","trial_exhausted","organization_access_required","organization_blocked","internal_error"]},"message":{"type":"string"},"details":{"type":"array","description":"Optional validation details. Present only for schema/model validation failures.","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":["string","integer"]}},"message":{"type":"string"}}}}}}}},"EmptySuccess":{"type":"object","properties":{"data":{"type":"object","description":"Empty - present for envelope consistency."}}},"PageMeta":{"type":"object","required":["has_more","next_cursor"],"properties":{"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"Opaque cursor for the next page, or `null` on the last page."}}},"Contact":{"type":"object","required":["id","group_id","group_name","phone_numbers","first_name","last_name","email","company","gender","prompt","preferred_language","forwarding_id","created_at","updated_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"group_id":{"type":["string","null"],"example":"65a1234567890abcdef01234","description":"`null` for legacy or orphaned records with no group. Deleting a contacts group through this API deletes its contacts rather than clearing their group reference."},"group_name":{"type":["string","null"],"example":"VIP Customers"},"phone_numbers":{"type":"array","items":{"type":"string","example":"+491701234567"}},"first_name":{"type":"string","example":"Ada"},"last_name":{"type":"string","example":"Lovelace"},"email":{"type":"string","example":"ada@example.com"},"company":{"type":"string","example":"Analytical Engine Inc"},"gender":{"type":"string","example":"female","description":"Empty string means the contact's gender is not specified."},"prompt":{"type":"string","description":"Optional per-contact prompt fragment."},"preferred_language":{"type":"string","example":"en"},"forwarding_id":{"type":["string","null"],"example":"65a1234567890abcdef09999"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ContactCreate":{"type":"object","required":["group_id","phone_numbers"],"additionalProperties":false,"example":{"group_id":"65a1234567890abcdef01234","phone_numbers":["+12025550123"],"first_name":"Ada","last_name":"Lovelace"},"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"phone_numbers":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"example":"+491701234567"}},"first_name":{"type":"string","default":""},"last_name":{"type":"string","default":""},"email":{"type":"string","format":"email","default":"","description":"Email address. Empty string is accepted if you don't have the contact's email."},"company":{"type":"string","default":""},"prompt":{"type":"string","default":""},"preferred_language":{"type":"string","enum":["de","en","fr","it","de-CH","es","pt","tr","sv","fi","nl","unknown"],"example":"en"},"gender":{"type":"string","default":"","description":"Optional gender value. Omit it or send an empty string when not specified."},"forwarding_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","default":null}}},"ContactUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only the fields you want to change.","example":{"first_name":"Grace"},"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"phone_numbers":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string","format":"email","description":"Email address. Empty string is accepted if you don't have the contact's email."},"company":{"type":"string"},"prompt":{"type":"string"},"preferred_language":{"type":"string","enum":["de","en","fr","it","de-CH","es","pt","tr","sv","fi","nl","unknown"]},"gender":{"type":"string","description":"Send an empty string to clear the value; omit the property to preserve it."},"forwarding_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"}}},"PageContact":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"Group":{"type":"object","required":["id","type","name","description","created_at","updated_at"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["contacts","knowledges","forwardings","glossaries","pronunciations"]},"name":{"type":"string","example":"VIP Customers"},"description":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"GroupCreate":{"type":"object","required":["type","name"],"additionalProperties":false,"example":{"type":"contacts","name":"Priority Customers"},"properties":{"type":{"type":"string","enum":["contacts","knowledges","forwardings","glossaries","pronunciations"]},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Trimmed of leading/trailing whitespace before storage."},"description":{"type":"string","maxLength":500,"default":""}}},"GroupUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"example":{"name":"Enterprise Customers"},"properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Trimmed of leading/trailing whitespace before storage."},"description":{"type":"string","maxLength":500}}},"PageGroup":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Group"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"KnowledgeItemSyncStatus":{"type":"object","required":["state","synced_at","total_chunks","estimated_duration_ms","error"],"properties":{"state":{"type":"string","enum":["pending","syncing","synced","failed"],"description":"Indexing status."},"synced_at":{"type":["string","null"],"format":"date-time"},"total_chunks":{"type":["integer","null"]},"estimated_duration_ms":{"type":["integer","null"]},"error":{"type":["string","null"]}}},"KnowledgeItem":{"type":"object","description":"Summary shape - `text` is omitted; use the detail endpoint for full body.","required":["id","group_id","name","active","text_length","sync_status","created_at","updated_at"],"properties":{"id":{"type":"string"},"group_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"},"name":{"type":"string","example":"Shipping Policy"},"active":{"type":"boolean"},"text_length":{"type":"integer","maximum":5000000,"description":"Character count of the stored `text` body."},"sync_status":{"$ref":"#/components/schemas/KnowledgeItemSyncStatus"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"KnowledgeItemDetail":{"allOf":[{"$ref":"#/components/schemas/KnowledgeItem"},{"type":"object","required":["text"],"properties":{"text":{"type":"string"}}}]},"KnowledgeItemCreate":{"type":"object","required":["group_id","name","text"],"additionalProperties":false,"example":{"group_id":"65a1234567890abcdef01234","name":"Shipping Policy","text":"Orders ship within two business days."},"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Trimmed of leading/trailing whitespace before storage."},"text":{"type":"string","minLength":1,"maxLength":5000000},"active":{"type":"boolean","default":true}}},"KnowledgeItemUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"example":{"name":"International Shipping Policy"},"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Trimmed of leading/trailing whitespace before storage."},"text":{"type":"string","minLength":1,"maxLength":5000000},"active":{"type":"boolean"}}},"PageKnowledgeItem":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeItem"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"Prompt":{"type":"object","required":["id","name","description","prompt","type","health_score","approved","feedback","rated_at","rating_status","created_at","updated_at"],"description":"A reusable assistant prompt. When automated prompt rating is enabled,\nevery save is rated.\nThe rating fields (`health_score`, `approved`, `feedback`, `rated_at`,\n`rating_status`) are read-only - create/update requests reject them -\nand follow one of these `rating_status` lifecycles:\n\n- Blocking defect: `null` → `\"rated\"` immediately, with\n  `health_score: 0`, `approved: false` and feedback.\n- Otherwise: `null` → `\"pending\"` → `\"rated\"` or `\"failed\"`.\n\nWhen changed prompt content enters `\"pending\"`, stale rating fields are\ncleared instead of being shown for the new content. On `\"failed\"`, all\nrating fields except `rating_status` are cleared - the next save\nenqueues a fresh attempt. When rating is disabled,\n`rating_status`, `health_score`, `approved`, and `rated_at` remain\n`null`, and `feedback` remains an empty string.\n","properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"name":{"type":"string","example":"Sales - Initial Outreach"},"description":{"type":"string","example":"Opening prompt for cold outbound calls."},"prompt":{"type":"string","description":"The full prompt body passed to the assistant."},"type":{"type":"string","enum":["answering"],"deprecated":true,"description":"Deprecated. Prompt kinds were removed: there is one kind of prompt\nand email prompts no longer exist. Always `answering`. The field\nwill be removed in a later API version; do not rely on it.\n"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"health_score":{"type":["integer","null"],"minimum":0,"maximum":10,"example":8,"description":"Automated quality score from 0–10. `0` means a blocking defect was\nfound. `null` until\nthe first rating completes, and after a failed rating attempt.\n"},"approved":{"type":["boolean","null"],"example":true,"description":"Whether the review considers the prompt production-ready.\nAlways `false` for a score of `0`. Otherwise independent of\n`health_score`: a prompt does not need a perfect score to be approved.\n"},"feedback":{"type":"string","example":"The prompt follows the template exactly and is production-ready. No changes required.","description":"Review feedback. All natural-language feedback is written in the\ndominant supported language detected from the current prompt.\nRequest locale and assistant language do not select this language,\nand unsupported or unclassifiable prompts fail with empty feedback\ninstead of falling back to another language. Empty string until the\nfirst rating completes, while changed content is pending, and after\na failed rating attempt.\n"},"rated_at":{"type":["string","null"],"format":"date-time","description":"When the latest rating completed. `null` until the first rating completes, and after a failed attempt."},"rating_status":{"type":["string","null"],"enum":[null,"pending","rated","failed"],"example":"rated","description":"Rating lifecycle status:\n- `null` - never rated, or automated rating is disabled.\n- `\"pending\"` - save accepted, review queued or in flight. Rating fields are cleared when the prompt content changed.\n- `\"rated\"` - review complete; `health_score` / `approved` / `feedback` populated.\n- `\"failed\"` - review attempt failed. All other rating fields are cleared; the next save enqueues a fresh attempt.\n"}}},"PromptCreate":{"type":"object","required":["name","prompt"],"additionalProperties":false,"example":{"name":"Reception","prompt":"Answer customer questions clearly and concisely."},"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"prompt":{"type":"string","minLength":1,"maxLength":100000},"description":{"type":"string","maxLength":2000,"default":""}}},"PromptUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only the fields you want to change.","example":{"description":"Reception prompt for inbound customer calls."},"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"prompt":{"type":"string","minLength":1,"maxLength":100000},"description":{"type":"string","maxLength":2000}}},"PagePrompt":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Prompt"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"Voice":{"type":"object","required":["id","name","languages","gender","version"],"additionalProperties":false,"properties":{"id":{"type":"string","minLength":1,"description":"Voice ID to send as `voice_id` when creating or updating an assistant.","example":"1887"},"name":{"type":"string","minLength":1,"example":"Celine Weber"},"languages":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["de","en","fr","it","de-CH","es","pt","tr","sv","fi","nl"]},"example":["de"]},"gender":{"type":"string","enum":["female","male","neutral"],"example":"female"},"version":{"type":"string","enum":["v1","v2"],"description":"Voice version shown in the dashboard (`v1` or `v2`).","example":"v2"}}},"PreCallWebhook":{"type":["object","null"],"additionalProperties":false,"required":["enabled","url","method","headers","body_template","auth","timeout_ms"],"description":"Credential-free pre-call lookup configuration, or null if unconfigured.\nAuthentication secrets and passwords are never returned. A returned\nconfiguration can be sent back on PATCH without resending its stored\ncredentials.\n","example":{"enabled":true,"url":"https://crm.example.com/lookup","method":"POST","headers":{"X-Caller":"@callerNumber"},"body_template":"{\"caller\":\"@callerNumber\",\"session\":\"@sessionId\"}","timeout_ms":5000,"auth":{"type":"bearer"}},"properties":{"enabled":{"type":"boolean","description":"False disables execution without removing the stored configuration or credentials."},"url":{"type":["string","null"],"maxLength":2000,"description":"HTTPS endpoint, required and nonempty when enabled. URLs are not templated. Runtime SSRF protection blocks private destinations and redirects."},"method":{"type":"string","enum":["GET","POST"],"description":"Defaults to POST on first configuration. GET sends no body; use templated headers for lookup parameters."},"headers":{"type":["object","null"],"maxProperties":50,"propertyNames":{"maxLength":200,"pattern":"^[A-Za-z0-9!#$%&'*+.^_`|~-]+$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":2000},"description":"Custom header values support the body_template variables. Names are literal. A supplied map replaces all custom headers; null clears them. Use auth for credentials, not this readable map."},"body_template":{"type":"string","maxLength":50000,"description":"JSON/text template for POST. Empty (the default) sends the standard\nlookup payload. GET ignores this field. Supported variables:\n`@callerNumber`, `@assistantNumber`, `@direction`, `@assistantId`,\n`@assistantName`, `@organizationId`, `@sessionId`, `@language`.\nThe default payload uses those names without the @ prefix.\nCaller means the human in either call direction.\n"},"timeout_ms":{"type":"integer","minimum":500,"maximum":15000,"description":"Request timeout in milliseconds; defaults to 5000 on first configuration. The runner also bounds elapsed waiting to this value plus 500 ms."},"auth":{"type":["object","null"],"additionalProperties":false,"required":["type"],"description":"Only fields relevant to the auth type are returned. Secret and password are never returned, including as ciphertext.","properties":{"type":{"type":"string","enum":["none","apiKey","bearer","basic"]},"header_name":{"type":"string","minLength":1,"maxLength":200,"description":"apiKey only; omitted means x-api-key."},"username":{"type":"string","minLength":1,"maxLength":200,"description":"Basic auth only."}}}}},"PreCallWebhookAuthInput":{"description":"Omit `auth` on first configuration for no authentication. On PATCH,\nomission preserves it; null or `{ \"type\": \"none\" }` removes authentication.\nChanging the auth type discards all fields belonging to the old type.\n\n`apiKey` and `bearer` require `secret` on first configuration or an auth-type\nchange; `basic` requires `password`. On a same-type PATCH, omit the\ncredential to retain it, or supply a new nonempty value to rotate it.\nA stored credential never follows a URL change: a PATCH that sets a\ndifferent nonempty `url` must supply the credential again (or remove\nauthentication), otherwise it returns 400 and nothing changes.\nMissing required credentials return 400, even when the webhook is disabled.\nSecrets and passwords are encrypted before saving and are never returned.\n","oneOf":[{"title":"No authentication","type":"null"},{"title":"None","type":"object","additionalProperties":false,"required":["type"],"properties":{"type":{"type":"string","const":"none"}}},{"title":"API key","type":"object","additionalProperties":false,"required":["type"],"description":"Send secret in header_name, which defaults to x-api-key on first configuration. Omitting header_name on a same-type PATCH preserves the stored header name.","properties":{"type":{"type":"string","const":"apiKey"},"header_name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"secret":{"type":"string","minLength":1,"maxLength":4000,"writeOnly":true}}},{"title":"Bearer","type":"object","additionalProperties":false,"required":["type"],"description":"Send secret in the Authorization header using the Bearer scheme.","properties":{"type":{"type":"string","const":"bearer"},"secret":{"type":"string","minLength":1,"maxLength":4000,"writeOnly":true}}},{"title":"Basic","type":"object","additionalProperties":false,"required":["type","username"],"description":"Send username and password using HTTP Basic authentication. Include username whenever this auth object is supplied, even when retaining the stored password.","properties":{"type":{"type":"string","const":"basic"},"username":{"type":"string","minLength":1,"maxLength":200},"password":{"type":"string","minLength":1,"maxLength":4000,"writeOnly":true}}}]},"PreCallWebhookUrl":{"type":"string","format":"uri","maxLength":2000,"pattern":"^[Hh][Tt][Tt][Pp][Ss]://(?:[^/?#@]*@)?(?:\\[[^\\]]+\\]|[^:/?#@\\[\\]]+)(?::[0-9]*)?(?:[/?#]|$)"},"PreCallWebhookInput":{"type":["object","null"],"additionalProperties":false,"required":["enabled"],"description":"Optional lookup that supplies caller context from your endpoint at the\nstart of inbound and outbound calls. Add `@preCallData` to the assistant's\nassigned prompt to use the response. Saving this object does not call the\nendpoint or edit the prompt.\n\nEvery supplied object requires `enabled`. When true, include a nonempty\nHTTPS `url` in the same request, even if a URL is already stored. String\ninput limits count Unicode characters.\n\nOn creation or first configuration, omitted fields default to POST, empty\nheaders and body template, no authentication, and a 5000 ms timeout.\nOmit `pre_call_webhook` or send null on creation to leave it unconfigured.\n\nOn PATCH, omit `pre_call_webhook` to preserve it, or send null to remove\nthe configuration and credentials. A supplied object merges with the\nstored configuration; omitted nested fields retain their values, except\nthat changing `url` requires the stored credential again (see `auth`).\n`{ \"enabled\": false }` disables execution while retaining the configuration\nand credentials. See `headers` and `auth` for their replacement rules.\nA concurrent clear,\nauth-state change, or URL change of a webhook with a stored credential can\nreturn 409 without applying any part of the PATCH; fetch the latest\nassistant before retrying.\n\nThe endpoint must return a successful (2xx) response containing JSON or\ntext, up to 256 KiB. JSON is serialized to text for `@preCallData`; the\ninjected text is limited to 4000 characters. Execution runs in the\nbackground without retries. Disabled, failed, timed-out or busy requests\ncontribute an empty value. Prompt rendering waits at most 400 ms once\nper call; a later response can be used on later turns.\n","example":{"enabled":true,"url":"https://crm.example.com/lookup","method":"POST","headers":{"X-Session":"@sessionId"},"body_template":"{\"caller\":\"@callerNumber\",\"direction\":\"@direction\"}","timeout_ms":5000,"auth":{"type":"bearer","secret":"example-only-token"}},"properties":{"enabled":{"$ref":"#/components/schemas/PreCallWebhook/properties/enabled"},"url":{"description":"Required whenever enabled is true. Every nonempty value must be a valid\nHTTPS URL with a host, a numeric port if supplied, and valid percent\nescapes, even when disabled. URLs are not templated; private\ndestinations and redirects are blocked. When disabled, omission\npreserves the stored URL on PATCH; null or an empty string clears it.\n","anyOf":[{"type":["string","null"],"enum":["",null]},{"$ref":"#/components/schemas/PreCallWebhookUrl"}]},"method":{"$ref":"#/components/schemas/PreCallWebhook/properties/method"},"headers":{"$ref":"#/components/schemas/PreCallWebhook/properties/headers"},"body_template":{"$ref":"#/components/schemas/PreCallWebhook/properties/body_template"},"timeout_ms":{"$ref":"#/components/schemas/PreCallWebhook/properties/timeout_ms"},"auth":{"$ref":"#/components/schemas/PreCallWebhookAuthInput"}},"allOf":[{"if":{"type":"object","additionalProperties":true,"required":["enabled"],"properties":{"enabled":{"const":true}}},"then":{"additionalProperties":true,"required":["url"],"properties":{"url":{"$ref":"#/components/schemas/PreCallWebhookUrl"}}}}]},"Assistant":{"type":"object","required":["id","name","description","language","voice_id","record_call","speed","tts_style_level","background_ambience","appointment_booking_enabled","contextual_asr_correction_enabled","allow_preferred_language","whitelist","introduction","company_name","company_industry","phone_number","carrier","prompt_id","outbound_prompt_id","email_prompt_id","knowledge_group_ids","glossary_group_ids","pronunciation_group_ids","forwarding_group_ids","contact_group_ids","calendar_ids","tool_ids","analysis_ids","pre_call_webhook","created_at","updated_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"name":{"type":"string","example":"Sarah"},"description":{"type":"string","example":"Receptionist assistant for inbound calls."},"language":{"type":"string","enum":["de","en","fr","it","de-CH","es","pt","tr","sv","fi","nl"],"example":"de"},"voice_id":{"type":"string","example":"cgSgspJ2msm6clMCkdW9","description":"Current voice ID. `GET /voices` returns IDs selectable for new assignments; an existing legacy ID can appear here but is not selectable."},"record_call":{"type":"boolean"},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"description":"Voice playback rate multiplier. Some voices only support 0.8–1.2; out-of-range values for such voices return 400."},"tts_style_level":{"type":"number","minimum":0,"maximum":1,"multipleOf":0.01,"description":"Voice style level from 0 (calm) to 1 (expressive). The platform calibrates this level for the selected voice."},"background_ambience":{"type":"string","enum":["clean","office","restaurant"],"description":"Background ambience bed mixed under the assistant voice during phone calls. \"clean\" plays no bed."},"appointment_booking_enabled":{"type":"boolean"},"contextual_asr_correction_enabled":{"type":"boolean","description":"Per-turn LLM correction of misrecognised proper nouns (names, companies, products) in caller transcripts, using the assistant's own contacts, employees, glossary and knowledge. Adds latency on turns that carry a candidate. Default false."},"allow_preferred_language":{"type":"boolean"},"whitelist":{"type":"boolean"},"introduction":{"type":"string","description":"Opening greeting in the assistant's language, as shown in the dashboard and used for new calls. An outbound call started with its own `introduction` (`POST /calls`) speaks that one instead."},"company_name":{"type":"string"},"company_industry":{"type":"string"},"phone_number":{"type":["string","null"],"description":"Assigned by platform on create. Read-only - cannot be set or changed via this API.","example":"+491701234567"},"carrier":{"type":["string","null"],"description":"Telephony carrier assigned by the platform. Read-only."},"prompt_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234","description":"The prompt the assistant runs on: inbound calls, the website chat,\nand outbound calls unless `outbound_prompt_id` is set. `null` means\nthe built-in default prompt.\n"},"outbound_prompt_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","example":null,"description":"Optional prompt for the calls the assistant places itself (outbound\ncalls). `null` means outbound calls use `prompt_id`. Any prompt of\nthe organization can be named here, including the one in `prompt_id`.\n"},"email_prompt_id":{"type":["string","null"],"deprecated":true,"example":null,"description":"Deprecated. Email prompts were removed; an assistant has one prompt\n(`prompt_id`). Always `null`. The field will be removed in a later\nAPI version; do not rely on it.\n"},"knowledge_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"}},"glossary_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"}},"pronunciation_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"}},"forwarding_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"}},"contact_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"}},"calendar_ids":{"type":"array","maxItems":1,"items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"},"description":"At most one calendar per assistant."},"tool_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"},"description":"Webhook-type tools only. Integration-type / internal tools cannot be\nreferenced via the public API and will return 404 on create/update.\n"},"analysis_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"},"description":"Call-analysis definition IDs to run on this assistant's calls."},"pre_call_webhook":{"$ref":"#/components/schemas/PreCallWebhook"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"AssistantCreate":{"type":"object","required":["name","language","voice_id","company_name","company_industry","introduction"],"additionalProperties":false,"example":{"name":"Sarah","language":"de","voice_id":"cgSgspJ2msm6clMCkdW9","company_name":"Example GmbH","company_industry":"Logistics","introduction":"Hello, how can I help you today?"},"properties":{"phone_number_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"A purchased number from `GET /phone-numbers`. Omit it to have the platform allocate a number; organizations that route calls through their own assigned carrier must send it. It is not stored on the assistant.","example":"6710a3c2e4b0f1a2b3c4d5e6"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500,"default":""},"language":{"type":"string","enum":["de","en","fr","it","de-CH","es","pt","tr","sv","fi","nl"],"description":"Assistant language."},"voice_id":{"type":"string","description":"Voice ID. Must be one of the values returned by `GET /voices`; an unknown or unavailable ID returns 400."},"company_name":{"type":"string","minLength":1,"maxLength":200},"company_industry":{"type":"string","minLength":1,"maxLength":200},"introduction":{"type":"string","minLength":1,"maxLength":5000,"description":"Opening greeting in the assistant's language. Translations into the other supported languages are generated in the background. It is the whole greeting; the assistant asks no follow-up question after it."},"record_call":{"type":"boolean"},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"description":"Voice playback rate multiplier. Some voices only support 0.8–1.2; out-of-range values for such voices return 400."},"tts_style_level":{"type":"number","minimum":0,"maximum":1,"multipleOf":0.01,"description":"Voice style level from 0 (calm) to 1 (expressive). Omit to use 0.5."},"background_ambience":{"type":"string","enum":["clean","office","restaurant"],"description":"Background ambience bed mixed under the assistant voice during phone calls. Omit to use clean (no bed)."},"appointment_booking_enabled":{"type":"boolean"},"contextual_asr_correction_enabled":{"type":"boolean","description":"Per-turn LLM correction of misrecognised proper nouns (names, companies, products) in caller transcripts, using the assistant's own contacts, employees, glossary and knowledge. Adds latency on turns that carry a candidate. Default false."},"allow_preferred_language":{"type":"boolean"},"whitelist":{"type":"boolean"},"prompt_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"outbound_prompt_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","description":"Prompt for outbound calls. `null` (the default) means outbound calls use `prompt_id`."},"knowledge_group_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"}},"glossary_group_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"pronunciation_group_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"forwarding_group_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"contact_group_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"calendar_ids":{"type":"array","default":[],"maxItems":1,"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"tool_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"analysis_ids":{"type":"array","default":[],"items":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Call analyses to run on this assistant's calls. An analysis whose\nflow contains the delete-call node deletes each call it runs on, so\nlisting one requires the API key's role to grant `call_logs.call_data`\n`delete`; in recording mode the node deletes only each call's\nrecording and requires `call_logs.call_recording` `delete` instead.\nOne whose flow contains the start-call node places an\noutbound call after each call it runs on, so listing one requires\n`assistants.triggerOutbound` `post`. Otherwise the request returns\n403 `forbidden` and no assistant is created. An MCP connection never\nattaches an analysis with the start-call node.\n"},"pre_call_webhook":{"$ref":"#/components/schemas/PreCallWebhookInput"}}},"AssistantUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only the fields you want to change.","example":{"description":"Handles first-line customer support calls."},"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"language":{"type":"string","enum":["de","en","fr","it","de-CH","es","pt","tr","sv","fi","nl"]},"voice_id":{"type":"string","description":"Voice ID. Use a value returned by `GET /voices`. An existing legacy ID may remain unchanged, but changing to a legacy, unknown, or unavailable ID returns 400."},"company_name":{"type":"string","minLength":1,"maxLength":200},"company_industry":{"type":"string","minLength":1,"maxLength":200},"introduction":{"type":"string","minLength":1,"maxLength":5000,"description":"Replaces the opening greeting. If `language` is omitted, the greeting keeps its current language. Existing translations are removed and regenerated in the background; until then they may be missing."},"record_call":{"type":"boolean"},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"description":"Voice playback rate multiplier. Some voices only support 0.8–1.2; out-of-range values for such voices return 400."},"tts_style_level":{"type":"number","minimum":0,"maximum":1,"multipleOf":0.01,"description":"Voice style level from 0 (calm) to 1 (expressive)."},"background_ambience":{"type":"string","enum":["clean","office","restaurant"],"description":"Background ambience bed mixed under the assistant voice during phone calls."},"appointment_booking_enabled":{"type":"boolean"},"contextual_asr_correction_enabled":{"type":"boolean","description":"Per-turn LLM correction of misrecognised proper nouns (names, companies, products) in caller transcripts, using the assistant's own contacts, employees, glossary and knowledge. Adds latency on turns that carry a candidate. Default false."},"allow_preferred_language":{"type":"boolean"},"whitelist":{"type":"boolean"},"prompt_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$"},"outbound_prompt_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","description":"Prompt for outbound calls. `null` (the default) means outbound calls use `prompt_id`."},"knowledge_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"glossary_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"pronunciation_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"forwarding_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"contact_group_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"calendar_ids":{"type":"array","maxItems":1,"items":{"type":"string","pattern":"^[a-f0-9]{24}$"}},"tool_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Webhook-type tools only. Integration-type / internal tools cannot be\nreferenced via the public API and will return 404 on create/update.\n"},"analysis_ids":{"type":"array","items":{"type":"string","pattern":"^[a-f0-9]{24}$"},"description":"Replaces the call analyses run on this assistant's calls. Adding an\nanalysis whose flow contains the delete-call node, which deletes\neach call it runs on, requires the API key's role to grant\n`call_logs.call_data` `delete` (`call_logs.call_recording` `delete`\nwhen the node deletes only the recording); adding one whose flow contains the\nstart-call node, which places an outbound call after each call it\nruns on, requires `assistants.triggerOutbound` `post`. Otherwise the\nrequest returns 403 `forbidden` and nothing is changed. Analyses the\nassistant already runs, and removing one, need no such grant. An MCP\nconnection never adds an analysis with the start-call node.\n"},"pre_call_webhook":{"$ref":"#/components/schemas/PreCallWebhookInput"}}},"PageAssistant":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Assistant"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"PhoneNumber":{"type":"object","required":["id","phone_number","account_label"],"additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Send as `phone_number_id` when creating an assistant.","example":"6710a3c2e4b0f1a2b3c4d5e6"},"phone_number":{"type":"string","description":"The number in E.164.","example":"+390612345601"},"account_label":{"type":"string","description":"The provider account the number was purchased on, as your instance named it.","example":"VoipVoice · main"}}},"PagePhoneNumber":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumber"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"DtmfSequenceItem":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["pause","dtmf"],"description":"Step kind:\n  - `pause` - pause for `duration` ms before the next step.\n  - `dtmf` - send the `digits` as DTMF tones.\n"},"duration":{"type":["integer","null"],"description":"Pause duration in milliseconds. Relevant when `action=pause`."},"digits":{"type":["string","null"],"description":"DTMF digit string to send. Relevant when `action=dtmf`."}}},"Forwarding":{"type":"object","required":["id","group_id","group_name","type","gender","job_title","first_name","last_name","email","competence","activation_keywords","destination_type","phone_number","sip_uri","sip_username","sip_refer_target","has_sip_credentials","active","fallback","timeout","dtmf_sequence","created_at","updated_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"group_id":{"type":"string","example":"65a1234567890abcdef01234"},"group_name":{"type":["string","null"],"example":"Escalations"},"type":{"type":["string","null"],"enum":["personal","queue","fallback",null],"description":"Forwarding kind. `null` if unset."},"gender":{"type":"string","example":"female","description":"Empty string means the forwarding's gender is not specified."},"job_title":{"type":"string","example":"Head of Support"},"first_name":{"type":"string","example":"Ada"},"last_name":{"type":"string","example":"Lovelace"},"email":{"type":"string","example":"ada@example.com"},"competence":{"type":"string","example":"billing"},"activation_keywords":{"type":"array","description":"Optional per-forwarding activation keywords. When every active forwarding\nhas at least one custom activation keyword, generic transfer words are\nnot used for forwarding activation.\n","items":{"type":"string","maxLength":80},"maxItems":50},"destination_type":{"type":"string","enum":["phone","sip","sip_refer"],"description":"Where the call routes - an E.164 phone number, SIP URI, or SIP REFER target."},"phone_number":{"type":"string","example":"+491701234567","description":"Destination number for `phone` forwarding. May be an empty string when it was omitted at write time; such a target cannot be dialed."},"sip_uri":{"type":"string","description":"SIP URI in `sip:user@host` form. Relevant when `destination_type=sip`.","example":"sip:forwarding@example.com"},"sip_username":{"type":["string","null"],"description":"Optional SIP auth username. Relevant when `destination_type=sip`."},"sip_refer_target":{"type":["string","null"],"description":"SIP REFER target. Relevant when `destination_type=sip_refer`."},"has_sip_credentials":{"type":["boolean","null"],"description":"Whether SIP credentials are stored for this forwarding. `sip_password` is never returned."},"identity_source":{"type":["string","null"],"enum":["employee",null],"description":"Read-only. `employee` marks a forwarding created by the employee import whose identity and destination follow the employee record; updates to those fields are rejected with 409 `conflict` - edit the employee instead. `null` for hand-managed records."},"active":{"type":"boolean","default":true},"fallback":{"type":"boolean","default":false},"timeout":{"type":"integer","minimum":10,"maximum":60,"default":30,"description":"Ring timeout in seconds before the call gives up on this target."},"dtmf_sequence":{"type":["array","null"],"description":"Optional DTMF steps to run after the callee picks up. `null` if none configured.","items":{"$ref":"#/components/schemas/DtmfSequenceItem"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ForwardingCreateFields":{"type":"object","required":["group_id"],"additionalProperties":false,"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"type":{"type":"string","enum":["personal","queue","fallback"]},"destination_type":{"type":"string","enum":["phone","sip","sip_refer"],"default":"phone"},"gender":{"type":"string","description":"Optional gender value. Omit it or send an empty string when not specified."},"job_title":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"competence":{"type":"string"},"activation_keywords":{"type":"array","items":{"type":"string","maxLength":80},"maxItems":50},"phone_number":{"type":"string","example":"+12025550123"},"sip_uri":{"type":"string","pattern":"^sip:","description":"SIP URI. Required when `destination_type=sip`.","example":"sip:forwarding@example.com"},"sip_username":{"type":["string","null"],"description":"Optional SIP auth username. Only allowed when `destination_type=sip`."},"sip_password":{"type":["string","null"],"format":"password","description":"Optional SIP auth password. Only allowed when `destination_type=sip`; never returned in responses."},"sip_refer_target":{"type":"string","minLength":1,"pattern":"^\\S+$","description":"SIP REFER target. Required when `destination_type=sip_refer`."},"active":{"type":"boolean"},"fallback":{"type":"boolean"},"timeout":{"type":"integer","minimum":10,"maximum":60},"dtmf_sequence":{"type":"array","items":{"$ref":"#/components/schemas/DtmfSequenceItem"}}}},"ForwardingCreate":{"description":"When `destination_type` is `sip`, `sip_uri` must be provided. When\n`destination_type` is `sip_refer`, `sip_refer_target` must be provided.\nFor a usable `phone` destination, provide a non-empty `phone_number`.\nThe current validator permits it to be omitted or empty, but such a\nforwarding cannot be dialed.\n","oneOf":[{"title":"Phone destination","allOf":[{"$ref":"#/components/schemas/ForwardingCreateFields"},{"type":"object","properties":{"destination_type":{"type":"string","const":"phone"}},"not":{"anyOf":[{"properties":{"sip_username":{}},"required":["sip_username"]},{"properties":{"sip_password":{}},"required":["sip_password"]},{"properties":{"sip_refer_target":{}},"required":["sip_refer_target"]}]}}]},{"title":"SIP destination","allOf":[{"$ref":"#/components/schemas/ForwardingCreateFields"},{"type":"object","required":["destination_type","sip_uri"],"properties":{"destination_type":{"type":"string","const":"sip"}},"not":{"properties":{"sip_refer_target":{}},"required":["sip_refer_target"]}}]},{"title":"SIP REFER destination","allOf":[{"$ref":"#/components/schemas/ForwardingCreateFields"},{"type":"object","required":["destination_type","sip_refer_target"],"properties":{"destination_type":{"type":"string","const":"sip_refer"}},"not":{"anyOf":[{"properties":{"sip_username":{}},"required":["sip_username"]},{"properties":{"sip_password":{}},"required":["sip_password"]},{"properties":{"type":{"const":"personal"}},"required":["type"]}]}}]}]},"ForwardingUpdateFields":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"type":{"type":"string","enum":["personal","queue","fallback"]},"destination_type":{"type":"string","enum":["phone","sip","sip_refer"]},"gender":{"type":"string","description":"Send an empty string to clear the value; omit the property to preserve it."},"job_title":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"competence":{"type":"string"},"activation_keywords":{"type":"array","items":{"type":"string","maxLength":80},"maxItems":50},"phone_number":{"type":"string"},"sip_uri":{"type":"string","pattern":"^sip:"},"sip_username":{"type":["string","null"],"description":"Optional SIP auth username. Only allowed when the effective `destination_type` is `sip`."},"sip_password":{"type":["string","null"],"format":"password","description":"Optional SIP auth password. Only allowed when the effective `destination_type` is `sip`; never returned in responses."},"sip_refer_target":{"type":"string","minLength":1,"pattern":"^\\S+$","description":"SIP REFER target. Required when changing `destination_type` to `sip_refer`."},"active":{"type":"boolean"},"fallback":{"type":"boolean"},"timeout":{"type":"integer","minimum":10,"maximum":60},"dtmf_sequence":{"type":"array","items":{"$ref":"#/components/schemas/DtmfSequenceItem"}}}},"ForwardingUpdate":{"description":"Partial update - include only the fields you want to change.\n`group_id` cannot be changed via this endpoint.\n","oneOf":[{"title":"Other fields or stored SIP credentials","allOf":[{"$ref":"#/components/schemas/ForwardingUpdateFields"},{"type":"object","not":{"anyOf":[{"properties":{"destination_type":{}},"required":["destination_type"]},{"properties":{"sip_refer_target":{}},"required":["sip_refer_target"]}]}}]},{"title":"Phone destination","allOf":[{"$ref":"#/components/schemas/ForwardingUpdateFields"},{"type":"object","required":["destination_type"],"properties":{"destination_type":{"type":"string","const":"phone"}},"not":{"anyOf":[{"properties":{"sip_username":{}},"required":["sip_username"]},{"properties":{"sip_password":{}},"required":["sip_password"]},{"properties":{"sip_refer_target":{}},"required":["sip_refer_target"]}]}}]},{"title":"SIP destination","allOf":[{"$ref":"#/components/schemas/ForwardingUpdateFields"},{"type":"object","required":["destination_type"],"properties":{"destination_type":{"type":"string","const":"sip"}},"not":{"properties":{"sip_refer_target":{}},"required":["sip_refer_target"]}}]},{"title":"SIP REFER destination","allOf":[{"$ref":"#/components/schemas/ForwardingUpdateFields"},{"type":"object","required":["destination_type","sip_refer_target"],"properties":{"destination_type":{"type":"string","const":"sip_refer"}},"not":{"anyOf":[{"properties":{"sip_username":{}},"required":["sip_username"]},{"properties":{"sip_password":{}},"required":["sip_password"]},{"properties":{"type":{"const":"personal"}},"required":["type"]}]}}]}]},"PageForwarding":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Forwarding"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"Glossary":{"type":"object","required":["id","group_id","group_name","abbreviation","name","description","aliases","active","created_at","updated_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"group_id":{"type":"string","example":"65a1234567890abcdef01234"},"group_name":{"type":["string","null"],"example":"Product terminology"},"abbreviation":{"type":"string","example":"API"},"name":{"type":"string","example":"Application Programming Interface"},"description":{"type":"string","example":"A set of definitions and protocols for building software."},"aliases":{"type":"array","items":{"type":"string"},"example":["A P I","Api"],"description":"Spoken forms of the term as the speech recognizer tends to write them. Used to recognize the term in a call and to correct the transcript; never spoken back to the caller."},"active":{"type":"boolean","default":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"GlossaryCreate":{"type":"object","required":["group_id","name"],"additionalProperties":false,"example":{"group_id":"65a1234567890abcdef01234","name":"Application Programming Interface","abbreviation":"API","aliases":["A P I"]},"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Whitespace is trimmed; the trimmed name must be at least 1 character."},"abbreviation":{"type":"string","maxLength":100,"default":""},"description":{"type":"string","maxLength":5000,"default":""},"aliases":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":100},"default":[],"description":"Spoken forms of the term as the speech recognizer tends to write them (for example `Michel` for `Mitel`). Each entry is trimmed; an empty or whitespace-only entry is rejected with 400. Duplicates are dropped case-insensitively, keeping the first spelling."},"active":{"type":"boolean","default":true}}},"GlossaryUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only the fields you want to change.\n`group_id` cannot be changed via this endpoint.\n","example":{"description":"A set of definitions and protocols for building software."},"properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Whitespace is trimmed; the trimmed name must be at least 1 character."},"abbreviation":{"type":"string","maxLength":100},"description":{"type":"string","maxLength":5000},"aliases":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":100},"description":"Replaces the whole list. Send `[]` to clear it. Entries follow the same rules as on create."},"active":{"type":"boolean"}}},"PageGlossary":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Glossary"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"Pronunciation":{"type":"object","required":["id","group_id","group_name","word","replacement","ipa","spell_out","rate","case_sensitive","active","created_at","updated_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"group_id":{"type":"string","example":"65a1234567890abcdef01234"},"group_name":{"type":["string","null"],"example":"Brand names"},"word":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\s<>]+$","example":"nginx","description":"The written single-token form to match in generated speech. Whitespace and angle brackets (`<`, `>`) are rejected."},"replacement":{"type":"string","example":"engine-ex","description":"Phonetic respelling spoken in place of the word, on every voice. An entry holds a replacement or `ipa`, not both; entries saved before 2026-10-09 may still hold both (v2 voices then use the IPA, v1 voices the replacement)."},"ipa":{"type":"string","example":"ɛsmaʊ","description":"International Phonetic Alphabet transcription, written as raw IPA without `/…/` or `[…]` delimiters. Applied on v2 voices; ignored on v1 voices."},"spell_out":{"type":"boolean","default":false,"description":"When true, the matched word is spoken letter by letter - `API` is spoken as `A`, `P`, `I`."},"rate":{"type":["string","null"],"enum":[null,"slow","medium","fast"],"default":null,"description":"Speaking rate stored with the rule; `null` means none. Currently not applied when the word is spoken, on any voice - the word is spoken at the voice/request speed."},"case_sensitive":{"type":"boolean","default":false},"active":{"type":"boolean","default":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PronunciationCreate":{"type":"object","required":["group_id","word"],"additionalProperties":false,"description":"At least one effective option is required: nonblank replacement, nonblank\nvalid IPA (see `ipa`), spell_out enabled, or an explicit supported rate. This also\napplies to inactive entries. Nonempty whitespace-only replacement or\nIPA values are rejected; meaningful text is preserved exactly.\n`replacement` and `ipa` exclude each other: at most one of them may be\nnon-empty. The replacement is spoken on every voice; IPA applies only\non v2 voices.\n","anyOf":[{"type":"object","required":["replacement"],"properties":{"replacement":{"type":"string","pattern":"\\S"}}},{"type":"object","required":["ipa"],"properties":{"ipa":{"type":"string","pattern":"\\S"}}},{"type":"object","required":["spell_out"],"properties":{"spell_out":{"type":"boolean","const":true}}},{"type":"object","required":["rate"],"properties":{"rate":{"type":"string","enum":["slow","medium","fast"]}}}],"example":{"group_id":"65a1234567890abcdef01234","word":"SQL","spell_out":true},"properties":{"group_id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"word":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\s<>]+$","description":"The written single-token form to match. Whitespace and angle\nbrackets (`<`, `>`) are rejected.\n"},"replacement":{"type":"string","pattern":"^(?!\\s+$)","maxLength":1000,"default":"","description":"Phonetic respelling. Angle brackets (`<`, `>`) are rejected. Must be empty when `spell_out` is true or `ipa` is set."},"ipa":{"type":"string","pattern":"^(?!\\s+$)","maxLength":200,"default":"","description":"International Phonetic Alphabet transcription. Applied on v2 voices; ignored on v1 voices. Write raw IPA without `/…/` or `[…]` delimiters, using lowercase Latin letters, IPA symbols and diacritics, syllable dots, prosodic bars (`|`, `‖`), the linking tie `‿` and spaces; any other character, such as an uppercase letter, a digit, a slash or a bracket, returns 400. Must be empty when `spell_out` is true or `replacement` is set."},"spell_out":{"type":"boolean","default":false,"description":"When true, the matched word is spoken letter by letter - `API` is spoken as `A`, `P`, `I`."},"rate":{"type":["string","null"],"enum":[null,"slow","medium","fast"],"default":null,"description":"Speaking rate stored with the rule; `null` means none. Currently not applied when the word is spoken, on any voice - the word is spoken at the voice/request speed."},"case_sensitive":{"type":"boolean","default":false},"active":{"type":"boolean","default":true}}},"PronunciationUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only the fields you want to change.\n`group_id` cannot be changed via this endpoint.\nThe final merged state must not combine `spell_out: true` with a\nnon-empty `replacement` or `ipa`. An update that sets `replacement` or\n`ipa` must leave only one of them non-empty (send `\"\"` to clear the\nother); entries saved with both before 2026-10-09 keep working and accept\nupdates that set neither. It must retain at least one effective\noption: nonblank replacement, valid nonblank IPA, spell_out enabled,\nor an explicit supported rate. Clearing the last effective option is\nrejected, including for inactive entries. Entries whose stored `word` is\nempty or contains whitespace or angle brackets are not returned by `GET`\n(by ID they return 404) but can still be deleted, or updated by a PATCH\nthat sets a valid `word`. Other existing invalid entries remain readable\nand deletable but must be corrected before saving.\nConcurrent changes to the validated fields return 409; reload before retrying.\n","example":{"case_sensitive":true},"properties":{"word":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\s<>]+$","description":"The written single-token form to match. Whitespace and angle\nbrackets (`<`, `>`) are rejected.\n"},"replacement":{"type":"string","pattern":"^(?!\\s+$)","maxLength":1000,"description":"Angle brackets (`<`, `>`) are rejected. Must be empty when the final `spell_out` state is true. When set, the final `ipa` must be empty."},"ipa":{"type":"string","pattern":"^(?!\\s+$)","maxLength":200,"description":"International Phonetic Alphabet transcription in the same raw format as on create (no `/…/` or `[…]` delimiters, no uppercase letters). Applied on v2 voices; ignored on v1 voices. Must be empty when the final `spell_out` state is true. When set, the final `replacement` must be empty."},"spell_out":{"type":"boolean","description":"When true, the matched word is spoken letter by letter - `API` is spoken as `A`, `P`, `I`."},"rate":{"type":["string","null"],"enum":[null,"slow","medium","fast"],"description":"Speaking rate stored with the rule; send `null` to clear it. Currently not applied when the word is spoken, on any voice - the word is spoken at the voice/request speed."},"case_sensitive":{"type":"boolean"},"active":{"type":"boolean"}}},"PagePronunciation":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Pronunciation"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"CalendarSlot":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","example":"09:00"},"to":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","example":"17:00"}}},"CalendarDaySchedule":{"type":"object","required":["is_open","slots"],"additionalProperties":false,"properties":{"is_open":{"type":"boolean"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/CalendarSlot"}}}},"CalendarWeeklySchedule":{"type":"object","description":"Weekly opening-hours template. Each weekday is optional. Omitted\nweekdays (`mon`–`fri`) default to open 09:00–17:00; omitted weekend\ndays (`sat`–`sun`) default to closed with no slots. To close an omitted\nweekday explicitly, send `{ \"is_open\": false, \"slots\": [] }`.\nKeys use 3-letter day abbreviations: `mon`, `tue`, `wed`, `thu`, `fri`,\n`sat`, `sun`.\n","additionalProperties":false,"properties":{"mon":{"$ref":"#/components/schemas/CalendarDaySchedule"},"tue":{"$ref":"#/components/schemas/CalendarDaySchedule"},"wed":{"$ref":"#/components/schemas/CalendarDaySchedule"},"thu":{"$ref":"#/components/schemas/CalendarDaySchedule"},"fri":{"$ref":"#/components/schemas/CalendarDaySchedule"},"sat":{"$ref":"#/components/schemas/CalendarDaySchedule"},"sun":{"$ref":"#/components/schemas/CalendarDaySchedule"}}},"CalendarOverride":{"type":"object","required":["date","type"],"additionalProperties":false,"description":"Date-specific override - either closes the calendar for the day\n(`type: closed`) or replaces the day's slots (`type: modified`).\n`slots` is required (and must contain at least one entry) when\n`type` is `modified`; it is optional/omitted when `type` is `closed`.\n","properties":{"date":{"type":"string","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$","example":"2026-12-24","description":"Date in `YYYY-MM-DD` shape. Send a real calendar date; current request validation checks the shape but not month/day validity."},"type":{"type":"string","enum":["closed","modified"]},"reason":{"type":["string","null"],"example":"Christmas Eve"},"slots":{"type":"array","description":"Always present in responses. On request input, required and\nnon-empty when `type: modified`. For `type: closed`, supplied\nvalues are accepted, stored, and returned, but ignored when\neffective opening hours are computed; omit them to receive `[]`.\n","items":{"$ref":"#/components/schemas/CalendarSlot"}}}},"CalendarSchedule":{"type":"object","required":["id","type","weekly_schedule","overrides"],"additionalProperties":false,"description":"Schedule as returned in responses. `id` is always present and\nserver-assigned. For write payloads see `CalendarScheduleCreate` and\n`CalendarScheduleUpdate`.\n","properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"type":{"type":"string","enum":["opening_hours","service_hours","office_hours","operating_hours"]},"weekly_schedule":{"$ref":"#/components/schemas/CalendarWeeklySchedule"},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/CalendarOverride"}}}},"CalendarScheduleCreate":{"type":"object","required":["type"],"additionalProperties":false,"description":"Schedule shape for create requests. `id` is server-assigned on POST\nand therefore omitted; for the response shape see `CalendarSchedule`.\n","properties":{"type":{"type":"string","enum":["opening_hours","service_hours","office_hours","operating_hours"]},"weekly_schedule":{"$ref":"#/components/schemas/CalendarWeeklySchedule"},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/CalendarOverride"}}}},"CalendarScheduleUpdate":{"type":"object","required":["type"],"additionalProperties":false,"description":"Schedule shape accepted when replacing `schedules` on PATCH. Include\nthe response `id` to preserve an existing schedule's identifier; omit\nit to let the server assign a new identifier.\n","properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$"},"type":{"type":"string","enum":["opening_hours","service_hours","office_hours","operating_hours"]},"weekly_schedule":{"$ref":"#/components/schemas/CalendarWeeklySchedule"},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/CalendarOverride"}}}},"Calendar":{"type":"object","required":["id","name","timezone","schedules","created_at","updated_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cd"},"name":{"type":"string","example":"Main Office"},"timezone":{"type":"string","example":"Europe/Berlin"},"schedules":{"type":"array","items":{"$ref":"#/components/schemas/CalendarSchedule"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CalendarCreate":{"type":"object","required":["name"],"additionalProperties":false,"example":{"name":"Main Office","timezone":"Europe/Berlin"},"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Whitespace is trimmed; the trimmed name must be at least 1 character."},"timezone":{"type":"string","minLength":1,"maxLength":100,"default":"Europe/Berlin","description":"IANA timezone string. Validated server-side."},"schedules":{"type":"array","items":{"$ref":"#/components/schemas/CalendarScheduleCreate"},"default":[]}}},"CalendarUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only the fields you want to change. Passing\n`schedules` replaces the full schedules array for this calendar.\n","example":{"name":"Main Office Berlin"},"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Whitespace is trimmed; the trimmed name must be at least 1 character."},"timezone":{"type":"string","minLength":1,"maxLength":100},"schedules":{"type":"array","items":{"$ref":"#/components/schemas/CalendarScheduleUpdate"}}}},"PageCalendar":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Calendar"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"RecordingSummary":{"type":"object","required":["available"],"properties":{"available":{"type":"boolean","description":"A recording stored in the older format can report `false` while `GET /calls/{call_id}/recording` still returns its audio."},"format":{"type":["string","null"],"example":"flac"},"mime_type":{"type":["string","null"],"example":"audio/flac"},"duration_ms":{"type":["integer","null"]},"size_bytes":{"type":["integer","null"]}}},"Call":{"type":"object","required":["id","direction","source","done","success","created_at"],"properties":{"id":{"type":"string"},"assistant_id":{"type":["string","null"]},"assistant_name":{"type":["string","null"]},"assistant_phone":{"type":["string","null"]},"direction":{"type":"string","enum":["inbound","outbound"]},"source":{"type":"string","enum":["inbound_phone","inbound_bypass","outbound_widget","outbound_api","outbound_manual","outbound_analysis"],"description":"How the call was originated:\n  - `inbound_phone` - caller dialed in from a real phone number.\n  - `inbound_bypass` - caller dialed in and the call was forwarded straight to a configured target without the assistant answering.\n  - `outbound_widget` - chat widget kicked off an outbound call.\n  - `outbound_api` - Public API (POST /calls) triggered the call.\n  - `outbound_manual` - dashboard user manually triggered the call.\n  - `outbound_analysis` - an analysis flow started the call after an earlier call.\n"},"phone_number":{"type":["string","null"],"description":"Remote party phone number."},"duration_seconds":{"type":["integer","null"]},"done":{"type":"boolean"},"success":{"type":"boolean","description":"`true` when nobody at your organization still has to do something for the other person on the call: every concern raised was settled in the call, nothing was left open and no callback was requested. It is an automatic assessment of the conversation, made after the call, and not a guarantee. `false` in every other case, also before the assessment has run, when the other person said nothing, and on a call that was never answered. It therefore does not tell whether a person was reached; read `connection` for that."},"language":{"type":["string","null"]},"started_at":{"type":["string","null"],"format":"date-time","description":"For an outbound call: when the call was created, before dialing. It is not the time the call was answered; see `connection.answered_at`."},"ended_at":{"type":["string","null"],"format":"date-time"},"connection":{"$ref":"#/components/schemas/CallConnection"},"created_at":{"type":"string","format":"date-time"}}},"CallConnection":{"type":["object","null"],"description":"How an outbound call attempt ended at the telephone network. null for inbound calls and until `done` is true. It tells whether the far end accepted the call, not who accepted it: a voicemail system or a call screening service accepts calls too, so read `mailbox_detection` to tell a person from a machine. Every recorded sign that the call was accepted is checked first, so an accepted call reports `answered` even when it failed afterwards.","required":["status","answered_at","sip_status"],"properties":{"status":{"type":"string","enum":["answered","no_answer","busy","failed","unknown"],"description":"- `answered` - the far end accepted the call.\n- `no_answer` - the call was not accepted: it ran into the ring limit of 30 seconds or the carrier's own limit, or the carrier reported the callee as temporarily unavailable.\n- `busy` - the carrier signalled busy.\n- `failed` - the network refused or could not place the call, for example a declined call, an unassigned number, or a carrier or platform failure. `sip_status` carries the code.\n- `unknown` - the call ended without a recorded telephony result. Treat it as unclear, not as unanswered.\n\nCarriers signal a manually declined call differently: as busy, as a decline (`failed` with `sip_status` 603), or by diverting it to voicemail (`answered`). Treat a value you do not know like `unknown`.\n"},"answered_at":{"type":["string","null"],"format":"date-time","description":"When the far end accepted the call. null when `status` is not `answered`, and on an answered call for which no answer time was recorded."},"sip_status":{"type":["integer","null"],"description":"Final SIP status code recorded for the attempt, for example 486 (busy), 480 or 408 (no answer; 408 also marks the platform's own ring limit), 603 (declined), 404 (not found). On an answered call it is 200, or the code of a failure after the answer. null when no code was recorded. Informational: decide on `status`."}},"examples":[null,{"status":"answered","answered_at":"2026-10-05T10:00:07.250Z","sip_status":200},{"status":"no_answer","answered_at":null,"sip_status":408},{"status":"busy","answered_at":null,"sip_status":486},{"status":"failed","answered_at":null,"sip_status":404},{"status":"unknown","answered_at":null,"sip_status":null}]},"CallTranscriptMessage":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","example":"assistant","description":"Who produced the turn, for example `user` (the person on the phone line), `assistant` or `tool`. `info` marks an internal call event, such as a hang-up or forwarding marker; its `content` is an internal code that clients may ignore."},"content":{"type":"string","description":"The text of the turn. Caller turns are what the speech recogniser heard, with two exceptions. On an assistant with contextual_asr_correction_enabled, names and terms carry the corrected text the assistant actually answered. On German calls, an email address the caller dictated is written in address form (for example `paula.krause@example.com`). The assistant answers that form too when it is ready in time (about one second); otherwise it answered the words as heard. An address the recogniser misheard stays misheard."},"timestamp":{"type":["string","null"],"format":"date-time"},"tool_calls":{"type":"array","description":"Only on an assistant turn that called tools; its `content` is usually empty. Each call's result follows as a `tool` turn carrying the call's `id` as `tool_call_id`.","items":{"type":"object","required":["id","name","arguments"],"properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"],"description":"The tool the model called."},"arguments":{"type":["string","null"],"description":"The arguments as JSON text, exactly as the model sent them. Parse it yourself; model output is not guaranteed to be valid JSON."}}}},"tool_call_id":{"type":"string","description":"Only on a `tool` turn: the `id` of the call whose result this turn carries."}}},"CallAnalysis":{"type":"object","description":"One analysis run of the call. An analysis that uses the variables `didTryForwarding` or `didForwardingSucceed` can appear after the call is `done` when the call was transferred by a queue dial or SIP REFER: about 10 to 15 seconds later, or up to 43 minutes later while the transfer is still connected. Other analyses of the same call are not delayed.","required":["id","status"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string","example":"completed"},"body_result":{"description":"Raw analysis result. Shape depends on the configured analysis.","oneOf":[{"type":"object"},{"type":"string"},{"type":"null"}]},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}},"CallNote":{"type":"object","required":["id","content","created_at"],"properties":{"id":{"type":"string"},"content":{"type":"string"},"author_id":{"type":["string","null"]},"author_name":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}},"CallDetail":{"allOf":[{"$ref":"#/components/schemas/Call"},{"type":"object","required":["transcript","analyses","notes","recording"],"properties":{"transcript":{"type":"array","items":{"$ref":"#/components/schemas/CallTranscriptMessage"}},"analyses":{"type":"array","items":{"$ref":"#/components/schemas/CallAnalysis"}},"notes":{"type":"array","items":{"$ref":"#/components/schemas/CallNote"}},"recording":{"$ref":"#/components/schemas/RecordingSummary"},"mailbox_detection":{"$ref":"#/components/schemas/MailboxDetectionResult"}}}]},"PageCall":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"MailboxDetectionResult":{"type":["object","null"],"description":"Outcome of opt-in outbound detection, or null when not requested. Poll getCall until done is true before scheduling another call. Terminal calls never report pending detection. Detection failures leave the call running; they are not proof that a machine answered. Configured analyses and post-call actions continue independently of detection.","required":["status","category","reason","greeting","decided_at_ms"],"properties":{"status":{"type":"string","enum":["pending","completed","failed","skipped"],"description":"pending means detection has not finished; completed means a valid classification exists; failed means detection could not complete reliably; skipped means the call ended, detection was interrupted before classification, or the assistant language is not supported. Completed outcomes are immutable."},"category":{"type":["string","null"],"enum":["human","machine-ivr","machine-vm","machine-unavailable","uncertain",null],"description":"Present only for completed detection. machine-vm permits a voicemail message; machine-ivr is a menu or call-screening assistant; machine-unavailable is an announcement without a message option. All three machine categories request assistant hangup after the outcome is saved. human and uncertain leave the conversation running."},"reason":{"type":["string","null"],"maxLength":200,"description":"Short classification rationale for completed detection. Otherwise a generic reason: detection_failed, detection_skipped, or language_not_supported when detection does not yet support the assistant language. Raw provider errors are not returned."},"greeting":{"type":["string","null"],"description":"Transcribed greeting supporting a completed verdict; null without a verdict."},"decided_at_ms":{"type":["integer","null"],"minimum":0,"description":"Milliseconds from first received caller audio to the classification decision; null when no decision exists. This is not a hangup timestamp."}},"examples":[null,{"status":"pending","category":null,"reason":null,"greeting":null,"decided_at_ms":null},{"status":"completed","category":"machine-vm","reason":"Voicemail instructions permit leaving a message.","greeting":"Bitte hinterlassen Sie eine Nachricht nach dem Signalton.","decided_at_ms":10400},{"status":"failed","category":null,"reason":"detection_failed","greeting":null,"decided_at_ms":null},{"status":"skipped","category":null,"reason":"detection_skipped","greeting":null,"decided_at_ms":null},{"status":"skipped","category":null,"reason":"language_not_supported","greeting":null,"decided_at_ms":null}]},"TriggerOutboundFields":{"type":"object","additionalProperties":false,"properties":{"assistant_id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234","description":"The assistant that will make the call."},"assistant_phone":{"type":"string","pattern":"^\\+\\d{6,20}$","example":"+491701234567","description":"Alternative to `assistant_id` - look up the assistant by its phone number in E.164 format (leading `+` followed by 6–20 digits)."},"to":{"type":"string","pattern":"^\\+\\d{6,20}$","example":"+491701234999","description":"Destination phone number in E.164 format (leading `+` followed by 6–20 digits)."},"target_phone":{"type":"string","pattern":"^\\+\\d{6,20}$","example":"+12025550123","description":"Legacy alias for `to`. Same E.164 format."},"details":{"type":"string","maxLength":1000,"description":"Optional free-text context passed to the assistant prompt."},"introduction":{"type":"string","maxLength":1000,"description":"Optional greeting for this call only. It replaces the assistant's introduction and is the first thing the assistant says, word for word; the person called cannot interrupt it. Write it in the assistant's language, and write dates and times the way they should be spoken (for example \"on Friday, November 7, between 8 and 12 in the morning\"). The placeholders of the assistant's introduction work here too: `@firstName`, `@lastName` and `@gender` come from the contact that matches the destination number and stay empty without one; `@assistantName` and `@companyName` come from the assistant. Fixed questions configured on the assistant still follow the greeting. Because it replaces the whole stored introduction, include any notice that the person is talking to an AI or that the call is recorded where you need one. Omitted or empty, the assistant's introduction is used. Use `details` for what the assistant should know during the conversation."},"mailbox_detection":{"type":"boolean","default":false,"description":"Opt-in one-shot detection using the first eight seconds of raw caller audio. A machine verdict (voicemail, IVR/call screening or an unavailable announcement) requests hangup only after its outcome is saved. Human, uncertain and failed detection leave the call running. Poll getCall for mailbox_detection and wait for done before retrying. Existing post-call analyses and actions still run. Default false. Detection currently supports German (de) assistants; for any other assistant language the call proceeds unchanged and reports skipped with reason language_not_supported. Outbound creation does not provide idempotency: do not blindly retry an ambiguous POST result."}}},"TriggerOutbound":{"description":"Provide **exactly one** of `assistant_id` or `assistant_phone`, and\n**exactly one** of `to` or `target_phone` (`target_phone` is a legacy alias).\n","oneOf":[{"title":"Assistant ID + to","allOf":[{"$ref":"#/components/schemas/TriggerOutboundFields"},{"type":"object","required":["assistant_id","to"]}]},{"title":"Assistant ID + target_phone","allOf":[{"$ref":"#/components/schemas/TriggerOutboundFields"},{"type":"object","required":["assistant_id","target_phone"]}]},{"title":"Assistant phone + to","allOf":[{"$ref":"#/components/schemas/TriggerOutboundFields"},{"type":"object","required":["assistant_phone","to"]}]},{"title":"Assistant phone + target_phone","allOf":[{"$ref":"#/components/schemas/TriggerOutboundFields"},{"type":"object","required":["assistant_phone","target_phone"]}]}]},"Chat":{"type":"object","description":"A website-widget chat from the dashboard Inbox.","required":["id","widget_id","widget_name","assistant_id","assistant_name","language","status","current_responder","needs_human","human_request_reason","human_requested_at","human_takeover_at","visitor","page_url","origin","last_message_preview","last_message_author","last_message_at","created_at","closed_at"],"properties":{"id":{"type":"string","description":"The chat's UUID, as the dashboard Inbox shows it.","example":"3f2b8c1e-9a4d-4c6b-8f1e-2d7a5b9c0e41"},"widget_id":{"type":["string","null"],"example":"65f8fa6f1a9d8e0012ab34ce"},"widget_name":{"type":["string","null"],"example":"Website chat"},"assistant_id":{"type":["string","null"],"description":"The assistant that answers while the AI responds. Null for chats without one.","example":"65f8fa6f1a9d8e0012ab34cd"},"assistant_name":{"type":["string","null"],"example":"Lea"},"language":{"type":"string","example":"de"},"status":{"type":"string","enum":["open","closed"]},"current_responder":{"type":"string","enum":["ai","human"],"description":"Who answers the visitor now. Moves from `ai` to `human` on handoff or takeover, never back."},"needs_human":{"type":"boolean","description":"True while the chat waits for a reply from the team: the visitor was handed over or wrote in a chat the team answers, and no team member has replied or taken over since."},"human_request_reason":{"type":["string","null"],"enum":["explicit_request","frustration",null],"description":"Why the chat was handed to the team."},"human_requested_at":{"type":["string","null"],"format":"date-time"},"human_takeover_at":{"type":["string","null"],"format":"date-time","description":"When a team member took the chat over."},"visitor":{"type":"object","required":["name","email"],"properties":{"name":{"type":["string","null"],"description":"As the visitor or the embedding website provided it.","example":"Anna Schmidt"},"email":{"type":["string","null"],"format":"email","description":"As the visitor or the embedding website provided it.","example":"anna.schmidt@example.org"}}},"page_url":{"type":["string","null"],"description":"The page the chat started on - origin and path, without the query string.","example":"https://www.example.org/kontakt"},"origin":{"type":["string","null"],"description":"The website the chat started on.","example":"https://www.example.org"},"last_message_preview":{"type":["string","null"],"description":"The last visitor, AI, or team message, cut to at most 280 characters."},"last_message_author":{"type":["string","null"],"enum":["visitor","ai","human",null]},"last_message_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"closed_at":{"type":["string","null"],"format":"date-time"}}},"ChatMessage":{"type":"object","required":["id","sequence","author","author_name","content","created_at"],"properties":{"id":{"type":"string","example":"65f8fa6f1a9d8e0012ab34cf"},"sequence":{"type":"integer","minimum":1,"description":"Position in the chat. Gaps are normal - internal messages are numbered too."},"author":{"type":"string","enum":["visitor","ai","human","system"],"description":"- `visitor` - the website visitor.\n- `ai` - the assistant.\n- `human` - the team, including a welcome message set for team chats.\n- `system` - a notice shown in the widget, such as a team member joining.\n"},"author_name":{"type":["string","null"],"description":"The name the visitor saw, if any. For team replies this is the team member's name, or their email address when no name is set."},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"ChatDetail":{"allOf":[{"$ref":"#/components/schemas/Chat"},{"type":"object","required":["messages","messages_truncated"],"properties":{"messages":{"type":"array","description":"The first 100 messages the visitor saw, oldest first.","items":{"$ref":"#/components/schemas/ChatMessage"}},"messages_truncated":{"type":"boolean","description":"True when the chat has more messages than `messages` holds. Rare in practice."}}}]},"PageChat":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Chat"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"StatisticsWeekYear":{"type":"object","required":["week","year"],"properties":{"week":{"type":"integer","example":17},"year":{"type":"integer","example":2026}}},"StatisticsAvailableAssistant":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65a1234567890abcdef01234"},"name":{"type":"string","example":"Inbound Receptionist"}}},"StatisticsDailyCallCount":{"type":"object","required":["date","count"],"properties":{"date":{"type":"string","example":"2026-04-22","description":"Start date of the counted calls (YYYY-MM-DD), Europe/Berlin timezone."},"count":{"type":"integer","example":12}}},"StatisticsMonthlyBreakdown":{"type":"object","required":["call_count","overall_call_seconds","average_calls_per_day","daily_call_counts"],"properties":{"call_count":{"type":"integer","example":240,"description":"Completed, non-error calls that started in the selected ISO week, including calls that count 0 seconds."},"overall_call_seconds":{"type":"integer","example":60000,"description":"Sum of billable seconds, rated the way smao invoices calls (see `/statistics/usage`): recorded assistant session time with a 60-second minimum per call, cut at a completed SIP REFER hand-off. Calls without recorded session time, such as bypassed or policy-rejected calls, contribute 0 seconds even though they remain included in `call_count`."},"average_calls_per_day":{"type":"number","example":12,"description":"Calls divided by the number of days that had calls (not all calendar days in the month), rounded to the nearest whole number."},"daily_call_counts":{"type":"array","items":{"$ref":"#/components/schemas/StatisticsDailyCallCount"}}}},"StatisticsSummary":{"type":"object","required":["available_weeks","available_assistants"],"properties":{"available_weeks":{"type":"array","description":"Every ISO (week, year) pair, in German time (Europe/Berlin), in which at least one completed call started.","items":{"$ref":"#/components/schemas/StatisticsWeekYear"}},"available_assistants":{"type":"array","description":"Every assistant currently in the organization. The sentinel `all` is NOT included - clients may always pass `assistant_id=all` to `/usage`.","items":{"$ref":"#/components/schemas/StatisticsAvailableAssistant"}}}},"StatisticsUsage":{"type":"object","required":["period","assistant_id","monthly","weekly_call_counts","weekly_call_seconds","hourly_call_counts_last_24h"],"properties":{"period":{"$ref":"#/components/schemas/StatisticsWeekYear"},"assistant_id":{"oneOf":[{"type":"string","enum":["all"]},{"type":"string","pattern":"^[a-f0-9]{24}$"}],"description":"Echoes the filter the client sent."},"monthly":{"type":"object","description":"Breakdown for the month or months intersecting the selected ISO week, keyed by month name (for example `April`). Only months with at least one completed, non-error call appear. Treat keys as display labels, not stable identifiers.","additionalProperties":{"$ref":"#/components/schemas/StatisticsMonthlyBreakdown"}},"weekly_call_counts":{"type":"array","description":"7 integers, Mon..Sun by call start time, for the selected (week, year). Unlike `monthly.*.call_count`, this array counts only calls with more than 0 billable seconds, that is calls with recorded assistant session time. The service returns an empty array when no calls match.","minItems":0,"maxItems":7,"items":{"type":"integer"}},"weekly_call_seconds":{"type":"array","description":"7 integers of billable seconds (rated like `monthly.*.overall_call_seconds`), Mon..Sun by call start time, for the selected week. The service returns an empty array when no calls match.","minItems":0,"maxItems":7,"items":{"type":"integer"}},"hourly_call_counts_last_24h":{"type":"array","description":"24 integers for the last 24 hours ending at request time (index 0 = 23–24h ago, index 23 = 0–1h ago), by call start time. Counts only calls with more than 0 billable seconds, like `weekly_call_counts`. This array is organization-wide and independent of the `week`, `year`, and `assistant_id` filters.","minItems":24,"maxItems":24,"items":{"type":"integer"}}}},"StatisticsAssistantEntry":{"type":"object","required":["assistant_id","assistant_name","assistant_language","is_deleted","total_calls","total_call_seconds","average_call_seconds","average_calls_per_day","weekly_call_counts","weekly_call_seconds","daily_call_counts"],"properties":{"assistant_id":{"type":["string","null"],"pattern":"^[a-f0-9]{24}$","example":"65f8fa6f1a9d8e0012ab34cd","description":"Null when the call was recorded without an assistant reference (legacy or orphaned calls)."},"assistant_name":{"type":"string"},"assistant_language":{"type":["string","null"],"description":"The assistant's `language`, or `null` when the assistant no longer exists or is unknown."},"is_deleted":{"type":"boolean","description":"True if the assistant no longer exists in this organization (deleted or moved)."},"total_calls":{"type":"integer","description":"Completed, non-error calls that started in the week, including calls that count 0 seconds."},"total_call_seconds":{"type":"integer","description":"Billable seconds for the week, rated like `StatisticsMonthlyBreakdown.overall_call_seconds`. Calls without recorded assistant session time contribute 0 seconds but remain included in `total_calls` and `weekly_call_counts`."},"average_call_seconds":{"type":"number","description":"`total_call_seconds` divided by `total_calls` (calls counting 0 seconds included), rounded to the nearest whole second."},"average_calls_per_day":{"type":"number","description":"Mean calls per day across days that had calls, rounded to one decimal place."},"weekly_call_counts":{"type":"array","minItems":7,"maxItems":7,"items":{"type":"integer"},"description":"Mon..Sun completed, non-error call counts by call start time, including calls that count 0 seconds."},"weekly_call_seconds":{"type":"array","minItems":7,"maxItems":7,"items":{"type":"integer"},"description":"Mon..Sun billable seconds by call start time."},"daily_call_counts":{"type":"array","items":{"$ref":"#/components/schemas/StatisticsDailyCallCount"}}}},"StatisticsAssistantsUsage":{"type":"object","required":["period","total_assistants","total_calls","assistants"],"properties":{"period":{"$ref":"#/components/schemas/StatisticsWeekYear"},"total_assistants":{"type":"integer"},"total_calls":{"type":"integer"},"assistants":{"type":"array","items":{"$ref":"#/components/schemas/StatisticsAssistantEntry"}}}},"Tool":{"type":"object","required":["id","tool_key","display_name","description","parameters","execution_type","source","webhook","integration","auth","created_at","updated_at"],"additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-f0-9]{24}$","example":"65f8fa6f1a9d8e0012ab34cd"},"tool_key":{"type":"string","example":"get_opening_hours"},"display_name":{"type":"string","example":"Get Opening Hours"},"description":{"type":"string","example":"Returns the opening hours for the requested weekday."},"parameters":{"type":"object","additionalProperties":true,"description":"JSON Schema for tool arguments. Customer-defined."},"execution_type":{"type":"string","enum":["webhook"],"description":"Public API list/get operations expose webhook tools only. Integration-type tools created in the dashboard are filtered out."},"source":{"type":"string","enum":["custom","template"]},"webhook":{"oneOf":[{"$ref":"#/components/schemas/ToolWebhookConfig"},{"type":"null"}]},"integration":{"type":"null","description":"Always `null` because integration tools are not exposed by this API."},"auth":{"oneOf":[{"$ref":"#/components/schemas/ToolAuthSummary"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ToolWebhookConfig":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","pattern":"^https://","example":"https://api.example.com/assistant-tools","description":"Endpoint that receives tool invocations. The executor accepts only HTTPS URLs and rejects `http://localhost` and every other non-HTTPS URL. At invocation time, URLs that resolve to private, loopback, link-local, or cloud-metadata addresses are rejected and redirects are not followed - an HTTPS URL that redirects to a private address will fail. The URL supports the same `@key` and `@key.subfield` placeholders as `body_template`. Substituted values are percent-encoded in path and query components. A substituted path segment that would become `.` or `..` is rejected before sending. GET appends unused, non-null arguments as encoded query parameters; argument names beginning with `_` are omitted."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"default":"POST"},"headers":{"type":"object","additionalProperties":true,"description":"Custom HTTP headers. They are stored and returned as plain text, so put credentials in `auth`, never here. Header values support the same `@key` placeholders as `body_template`; header names are literal. A custom header whose name matches the header set by `auth` (case-insensitive, ignoring surrounding whitespace) is ignored, so it cannot override the configured credential."},"body_template":{"type":"string","maxLength":50000,"description":"Request body template. `@key` reads a call argument; `@key.subfield` reads an own property within an object argument. Missing paths become empty strings. Substitution is single-pass: placeholders inside argument values are not evaluated again. JSON templates are parsed before substitution and resolved structurally. Object keys are literal; each value stays in its authored position and cannot create or override sibling keys. A placeholder inside a JSON string (`{\"n\":\"@count\"}` or `\"id-@count\"`) always produces text: objects and arrays become their JSON text and null becomes an empty string. A bare placeholder (`{\"n\":@count}`) inserts the argument as a JSON value: numbers, booleans, null, objects and arrays keep their type, a string that is itself one JSON value (such as `\"42\"`) is inserted as that value, and any other string is inserted as a JSON string. A literal `user@example.com` is preserved. JSON bodies are serialized with a default `Content-Type: application/json`, unless a content type is explicitly configured. A template that still does not parse as JSON after quoting bare placeholders uses raw-text substitution; raw text has no JSON structure guarantee. `@_context` exposes only these fixed scalar fields (unavailable fields are null): `callId`, `sessionId`, `language`, `callerPhone`, `organizationId`, `instanceId`, `assistantId`, `organizationName`, `assistantName`. Raw instance, organization and assistant documents are inaccessible; paths such as `@_context.instance.secretKey` become empty strings. An argument named `_context` cannot replace this projection. GET requests have no body."},"timeout_ms":{"type":"integer","minimum":500,"maximum":60000,"default":10000},"retry_count":{"type":"integer","minimum":0,"maximum":5,"default":0}}},"ToolAuthSummary":{"type":"object","required":["type","has_secret"],"additionalProperties":false,"description":"Auth as returned in responses. The secret is never returned; `has_secret` shows whether one is stored. To rotate, PATCH the tool with a new `auth`.","properties":{"type":{"type":"string","enum":["apiKey","bearer","basic"]},"header_name":{"type":["string","null"],"description":"Header that carries the `apiKey` secret. `null` for other types."},"username":{"type":["string","null"],"description":"Username for `basic` auth."},"has_secret":{"type":"boolean","description":"True when an auth secret / password is stored. The actual value is never returned by the API - submit a new value on PATCH to rotate."}}},"ToolAuthInput":{"description":"Auth credentials sent on POST/PATCH. Shape varies by `type`.\nNote: `secret` and `password` are write-only; responses use `ToolAuthSummary`.\n","oneOf":[{"title":"ApiKey","type":"object","additionalProperties":false,"required":["type","header_name","secret"],"properties":{"type":{"type":"string","const":"apiKey"},"header_name":{"type":"string","minLength":1},"secret":{"type":"string","minLength":1,"writeOnly":true}}},{"title":"Bearer","type":"object","additionalProperties":false,"required":["type","secret"],"description":"Sent as `Authorization: Bearer <secret>`.","properties":{"type":{"type":"string","const":"bearer"},"header_name":{"type":"string","deprecated":true,"description":"Ignored. Accepted for older clients."},"secret":{"type":"string","minLength":1,"writeOnly":true}}},{"title":"Basic","type":"object","additionalProperties":false,"required":["type","username","password"],"properties":{"type":{"type":"string","const":"basic"},"username":{"type":"string","minLength":1},"password":{"type":"string","minLength":1,"writeOnly":true}}}],"discriminator":{"propertyName":"type"}},"ToolCreate":{"type":"object","required":["tool_key","display_name","execution_type","webhook"],"additionalProperties":false,"example":{"tool_key":"get_opening_hours","display_name":"Get Opening Hours","execution_type":"webhook","webhook":{"url":"https://api.example.com/assistant-tools"}},"properties":{"tool_key":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","minLength":1,"maxLength":80,"example":"get_opening_hours"},"display_name":{"type":"string","minLength":1,"maxLength":200,"description":"Leading/trailing whitespace is trimmed."},"description":{"type":"string","default":"","maxLength":1000},"execution_type":{"type":"string","enum":["webhook"],"description":"v1 accepts `webhook` only. Integration-type tools must be created via the dashboard (OAuth flow)."},"parameters":{"type":"object","additionalProperties":true,"description":"JSON Schema defining the tool arguments."},"webhook":{"$ref":"#/components/schemas/ToolWebhookConfig"},"auth":{"$ref":"#/components/schemas/ToolAuthInput"}}},"ToolUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"description":"Partial update - include only fields you want to change. `tool_key` and `execution_type` are immutable. Changing `webhook.url` of a tool with a stored credential requires `auth` with that credential. A `webhook` object replaces the whole stored webhook configuration; omitted webhook fields return to their defaults or are removed.","example":{"display_name":"Get Current Opening Hours"},"properties":{"display_name":{"type":"string","minLength":1,"maxLength":200,"description":"Leading/trailing whitespace is trimmed."},"description":{"type":"string","maxLength":1000},"parameters":{"type":"object","additionalProperties":true},"webhook":{"$ref":"#/components/schemas/ToolWebhookConfig"},"auth":{"$ref":"#/components/schemas/ToolAuthInput"}}},"PageTool":{"type":"object","required":["data","meta"],"additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}}}}}