{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/v1/agents/voices":{"get":{"operationId":"agents_list_voices_v1_agents_voices_get","summary":"List Voices","description":"Return available voices from the configured voice provider.","tags":["agents"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents":{"get":{"operationId":"agents_list_agents_v1_agents_get","summary":"List Agents","description":"List all agents for this account.","tags":["agents"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"agents_create_agent_v1_agents_post","summary":"Create Agent","description":"Create a new agent.\n\nAn agent represents an AI persona (Support Bot, Sales Agent, etc.)\nthat can have phone numbers attached to it.\n\nvoiceMode: \"webhook\" (default) forwards transcripts to your webhook.\n           \"hosted\" uses a built-in LLM with systemPrompt (no webhook needed).","tags":["agents"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}":{"get":{"operationId":"agents_get_agent_v1_agents__agent_id__get","summary":"Get Agent","description":"Get a single agent with its attached numbers.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"agents_delete_agent_v1_agents__agent_id__delete","summary":"Delete Agent","description":"Delete an agent.\n\nPhone numbers, conversations, and calls associated with the agent will have their\nagent reference cleared (set to null) but will not be deleted themselves.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"agents_update_agent_v1_agents__agent_id__patch","summary":"Update Agent","description":"Update an agent's configuration.\n\nUse this to change voice mode, system prompt, greeting, or voice.\nSwitching voiceMode to \"hosted\" re-provisions the voice agent with built-in LLM.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/numbers":{"post":{"operationId":"agents_attach_number_to_agent_v1_agents__agent_id__numbers_post","summary":"Attach Number To Agent","description":"Attach an existing phone number to an agent.\n\nThe number must belong to the same account and not be released.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachNumberRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/numbers/{number_id}":{"delete":{"operationId":"agents_detach_number_from_agent_v1_agents__agent_id__numbers__number_id__delete","summary":"Detach Number From Agent","description":"Detach a phone number from an agent (sets agentId to null).\n\nThe number remains active and can be re-attached to any agent.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/conversations":{"get":{"operationId":"agents_list_agent_conversations_v1_agents__agent_id__conversations_get","summary":"List Agent Conversations","description":"List all conversations for an agent.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routes__agents__ConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/calls":{"get":{"operationId":"agents_list_agent_calls_v1_agents__agent_id__calls_get","summary":"List Agent Calls","description":"List all calls for an agent.","tags":["agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers":{"get":{"operationId":"numbers_list_numbers_v1_numbers_get","summary":"List Numbers","description":"List the active phone numbers for this account.\n\nReleased (deleted) numbers are excluded so the count reflects the numbers\nthe account actually holds. Fetch a single number via GET /{number_id}\n(which returns it regardless of status). Pass externalId to find the\nnumber you tagged with your own identifier.","tags":["numbers"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"externalId","in":"query","description":"Only the number tagged with this externalId","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"numbers_create_number_v1_numbers_post","summary":"Create Number","description":"Provision a new phone number from the account's configured SMS provider\n(or an iMessage line with type=imessage). Optional externalId tags the\nnumber with your own identifier; see PATCH /v1/numbers/{id}.","tags":["numbers"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNumberRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/available":{"get":{"operationId":"numbers_list_available_numbers_v1_numbers_available_get","summary":"List Available Numbers","description":"Search purchasable phone numbers before buying one.\n\nPick a number here, then buy it by passing the same `phoneNumber` to\n`POST /v1/numbers`. Searching with no criteria returns a page of whatever\nis currently in stock.\n\n**Results are not reserved.** This is live inventory, so a number can be\nbought by someone else between your search and your purchase. When that\nhappens the purchase returns `409` with fresh alternatives in this same\nshape; pick another and retry rather than treating it as fatal.\n\nCriteria support varies by account, and there is no single rule that\nholds everywhere:\n\n- `areaCode` is the most broadly supported filter.\n- `city`, `state` and `zip` work on some accounts and not others.\n  Where they aren't supported they are ignored rather than rejected, so\n  check what comes back instead of assuming the filter applied.\n- `state` on its own is honored on some accounts and rejected with `400`\n  on others. Pair it with `city` for consistent behavior.\n\nReturns `404` when number search isn't available on your account at all,\nand `422` when it isn't configured yet. If you need location search and\naren't getting it, contact support.\n\nGiving a Canadian area code searches Canada even though `country`\ndefaults to `US`.\n\n`country=UK` (or `GB`) returns United Kingdom mobile numbers on accounts\nwhere they're available. UK numbers are SMS-only and have no area codes,\nso location filters are rejected for UK searches.\n\nIf `widened` is true, your exact criteria were out of stock and these are\nnearby alternatives instead.","tags":["numbers"],"parameters":[{"name":"areaCode","in":"query","description":"3-digit area code, e.g. \"415\". The most broadly supported filter.","required":false,"schema":{"type":["string","null"]}},{"name":"city","in":"query","description":"City name. Pair with state. Support varies by account.","required":false,"schema":{"type":["string","null"]}},{"name":"state","in":"query","description":"2-letter state code, e.g. \"CA\". Pair with city for consistent results; standalone support varies by account.","required":false,"schema":{"type":["string","null"]}},{"name":"zip","in":"query","description":"5-digit ZIP. Support varies by account.","required":false,"schema":{"type":["string","null"]}},{"name":"country","in":"query","description":"\"US\", \"CA\", or \"UK\" (\"GB\" is accepted as an alias). United Kingdom availability varies by account.","required":false,"schema":{"type":"string","default":"US"}},{"name":"limit","in":"query","description":"Max results, 1-30.","required":false,"schema":{"type":"integer","minimum":1,"maximum":30,"default":10}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableNumberListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/lookup":{"get":{"operationId":"numbers_lookup_numbers_v1_numbers_lookup_get","summary":"Lookup Numbers","description":"Look up line-type intelligence for phone numbers.\n\nAnswers \"should my agent text this number\" before spending a message:\nmobile (`lineType: \"mobile\"`) vs landline vs VoIP, country, and whether\nthe handset supports RCS. Up to 25 comma-separated numbers per request.\nBilled at $0.009 per number looked up.","tags":["numbers"],"parameters":[{"name":"phoneNumbers","in":"query","description":"Comma-separated E.164 numbers, up to 25","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/{number_id}":{"get":{"operationId":"numbers_get_number_v1_numbers__number_id__get","summary":"Get Number","description":"Get a single phone number owned by this account.\n\nReturns the number regardless of status (including released) so detail\npages still load for numbers that are no longer active. `ext:<externalId>`\nin place of the id looks the number up by the tag you set.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"numbers_delete_number_v1_numbers__number_id__delete","summary":"Delete Number","description":"Release (delete) a phone number.\n\nThis will:\n1. Release the number from its upstream provider when supported\n2. Mark the number as \"released\" in the database\n3. Keep all messages and conversation history (for audit purposes)\n\nWARNING: This action is irreversible! The number cannot be recovered.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"numbers_update_number_v1_numbers__number_id__patch","summary":"Update Number","description":"Update a number. Only the fields you send are changed.\n\nexternalId: your own identifier for the number. Send a string to set it,\nnull to clear it, or omit it to leave it unchanged. Must be unique within\nyour account (409 otherwise). Works on any number type. The tag is echoed\non every number response and webhook payload and usable for lookup as\nGET /v1/numbers/ext:<externalId> or GET /v1/numbers?externalId=<externalId>.\n\nexpiresAt: hard end date for the number (ISO 8601). After it passes the\nnumber is released automatically and a number.released webhook is sent.\nSend a datetime to set or move it (at least 5 minutes out), null to\nclear it, or omit it to leave it unchanged.\n\nFields this endpoint does not support are rejected with 422, never\nsilently ignored.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNumberRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/{number_id}/messages":{"get":{"operationId":"numbers_get_messages_v1_numbers__number_id__messages_get","summary":"Get Messages","description":"Get messages for a specific phone number.\n\nNewest first. Pass the previous response's `nextCursor` as `cursor` to\nwalk older history without skipping or repeating records, even when\nseveral messages share a timestamp. `before`/`after` timestamp filters\nare still accepted.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"before","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"after","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous response's nextCursor. Takes precedence over before/after.","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/{number_id}/inbound-calls":{"patch":{"operationId":"numbers_update_inbound_calls_v1_numbers__number_id__inbound_calls_patch","summary":"Enable or disable inbound calls","description":"Turn inbound calls on or off for one number.\n\nWith `enabled: false` the number rejects incoming calls before they are\nanswered: no call record is created and nothing is billed. Messaging in\nboth directions and outbound calls are unaffected. The setting is kept\nwhen the number is attached to an agent or the agent is edited, so a\nnumber can hold an agent assignment for messaging only.\n\nPass the number's `id` as returned by the API, not the E.164 string.\nNumbers that cannot enforce the setting return 422: messaging-only\nlines, and most numbers that route calls to your own SIP trunk, which\nmanage inbound calls on your platform instead.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundCallsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundCallsUpdateRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/messages":{"post":{"operationId":"messages_send_message_v1_messages_post","summary":"Send Message","description":"Send a message through the selected number's transport. Use channel=\"whatsapp\" for a WhatsApp connection; see the WhatsApp guide for its 24-hour window and template requirements. Enabled branded RCS senders have separate onboarding and content rules; see /documentation/guides/rcs.\n\nUse media_urls for public HTTPS attachments, not both media_url and media_urls. WhatsApp and group sends accept one attachment; other eligible transports accept up to 20. Use an empty body for media-only messages. Some iMessage lines reject text with multi-image carousels; native iMessage voice memos require one audio file and no text. Branded RCS cannot mix body text with media_urls; see [RCS rich cards](/documentation/guides/rcs#rich-cards) for the HTTP payload.\n\nUse to_number for an existing recipient/group, or recipients to create a supported group. Unsupported feature/number combinations return errors. A send response is not proof of delivery; inspect message history for status, failureReason, and deliveredChannel. See /documentation/guides/messages.","tags":["messages"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/messages/{message_id}/reactions":{"post":{"operationId":"messages_send_reaction_v1_messages__message_id__reactions_post","summary":"Send Reaction","description":"React to a message on an eligible iMessage line or WhatsApp connection. Classic tapback names work on supported iMessage lines; custom emoji require a line that supports them. Standard SMS/MMS and branded RCS lines reject this endpoint. The response uses reaction_type and message_id; webhook event fields use camelCase.","tags":["messages"],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendReactionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendReactionRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/conversations":{"get":{"operationId":"conversations_list_conversations_v1_conversations_get","summary":"List Conversations","description":"List all conversations for this account.\n\nSorted by most recent activity (lastMessageAt desc). `total` is served\nfrom a short per-account cache (app/services/conversation_totals.py);\n`hasMore` is computed from the page query itself.","tags":["conversations"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routes__conversations__ConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/conversations/{conversation_id}":{"get":{"operationId":"conversations_get_conversation_v1_conversations__conversation_id__get","summary":"Get Conversation","description":"Get a conversation with its recent messages.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"message_limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":50}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"conversations_update_conversation_v1_conversations__conversation_id__patch","summary":"Update Conversation","description":"Update a conversation.\n\n- `metadata`: store custom context for AI agents (customer info, order/ticket\n  ids, session state). Replaces the stored object; surfaced in webhook\n  payloads as `conversationState`.\n- `group_name`: rename a group conversation (iMessage groups only). Also\n  renames the underlying iMessage thread.\n\nOnly the fields you include are changed: a rename-only PATCH leaves metadata\nuntouched, and vice versa.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConversationRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/conversations/{conversation_id}/messages":{"get":{"operationId":"conversations_get_conversation_messages_v1_conversations__conversation_id__messages_get","summary":"Get Conversation Messages","description":"Get paginated messages for a conversation.\n\nEach page is returned oldest-first. Pass the previous response's\n`nextCursor` as `cursor` to load older history without skipping or\nrepeating records, even when several messages share a timestamp.\n`before`/`after` timestamp filters are still accepted.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"before","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"after","in":"query","required":false,"schema":{"type":["string","null"],"format":"date-time"}},{"name":"cursor","in":"query","description":"Opaque cursor from a previous response's nextCursor. Takes precedence over before/after.","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/conversations/{conversation_id}/typing":{"post":{"operationId":"conversations_send_typing_indicator_v1_conversations__conversation_id__typing_post","summary":"Send Typing Indicator","description":"Show a typing indicator in the conversation (iMessage only).\n\nWorks for both 1:1 and group chats: a group id is itself a valid typing\ntarget, so every participant sees the indicator. Best-effort: the\nindicator may be silently dropped if the chat has no recent activity, the\nrecipient isn't on iMessage, or it's RCS-routed (RCS carries no composing\nstate). Auto-expires after a few seconds; no \"stop typing\" call needed.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTypingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/conversations/{conversation_id}/background":{"post":{"operationId":"conversations_set_chat_background_v1_conversations__conversation_id__background_post","summary":"Set Chat Background","description":"Set a custom wallpaper for the chat (iMessage only).\n\nCustomer sends `image_url`; we fetch (≤10MB, JPEG/PNG/GIF/WebP/HEIC),\nvalidate, and forward as multipart to the iMessage provider. Idempotent —\nre-setting replaces. Recipients on iOS < 18 fall back to the default\nsilently.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetBackgroundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetBackgroundRequest"}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"conversations_remove_chat_background_v1_conversations__conversation_id__background_delete","summary":"Remove Chat Background","description":"Clear the custom wallpaper for the chat (iMessage only).\n\nIdempotent: deleting a default-background chat returns 204 (no-op).","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/contacts":{"get":{"operationId":"contacts_list_contacts_v1_contacts_get","summary":"List Contacts","description":"List all contacts for this account.\n\nOptional `search` query filters by name or phone number (case-insensitive contains).","tags":["contacts"],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"contacts_create_contact_v1_contacts_post","summary":"Create Contact","description":"Create a new contact.\n\nPhone number is normalized to E.164 format. Returns 409 if a contact\nwith this phone number already exists for the project.","tags":["contacts"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/contacts/capabilities":{"get":{"operationId":"contacts_get_contact_capabilities_v1_contacts_capabilities_get","summary":"Get Contact Capabilities","description":"Check which messaging channels a phone number supports, without sending\na message.\n\nRuns a live check (typically 1-2 seconds), so the result reflects the\nnumber right now. Capabilities can still change by the time you send.\nRequires at least one active iMessage-capable or RCS number on the\naccount; each flag is null when your account holds no line that could\nact on it (rcs reachability is checked against YOUR agents, so it can\ndiffer per account while an agent is pre-launch).","tags":["contacts"],"parameters":[{"name":"phone_number","in":"query","description":"Phone number to check (E.164 preferred; URL-encode + as %2B)","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCapabilitiesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/contacts/{contact_id}":{"get":{"operationId":"contacts_get_contact_v1_contacts__contact_id__get","summary":"Get Contact","description":"Get a single contact by ID.","tags":["contacts"],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"contacts_delete_contact_v1_contacts__contact_id__delete","summary":"Delete Contact","description":"Delete a contact.","tags":["contacts"],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"contacts_update_contact_v1_contacts__contact_id__patch","summary":"Update Contact","description":"Update a contact's fields.\n\nIf phoneNumber is updated, it's re-normalized and checked for uniqueness (409 on conflict).","tags":["contacts"],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/register/status":{"get":{"operationId":"registration_get_registration_status_v1_register_status_get","summary":"Get Registration Status","description":"Check registration status in the selected account scope. Pass X-Sub-Account-Id when checking a campaign created in a sub-account. Review stage and campaign_status; account approval alone does not establish readiness for a specific number. Check outboundSms on that number. See [SMS registration](/sms-registration).","tags":["registration"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/register":{"get":{"operationId":"registration_get_registration_details_v1_register_get","summary":"Get Registration Details","description":"Retrieve the content of your submitted A2P 10DLC registration.\n\nReturns the brand identity and campaign content exactly as it was\nsubmitted (business info, description, use case, sample messages, opt-in\nconsent flow, opt-in screenshot URL) so you can review what carriers are\nreviewing. Internal registry ids, vendor names, and processing state are\nnever exposed; the coarse `stage` mirrors GET /v1/register/status. The\nEIN is returned as its last 4 digits only.\n\nLike the status endpoint, this resolves to a sub-account when the\nregistration lives on one (the default for POST /v1/register) — either\nautomatically when there's exactly one, or via the X-Sub-Account-Id\nheader.","tags":["registration"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationDetailResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"registration_register_a2p_v1_register_post","summary":"Register A2P","description":"Submit an SMS registration. Standard one-time fees are \\$25 for sole_proprietor or standard_brand and \\$70 for high_volume. Carrier review and number attachment must complete before outbound SMS is ready. Parent-account requests create a dedicated sub-account by default: save sub_account_id and use X-Sub-Account-Id for that campaign’s agents, numbers, and status. High-volume registration requests vetting; assigned capacity varies. Use PATCH /v1/register to correct an existing submission without another registration fee. See [SMS registration](/sms-registration) for the workflow and troubleshooting.","tags":["registration"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationRequest"}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"registration_update_a2p_registration_v1_register_patch","summary":"Update A2P Registration","description":"Update an existing A2P 10DLC registration.\n\nSend only the fields that changed — everything is optional. There is no\nfee. Changes are applied after review, and your registration keeps\nsending under its current approval while an update to an approved\nregistration is reviewed.\n\nRegistrations created with create_sub_account=true (the default) live on\na sub-account; this resolves to it automatically when there's exactly\none, or honors the X-Sub-Account-Id header.","tags":["registration"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationUpdateRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calls":{"get":{"operationId":"calls_list_calls_v1_calls_get","summary":"List Calls","description":"List all calls for this account.","tags":["calls"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"status","in":"query","description":"Filter by status: completed, in-progress, failed","required":false,"schema":{"type":["string","null"]}},{"name":"direction","in":"query","description":"Filter by direction: inbound, outbound","required":false,"schema":{"type":["string","null"]}},{"name":"type","in":"query","description":"Filter by type: pstn, web","required":false,"schema":{"type":["string","null"]}},{"name":"search","in":"query","description":"Search fromNumber or toNumber (contains)","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"calls_create_outbound_call_v1_calls_post","summary":"Create Outbound Call","description":"Initiate an outbound call.\n\nThis endpoint allows you to programmatically make phone calls from your agent\nto any phone number. Use `fromNumberId` to pick which of the agent's numbers\nto use as caller ID; if omitted, the first assigned number is used.\n\nFlow:\n1. Validates the agent belongs to your account and has a phone number\n2. Initiates a call from the agent's number to the destination\n3. When recipient answers, speaks the initial greeting (if provided)\n4. Listens for recipient's speech and sends to your webhook\n5. Continues conversation using your webhook responses","tags":["calls"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOutboundCallRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calls/web":{"post":{"operationId":"calls_create_web_call_v1_calls_web_post","summary":"Create Web Call","description":"Create a browser-based web call.\n\nReturns connection details that your frontend passes to the AgentPhone Web\nSDK (`agentphone-web-sdk` >= 0.2.0) to start the call in the browser.\n`expiresAt` is the access token's expiry as Unix epoch milliseconds.\n`id` identifies the AgentPhone call; `callId` identifies the media connection.\n\nFlow:\n1. Validates the agent belongs to your account\n2. Creates a web call and returns its connection details\n3. Your client calls `webClient.startCall({ accessToken, callId, transport, iceServers })`\n4. Call lifecycle (transcripts, webhooks) works the same as phone calls","tags":["calls"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebCallRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calls/{call_id}":{"get":{"operationId":"calls_get_call_v1_calls__call_id__get","summary":"Get Call","description":"Get a specific call with its transcripts.","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calls/{call_id}/end":{"post":{"operationId":"calls_end_call_v1_calls__call_id__end_post","summary":"End Call","description":"Terminate an ongoing call.\n\nWorks for both hosted-mode and webhook-mode calls. The call_ended\nwebhook from the voice provider updates status/endedAt asynchronously,\nso this endpoint returns the current call as soon as the stop request\nis accepted upstream.","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calls/{call_id}/recording":{"get":{"operationId":"calls_get_call_recording_v1_calls__call_id__recording_get","summary":"Get Call Recording","description":"Return the recording audio for a completed call, or 404 if no recording is available. This endpoint does not require an API key: the recording URL and call ID grant access to the audio. Treat them as sensitive bearer links and share only with intended recipients. Enable the recording add-on from Billing. recordingUrl is exposed in call details while the add-on is active; recordingAvailable indicates that audio exists.","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Recording audio. Content-Type is forwarded from the audio store; use that header to identify the format instead of assuming WAV.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/calls/{call_id}/transcript":{"get":{"operationId":"calls_get_call_transcript_v1_calls__call_id__transcript_get","summary":"Get Call Transcript","description":"Get the full transcript for a call.\n\nReturns the complete, ordered transcript regardless of the webhook\ncontextLimit setting.  Each entry contains the user utterance and\nthe corresponding agent response (when available).","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"calls_push_call_transcript_v1_calls__call_id__transcript_post","summary":"Push Call Transcript","description":"Push transcript turns for a call (e.g. from a BYO voice stack).\n\nAppends user and agent turns to the call's transcript. Each consecutive\nuser+agent pair is stored as one CallTranscript row. A trailing user turn\nwithout a following agent turn is stored with response=null.","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushTranscriptRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calls/{call_id}/transcript/stream":{"get":{"operationId":"calls_stream_call_transcript_v1_calls__call_id__transcript_stream_get","summary":"Stream Call Transcript","description":"Stream transcript events over Server-Sent Events (Content-Type: text/event-stream), not a single JSON response. Events are connected, turn, and ended; heartbeat comments keep the connection alive. The published TypeScript SDK 1.0.25 does not parse this stream correctly. Use these HTTP examples and the [streaming guide](/documentation/guides/calls#stream-transcript-sse) until a corrected SDK is released.","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Server-Sent Events. Each event has an event name (connected, turn, or ended) and JSON data; heartbeat lines are comments.","content":{"text/event-stream":{"schema":{"type":"object","additionalProperties":{"description":"Any type"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/{number_id}/calls":{"get":{"operationId":"calls_list_calls_for_number_v1_numbers__number_id__calls_get","summary":"List Calls For Number","description":"List all calls for a specific phone number.","tags":["calls"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/sip-trunks":{"get":{"operationId":"sipTrunks_list_sip_trunks_v1_sip_trunks_get","summary":"List Sip Trunks","description":"List SIP trunks for the current account.","tags":["sip-trunks"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunkListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"sipTrunks_create_sip_trunk_v1_sip_trunks_post","summary":"Create Sip Trunk","description":"Create a SIP trunk for routing your numbers' calls to your own SIP infrastructure.","tags":["sip-trunks"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunkResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/sip-trunks/{trunk_id}":{"get":{"operationId":"sipTrunks_get_sip_trunk_v1_sip_trunks__trunk_id__get","summary":"Get Sip Trunk","description":"Get a single SIP trunk.","tags":["sip-trunks"],"parameters":[{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"sipTrunks_delete_sip_trunk_v1_sip_trunks__trunk_id__delete","summary":"Delete Sip Trunk","description":"Delete a SIP trunk (removes upstream and soft-deletes locally).","tags":["sip-trunks"],"parameters":[{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunkDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"sipTrunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch","summary":"Update Sip Trunk","description":"Update a SIP trunk (name, transfers, origination URIs).","tags":["sip-trunks"],"parameters":[{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"description":"All fields optional; send only what changes.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"description":"Display name."},"transfers":{"$ref":"#/components/schemas/V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaTransfers","description":"Which transfers the trunk allows."},"transfer_caller_id":{"$ref":"#/components/schemas/V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaTransferCallerId","description":"Caller ID presented on a transferred leg."},"origination":{"$ref":"#/components/schemas/V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOrigination","description":"Where inbound calls to this trunk are delivered."}}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks":{"get":{"operationId":"webhooks_get_webhook_v1_webhooks_get","summary":"Get Webhook","description":"Get the master webhook configuration for this account.","tags":["webhooks"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/WebhookResponse"},{"type":"null"}]}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"webhooks_create_or_update_webhook_v1_webhooks_post","summary":"Create Or Update Webhook","description":"Register or update the webhook URL for this account.\n\nIf a webhook already exists, it will be updated.\nA new secret is generated each time.\n\ncontextLimit: Number of recent messages to include in webhook payloads (0-50, default: 10).\nSet to 0 to disable history in webhooks.","tags":["webhooks"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"webhooks_delete_webhook_v1_webhooks_delete","summary":"Delete Webhook","description":"Remove the master webhook for this account.","tags":["webhooks"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks/deliveries":{"get":{"operationId":"webhooks_list_deliveries_v1_webhooks_deliveries_get","summary":"List Deliveries","description":"Get paginated webhook delivery attempts for all account webhooks.","tags":["webhooks"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"hours","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":1,"maximum":168}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedDeliveriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks/deliveries/stats":{"get":{"operationId":"webhooks_delivery_stats_v1_webhooks_deliveries_stats_get","summary":"Delivery Stats","description":"Aggregated delivery stats for the account's webhooks over the last N hours.","tags":["webhooks"],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":168,"default":24}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks/deliveries/all-time":{"get":{"operationId":"webhooks_all_time_stats_v1_webhooks_deliveries_all_time_get","summary":"All Time Stats","description":"Lightweight all-time delivery counts using indexed COUNT queries.","tags":["webhooks"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllTimeStatsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/webhooks/test":{"post":{"operationId":"webhooks_test_webhook_v1_webhooks_test_post","summary":"Test Webhook","description":"Send a test webhook to verify the endpoint is working.\n\nSends a synthetic agent.message payload (flagged `\"test\": true`) through\nthe real delivery path to the configured URL. The optional JSON body\noverrides `from`, `to`, `message` and `channel` so a handler can be\nexercised with the numbers it actually routes on.\nPass ?agentId=... to control which agent appears in the payload;\notherwise the first agent in the account is used.","tags":["webhooks"],"parameters":[{"name":"agentId","in":"query","description":"Agent ID to include in the test payload","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TestWebhookRequest"},{"type":"null"}]}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/webhook":{"get":{"operationId":"agentWebhooks_get_agent_webhook_v1_agents__agent_id__webhook_get","summary":"Get Agent Webhook","description":"Get the webhook configuration for a specific agent.","tags":["agent-webhooks"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/WebhookResponse"},{"type":"null"}]}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"agentWebhooks_create_or_update_agent_webhook_v1_agents__agent_id__webhook_post","summary":"Create Or Update Agent Webhook","description":"Register or update a webhook URL for a specific agent.\n\nWhen set, this agent's events are delivered here instead of the account default webhook.","tags":["agent-webhooks"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"agentWebhooks_delete_agent_webhook_v1_agents__agent_id__webhook_delete","summary":"Delete Agent Webhook","description":"Remove the webhook for a specific agent.","tags":["agent-webhooks"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/webhook/deliveries":{"get":{"operationId":"agentWebhooks_list_agent_deliveries_v1_agents__agent_id__webhook_deliveries_get","summary":"List Agent Deliveries","description":"Get recent webhook delivery attempts for a specific agent's webhook.","tags":["agent-webhooks"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":50}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agents/{agent_id}/webhook/test":{"post":{"operationId":"agentWebhooks_test_agent_webhook_v1_agents__agent_id__webhook_test_post","summary":"Test Agent Webhook","description":"Send a test webhook to the agent's webhook endpoint.\n\nSame optional overrides as POST /v1/webhooks/test.","tags":["agent-webhooks"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TestWebhookRequest"},{"type":"null"}]}}}},"security":[{"HTTPBearer":[]}]}},"/v1/usage":{"get":{"operationId":"usage_get_usage_v1_usage_get","summary":"Get Usage","description":"Get usage statistics for the current account.\n\nReturns:\n- Phone number limits (used/limit/remaining)\n- Message statistics (total, last 24h, last 7 days, last 30 days)\n- Call statistics (total, last 24h, last 7 days, last 30 days)\n- Webhook delivery statistics","tags":["usage"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/usage/daily":{"get":{"operationId":"usage_get_daily_usage_v1_usage_daily_get","summary":"Get Daily Usage","description":"Get daily usage breakdown for the last N days (up to 365).\nReturns per-day counts of messages, calls, and webhook deliveries.","tags":["usage"],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":365,"default":30}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/usage/monthly":{"get":{"operationId":"usage_get_monthly_usage_v1_usage_monthly_get","summary":"Get Monthly Usage","description":"Get monthly usage aggregation for the last N months.\nReturns per-month totals of messages, calls, and webhook deliveries.","tags":["usage"],"parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":24,"default":6}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/usage/by-number":{"get":{"operationId":"usage_get_usage_by_number_v1_usage_by_number_get","summary":"Get Usage By Number","description":"Get usage statistics broken down by phone number, with linked agent info.","tags":["usage"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberUsageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/usage/by-agent":{"get":{"operationId":"usage_get_usage_by_agent_v1_usage_by_agent_get","summary":"Get Usage By Agent","description":"Get usage broken down by agent for the current calendar week, month, or year.\nIncludes message count, completed call count, and total call seconds per agent.\nCalls/messages with no agent attached are bucketed as \"Unassigned\".","tags":["usage"],"parameters":[{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/V1UsageByAgentGetParametersPeriod"}},{"name":"tz","in":"query","description":"IANA timezone, e.g. America/New_York","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/integrations/whatsapp/connect":{"post":{"operationId":"whatsapp_connectIntegrationsWhatsappConnectPost","summary":"Whatsapp Connect","description":"Complete Embedded Signup: exchange the code, store the connection, and\nonboard the phone number (register + subscribe webhooks).","tags":["whatsapp"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppConnectRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/integrations/whatsapp/{connection_id}/available-numbers":{"get":{"operationId":"whatsapp_availableNumbersIntegrationsWhatsappConnectionIdAvailableNumbersGet","summary":"Whatsapp Available Numbers","description":"List the WABA's phone numbers with their connected state, for the\nadd-number picker. Registration is deliberate and per-number: registering\na number on the Cloud API kicks it off the WhatsApp Business app, so we\nnever auto-register a whole WABA.","tags":["whatsapp"],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/integrations/whatsapp/{connection_id}/numbers":{"post":{"operationId":"whatsapp_connectNumberIntegrationsWhatsappConnectionIdNumbersPost","summary":"Whatsapp Connect Number","description":"Connect an additional number from an already-connected WABA: validates\nthe number belongs to the WABA, registers it for Cloud API use, and binds\nit (dual-channel when the E.164 already exists on this account).","tags":["whatsapp"],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppNumberConnectRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/integrations/whatsapp/{connection_id}/templates":{"get":{"operationId":"whatsapp_listTemplatesIntegrationsWhatsappConnectionIdTemplatesGet","summary":"Whatsapp List Templates","description":"List the WABA's message templates and their approval status.\n\nTemplates are the only way to message someone outside the 24h customer\nservice window. A newly created one is PENDING until Meta reviews it;\npoll here for the transition to APPROVED (or REJECTED, with a reason).","tags":["whatsapp"],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"query","description":"Filter to one template name (all of its language variants).","required":false,"schema":{"type":["string","null"]}},{"name":"status","in":"query","description":"Filter by approval status, e.g. APPROVED or PENDING.","required":false,"schema":{"type":["string","null"]}},{"name":"category","in":"query","description":"Filter by category: MARKETING, UTILITY, or AUTHENTICATION.","required":false,"schema":{"type":["string","null"]}},{"name":"language","in":"query","description":"Filter by language code, e.g. en_US.","required":false,"schema":{"type":["string","null"]}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"whatsapp_createTemplateIntegrationsWhatsappConnectionIdTemplatesPost","summary":"Whatsapp Create Template","description":"Submit a template, authored or from Meta's Template Library.\n\nAn authored template (with `components`) comes back PENDING and can't be\nsent until it reaches APPROVED — UTILITY usually clears in minutes,\nMARKETING can take up to 24h.\n\nPassing `library_template_name` instead builds from Meta's library, where a\ntemplate used unchanged skips review and is usable straight away. That makes\nit the quickest way to get something sendable; the trade is that the copy is\nMeta's, customizable only through the library button/body inputs.","tags":["whatsapp"],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateCreateRequest"}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"whatsapp_deleteTemplateIntegrationsWhatsappConnectionIdTemplatesDelete","summary":"Whatsapp Delete Template","description":"Delete a template by name.\n\nMeta removes EVERY language variant registered under the name, and blocks\nreuse of that name for 30 days. There is no rename on Meta's side, so this\nis also the only way to reclaim a name from a typo'd or rejected template.","tags":["whatsapp"],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"query","description":"Template name to delete.","required":true,"schema":{"type":"string","minLength":1}},{"name":"hsm_id","in":"query","description":"Optional template id. Narrows the delete to that single language version instead of every variant under the name. Meta requires `name` alongside it.","required":false,"schema":{"type":["string","null"],"minLength":1}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/integrations/whatsapp/status":{"get":{"operationId":"whatsapp_statusIntegrationsWhatsappStatusGet","summary":"Whatsapp Status","tags":["whatsapp"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}}},"security":[{"HTTPBearer":[]}]}},"/integrations/whatsapp/{connection_id}":{"delete":{"operationId":"whatsapp_disconnectIntegrationsWhatsappConnectionIdDelete","summary":"Whatsapp Disconnect","description":"Disconnect a WABA: mark the connection disconnected and release its numbers.\n\nThe customer keeps all their Meta assets (we never delete anything on their\nside); this only stops AgentPhone from using them.","tags":["whatsapp"],"parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/verify/send":{"post":{"operationId":"verification_send_verification_v1_verify_send_post","summary":"Send Verification","description":"Send a 6-digit verification code to a phone number via SMS.\n\nUse this instead of sending your own code over `POST /v1/messages`: it\nroutes through carrier-registered sender IDs, so it reaches countries\nwhere plain application SMS from a US long code is not deliverable\n(e.g. Greece, UAE, the Philippines, the UK).\n\nThe code is always 6 digits, expires after 10 minutes, and allows up to\n3 check attempts. None of these are configurable.\n\n**Billing.** Sending a code costs the standard outbound SMS rate for the\ndestination country. A successful `POST /v1/verify/check` adds a $0.05\nverification fee; failed, expired, and exhausted checks are not charged.\n\n**Destination coverage.** A small number of countries are unavailable and\nreturn 400. Email founders@agentphone.to if you need access to one.","tags":["verification"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendVerificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendVerificationRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/verify/check":{"post":{"operationId":"verification_check_verification_v1_verify_check_post","summary":"Check Verification","description":"Check a verification code against a pending verification.\n\nPossible results:\n- `ok` — code is correct, phone number verified\n- `incorrect` — wrong code, try again (up to 3 attempts)\n- `exhausted` — too many failed attempts, send a new code\n- `expired` — verification expired (10 min), send a new code\n- `already_verified` — this verification was already completed\n\n**Billing.** An `ok` or `already_verified` result costs a $0.05\nverification fee. Other results are free.","tags":["verification"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckVerificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckVerificationRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/numbers/{number_id}/contact-card":{"get":{"operationId":"contactCards_get_contact_card_v1_numbers__number_id__contact_card_get","summary":"Get Contact Card","description":"Fetch the iMessage contact card set on this number.","tags":["contactCards"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"operationId":"contactCards_put_contact_card_v1_numbers__number_id__contact_card_put","summary":"Put Contact Card","description":"Create or replace the iMessage contact card on this number.","tags":["contactCards"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCardWriteRequest"}}}},"security":[{"HTTPBearer":[]}]},"delete":{"operationId":"contactCards_delete_contact_card_v1_numbers__number_id__contact_card_delete","summary":"Delete Contact Card","description":"Remove the iMessage contact card from this number.","tags":["contactCards"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/location/{phone_number}":{"get":{"operationId":"location_get_location_v1_location__phone_number__get","summary":"Get Location","tags":["location"],"parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/location/refresh":{"post":{"operationId":"location_refresh_locations_v1_location_refresh_post","summary":"Refresh Locations","tags":["location"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationRefreshResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/feedback":{"post":{"operationId":"feedback_submit_feedback_v1_feedback_post","summary":"Submit agent feedback","description":"Report an API issue or documentation mismatch, including the request id\nof the call it is about when you have one.\n\nReturns `201` when the feedback is stored, or `200` with\n`already_submitted: true` when feedback for the same `request_id` was\nalready recorded on this account.","tags":["feedback"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Feedback for this request_id was already recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFeedbackRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/sub-accounts":{"get":{"operationId":"subAccounts_list_sub_accounts_v1_sub_accounts_get","summary":"List Sub Accounts","tags":["sub-accounts"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"stats_days","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":1,"maximum":90}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"operationId":"subAccounts_create_sub_account_v1_sub_accounts_post","summary":"Create Sub Account","tags":["sub-accounts"],"parameters":[{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubAccountRequest"}}}},"security":[{"HTTPBearer":[]}]}},"/v1/sub-accounts/{sub_account_id}":{"delete":{"operationId":"subAccounts_delete_sub_account_v1_sub_accounts__sub_account_id__delete","summary":"Delete Sub Account","tags":["sub-accounts"],"parameters":[{"name":"sub_account_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"operationId":"subAccounts_update_sub_account_v1_sub_accounts__sub_account_id__patch","summary":"Update Sub Account","tags":["sub-accounts"],"parameters":[{"name":"sub_account_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubAccountRequest"}}}},"security":[{"HTTPBearer":[]}]}}},"tags":[{"name":"agents"},{"name":"numbers"},{"name":"messages"},{"name":"conversations"},{"name":"contacts"},{"name":"registration"},{"name":"calls"},{"name":"sip-trunks"},{"name":"webhooks"},{"name":"agent-webhooks"},{"name":"usage"},{"name":"whatsapp"},{"name":"verification"},{"name":"contactCards"},{"name":"location"},{"name":"feedback"},{"name":"sub-accounts"}],"servers":[{"url":"https://api.agentphone.ai","description":"Production"}],"components":{"schemas":{"AgentResponseVoiceMode":{"type":"string","enum":["webhook","hosted"],"title":"AgentResponseVoiceMode"},"AgentResponseModelTier":{"type":"string","enum":["turbo","balanced","max","realtime","live"],"default":"balanced","title":"AgentResponseModelTier"},"AgentResponseCustomToolsItems":{"type":"object","properties":{},"title":"AgentResponseCustomToolsItems"},"AgentResponseSttMode":{"type":"string","enum":["fast","accurate"],"default":"fast","description":"Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency).","title":"AgentResponseSttMode"},"AgentResponseAmbientSound":{"type":"string","enum":["none","office","coffee-shop","outdoor"],"default":"none","description":"Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed.","title":"AgentResponseAmbientSound"},"AgentResponseDenoisingMode":{"type":"string","enum":["noise-cancellation","noise-and-background-speech-cancellation"],"default":"noise-cancellation","description":"Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs.","title":"AgentResponseDenoisingMode"},"AgentNumberResponse":{"type":"object","properties":{"id":{"type":"string"},"phoneNumber":{"type":"string"},"status":{"type":"string"},"type":{"type":"string","default":"sms"}},"required":["id","phoneNumber","status"],"title":"AgentNumberResponse"},"AgentResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"voiceMode":{"$ref":"#/components/schemas/AgentResponseVoiceMode"},"enableMessaging":{"type":"boolean","default":true},"modelTier":{"$ref":"#/components/schemas/AgentResponseModelTier","default":"balanced"},"systemPrompt":{"type":["string","null"]},"voicePrompt":{"type":["string","null"]},"beginMessage":{"type":["string","null"]},"voice":{"type":"string"},"transferNumber":{"type":["string","null"]},"customTools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AgentResponseCustomToolsItems"}},"voicemailMessage":{"type":["string","null"]},"callScreeningIdentity":{"type":["string","null"]},"callScreeningPurpose":{"type":["string","null"]},"sttMode":{"$ref":"#/components/schemas/AgentResponseSttMode","default":"fast","description":"Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency)."},"ambientSound":{"$ref":"#/components/schemas/AgentResponseAmbientSound","default":"none","description":"Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed."},"denoisingMode":{"$ref":"#/components/schemas/AgentResponseDenoisingMode","default":"noise-cancellation","description":"Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs."},"maxSilenceMs":{"type":"integer","default":600000,"description":"Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min)."},"voiceSpeed":{"type":"number","format":"double","default":1,"description":"Voice speed multiplier. Range 0.5 to 2.0. Default 1.0."},"interruptionSensitivity":{"type":"number","format":"double","default":0.8,"description":"How easily callers can interrupt the agent. Range 0.0 to 1.0. Default 0.8."},"enableBackchannel":{"type":"boolean","default":true,"description":"When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true."},"language":{"type":"string","default":"en-US","description":"BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'."},"createdAt":{"type":"string","format":"date-time"},"numbers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AgentNumberResponse"}}},"required":["id","name","description","voiceMode","voice","createdAt"],"title":"AgentResponse"},"AgentListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"}},"total":{"type":"integer"}},"required":["data","total"],"title":"AgentListResponse"},"ValidationErrorLocItems":{"oneOf":[{"type":"string"},{"type":"integer"}],"title":"ValidationErrorLocItems"},"ValidationError":{"type":"object","properties":{"loc":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorLocItems"}},"msg":{"type":"string"},"type":{"type":"string"}},"required":["loc","msg","type"],"title":"ValidationError"},"HTTPValidationError":{"type":"object","properties":{"detail":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}},"title":"HTTPValidationError"},"CreateAgentRequestVoiceMode":{"type":"string","enum":["webhook","hosted"],"title":"CreateAgentRequestVoiceMode"},"CreateAgentRequestModelTier":{"type":"string","enum":["turbo","balanced","max","realtime","live"],"title":"CreateAgentRequestModelTier"},"CustomToolParamMethod":{"type":"string","enum":["GET","POST"],"description":"HTTP method. Defaults to POST.","title":"CustomToolParamMethod"},"CustomToolParamParameters":{"type":"object","properties":{},"description":"JSON Schema object describing the arguments the agent fills in. Omit for a no-argument tool.","title":"CustomToolParamParameters"},"CustomToolParam":{"type":"object","properties":{"name":{"type":"string","description":"Function name the agent calls. Letters, numbers, underscores, hyphens; max 64 chars. Must be unique and not a reserved built-in name."},"description":{"type":"string","description":"What the tool does and when to use it. The agent relies on this to decide when to call it."},"url":{"type":"string","description":"HTTPS endpoint the voice provider calls when the agent invokes this tool."},"method":{"$ref":"#/components/schemas/CustomToolParamMethod","description":"HTTP method. Defaults to POST."},"headers":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Optional HTTP headers sent with the request (e.g. an Authorization token for your endpoint)."},"parameters":{"oneOf":[{"$ref":"#/components/schemas/CustomToolParamParameters"},{"type":"null"}],"description":"JSON Schema object describing the arguments the agent fills in. Omit for a no-argument tool."},"timeoutMs":{"type":["integer","null"],"minimum":1000,"maximum":120000,"description":"How long to wait for your endpoint before giving up. Range 1000-120000 ms."},"speakDuringExecution":{"type":["boolean","null"],"description":"When true, the agent speaks executionMessage while the tool runs."},"executionMessage":{"type":["string","null"],"description":"What the agent says while the tool runs (used when speakDuringExecution is true)."}},"required":["name","description","url"],"title":"CustomToolParam"},"CreateAgentRequestSttMode":{"type":"string","enum":["fast","accurate"],"description":"Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency).","title":"CreateAgentRequestSttMode"},"CreateAgentRequestAmbientSound":{"type":"string","enum":["none","office","coffee-shop","outdoor"],"description":"Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed.","title":"CreateAgentRequestAmbientSound"},"CreateAgentRequestDenoisingMode":{"type":"string","enum":["noise-cancellation","noise-and-background-speech-cancellation"],"description":"Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs.","title":"CreateAgentRequestDenoisingMode"},"CreateAgentRequestLanguage":{"type":"string","enum":["af-ZA","ar-SA","az-AZ","bg-BG","bs-BA","ca-ES","cs-CZ","cy-GB","da-DK","de-DE","el-GR","en-AU","en-GB","en-IN","en-NZ","en-US","es-419","es-ES","fa-IR","fi-FI","fil-PH","fr-CA","fr-FR","gl-ES","he-IL","hi-IN","hr-HR","hu-HU","hy-AM","id-ID","is-IS","it-IT","ja-JP","kk-KZ","kn-IN","ko-KR","lt-LT","lv-LV","mk-MK","mr-IN","ms-MY","ne-NP","nl-BE","nl-NL","no-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sr-RS","sv-SE","sw-KE","ta-IN","th-TH","tr-TR","uk-UA","ur-IN","vi-VN","yue-CN","zh-CN"],"description":"BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. See the enum for the full set of supported codes.","title":"CreateAgentRequestLanguage"},"CreateAgentRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"voiceMode":{"$ref":"#/components/schemas/CreateAgentRequestVoiceMode"},"enableMessaging":{"type":["boolean","null"],"description":"When true, hosted-mode agents can send and read SMS/iMessage during calls. Defaults to true."},"modelTier":{"$ref":"#/components/schemas/CreateAgentRequestModelTier"},"systemPrompt":{"type":["string","null"],"maxLength":20000},"voicePrompt":{"type":["string","null"],"maxLength":4000,"description":"Live only: speaking identity, public call purpose (who you represent and why you call), style, and verbal rules. The voice model only knows what is written here; it delegates everything else. Required with modelTier live. Business instructions stay in systemPrompt. Omit on PATCH to preserve; null or empty clears when Live is inactive."},"beginMessage":{"type":["string","null"]},"voice":{"type":["string","null"]},"transferNumber":{"type":["string","null"]},"customTools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomToolParam"},"description":"Hosted-mode only. User-defined function tools the agent can call during a call (look up a record, save call notes, etc.). Each points at your HTTPS endpoint; the voice provider invokes it and feeds the JSON response back to the agent. Ignored in webhook mode. Maximum 20 tools."},"voicemailMessage":{"type":["string","null"]},"callScreeningIdentity":{"type":["string","null"]},"callScreeningPurpose":{"type":["string","null"]},"sttMode":{"$ref":"#/components/schemas/CreateAgentRequestSttMode","description":"Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency)."},"ambientSound":{"$ref":"#/components/schemas/CreateAgentRequestAmbientSound","description":"Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed."},"denoisingMode":{"$ref":"#/components/schemas/CreateAgentRequestDenoisingMode","description":"Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs."},"maxSilenceMs":{"type":["integer","null"],"minimum":10000,"maximum":3600000,"description":"Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour)."},"voiceSpeed":{"type":["number","null"],"format":"double","minimum":0.5,"maximum":2,"description":"Voice speed multiplier. 1.0 is normal pace; lower values slow speech (0.5 is half speed), higher values speed it up (2.0 is double). Range 0.5 to 2.0."},"interruptionSensitivity":{"type":["number","null"],"format":"double","minimum":0,"maximum":1,"description":"How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0."},"enableBackchannel":{"type":["boolean","null"],"description":"When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. Defaults to true."},"language":{"$ref":"#/components/schemas/CreateAgentRequestLanguage","description":"BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. See the enum for the full set of supported codes."}},"required":["name"],"title":"CreateAgentRequest"},"DeleteAgentResponse":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"name":{"type":"string"}},"required":["success","id","name"],"title":"DeleteAgentResponse"},"UpdateAgentRequestVoiceMode":{"type":"string","enum":["webhook","hosted"],"title":"UpdateAgentRequestVoiceMode"},"UpdateAgentRequestModelTier":{"type":"string","enum":["turbo","balanced","max","realtime","live"],"title":"UpdateAgentRequestModelTier"},"UpdateAgentRequestSttMode":{"type":"string","enum":["fast","accurate"],"description":"Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency).","title":"UpdateAgentRequestSttMode"},"UpdateAgentRequestAmbientSound":{"type":"string","enum":["none","office","coffee-shop","outdoor"],"description":"Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed.","title":"UpdateAgentRequestAmbientSound"},"UpdateAgentRequestDenoisingMode":{"type":"string","enum":["noise-cancellation","noise-and-background-speech-cancellation"],"description":"Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs.","title":"UpdateAgentRequestDenoisingMode"},"UpdateAgentRequestLanguage":{"type":"string","enum":["af-ZA","ar-SA","az-AZ","bg-BG","bs-BA","ca-ES","cs-CZ","cy-GB","da-DK","de-DE","el-GR","en-AU","en-GB","en-IN","en-NZ","en-US","es-419","es-ES","fa-IR","fi-FI","fil-PH","fr-CA","fr-FR","gl-ES","he-IL","hi-IN","hr-HR","hu-HU","hy-AM","id-ID","is-IS","it-IT","ja-JP","kk-KZ","kn-IN","ko-KR","lt-LT","lv-LV","mk-MK","mr-IN","ms-MY","ne-NP","nl-BE","nl-NL","no-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sr-RS","sv-SE","sw-KE","ta-IN","th-TH","tr-TR","uk-UA","ur-IN","vi-VN","yue-CN","zh-CN"],"description":"BCP-47 locale that drives the agent's speech recognition and pronunciation. See the enum for the full set of supported codes.","title":"UpdateAgentRequestLanguage"},"UpdateAgentRequest":{"type":"object","properties":{"name":{"type":["string","null"]},"description":{"type":["string","null"]},"voiceMode":{"$ref":"#/components/schemas/UpdateAgentRequestVoiceMode"},"enableMessaging":{"type":["boolean","null"],"description":"When true, hosted-mode agents can send and read SMS/iMessage during calls."},"modelTier":{"$ref":"#/components/schemas/UpdateAgentRequestModelTier"},"systemPrompt":{"type":["string","null"],"maxLength":20000},"voicePrompt":{"type":["string","null"],"maxLength":4000,"description":"Live only: speaking identity, public call purpose (who you represent and why you call), style, and verbal rules. The voice model only knows what is written here; it delegates everything else. Required with modelTier live. Business instructions stay in systemPrompt. Omit on PATCH to preserve; null or empty clears when Live is inactive."},"beginMessage":{"type":["string","null"]},"voice":{"type":["string","null"]},"transferNumber":{"type":["string","null"]},"customTools":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomToolParam"},"description":"Hosted-mode only. User-defined function tools the agent can call during a call. Replaces the full set on each update; send [] to clear all tools, or omit to leave unchanged. Ignored in webhook mode. Maximum 20 tools."},"voicemailMessage":{"type":["string","null"]},"callScreeningIdentity":{"type":["string","null"]},"callScreeningPurpose":{"type":["string","null"]},"sttMode":{"$ref":"#/components/schemas/UpdateAgentRequestSttMode","description":"Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency)."},"ambientSound":{"$ref":"#/components/schemas/UpdateAgentRequestAmbientSound","description":"Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed."},"denoisingMode":{"$ref":"#/components/schemas/UpdateAgentRequestDenoisingMode","description":"Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs."},"maxSilenceMs":{"type":["integer","null"],"minimum":10000,"maximum":3600000,"description":"Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour)."},"voiceSpeed":{"type":["number","null"],"format":"double","minimum":0.5,"maximum":2,"description":"Voice speed multiplier. 1.0 is normal pace; lower slows speech (0.5 is half speed), higher speeds it up (2.0 is double). Range 0.5 to 2.0."},"interruptionSensitivity":{"type":["number","null"],"format":"double","minimum":0,"maximum":1,"description":"How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0."},"enableBackchannel":{"type":["boolean","null"],"description":"When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking."},"language":{"$ref":"#/components/schemas/UpdateAgentRequestLanguage","description":"BCP-47 locale that drives the agent's speech recognition and pronunciation. See the enum for the full set of supported codes."}},"title":"UpdateAgentRequest"},"AttachNumberRequest":{"type":"object","properties":{"numberId":{"type":"string"}},"required":["numberId"],"title":"AttachNumberRequest"},"AttachNumberResponse":{"type":"object","properties":{"agentId":{"type":"string"},"number":{"$ref":"#/components/schemas/AgentNumberResponse"}},"required":["agentId","number"],"title":"AttachNumberResponse"},"app__routes__agents__ConversationSummary":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":["string","null"]},"phoneNumberId":{"type":"string"},"phoneNumber":{"type":"string"},"participant":{"type":"string"},"lastMessageAt":{"type":"string","format":"date-time"},"lastMessagePreview":{"type":"string"},"messageCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","agentId","phoneNumberId","phoneNumber","participant","lastMessageAt","lastMessagePreview","messageCount","createdAt"],"title":"app__routes__agents__ConversationSummary"},"app__routes__agents__ConversationListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/app__routes__agents__ConversationSummary"}},"hasMore":{"type":"boolean"},"total":{"type":"integer"}},"required":["data","hasMore","total"],"title":"app__routes__agents__ConversationListResponse"},"CallSummary":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":["string","null"]},"phoneNumberId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"fromNumber":{"type":"string"},"toNumber":{"type":"string"},"direction":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"durationSeconds":{"type":["integer","null"]},"lastTranscriptSnippet":{"type":["string","null"]}},"required":["id","agentId","phoneNumberId","phoneNumber","fromNumber","toNumber","direction","status","startedAt","endedAt","durationSeconds","lastTranscriptSnippet"],"title":"CallSummary"},"CallListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CallSummary"}},"hasMore":{"type":"boolean"},"total":{"type":"integer"}},"required":["data","hasMore","total"],"title":"CallListResponse"},"PhoneNumberResponseOutboundSms":{"type":"string","enum":["enabled","activating","registration_required"],"default":"enabled","description":"Outbound SMS readiness for this exact number: activating means campaign attachment is in progress; enabled means confirmed; registration_required means registration or attachment is still needed. Check the number and registration in the same account/sub-account scope. See /sms-registration.","title":"PhoneNumberResponseOutboundSms"},"DailyNewContactsUsage":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":["integer","null"]}},"required":["used"],"title":"DailyNewContactsUsage"},"PhoneNumberResponse":{"type":"object","properties":{"id":{"type":"string"},"phoneNumber":{"type":"string"},"country":{"type":"string"},"status":{"type":"string"},"type":{"type":"string","default":"sms"},"agentId":{"type":["string","null"]},"outboundSms":{"$ref":"#/components/schemas/PhoneNumberResponseOutboundSms","default":"enabled","description":"Outbound SMS readiness for this exact number: activating means campaign attachment is in progress; enabled means confirmed; registration_required means registration or attachment is still needed. Check the number and registration in the same account/sub-account scope. See /sms-registration."},"inboundCallsEnabled":{"type":"boolean","default":true},"readReceiptsEnabled":{"type":"boolean","default":true},"whatsappEnabled":{"type":"boolean","default":false},"dailyNewContacts":{"oneOf":[{"$ref":"#/components/schemas/DailyNewContactsUsage"},{"type":"null"}]},"externalId":{"type":["string","null"]},"rcsFallbackForAlias":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"purchasedAt":{"type":["string","null"],"format":"date-time"},"renewsAt":{"type":["string","null"],"description":"Scheduled renewal of this number's monthly fee, ISO 8601 UTC. Null when no renewal is scheduled or its date is not known."}},"required":["id","phoneNumber","country","status","createdAt"],"title":"PhoneNumberResponse"},"PhoneNumberListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumberResponse"}},"hasMore":{"type":"boolean"},"total":{"type":"integer"}},"required":["data","hasMore","total"],"title":"PhoneNumberListResponse"},"CreateNumberRequestType":{"type":"string","enum":["sms","imessage"],"title":"CreateNumberRequestType"},"CreateNumberRequestImessageType":{"type":"string","enum":["inbound","outbound"],"title":"CreateNumberRequestImessageType"},"CreateNumberRequest":{"type":"object","properties":{"country":{"type":"string","default":"US"},"areaCode":{"type":["string","null"]},"agentId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"type":{"oneOf":[{"$ref":"#/components/schemas/CreateNumberRequestType"},{"type":"null"}]},"imessageType":{"oneOf":[{"$ref":"#/components/schemas/CreateNumberRequestImessageType"},{"type":"null"}]},"expiresAt":{"type":["string","null"],"format":"date-time"}},"title":"CreateNumberRequest"},"AvailableNumber":{"type":"object","properties":{"phoneNumber":{"type":"string"},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"rateCenter":{"type":["string","null"]},"areaCode":{"type":["string","null"]}},"required":["phoneNumber"],"description":"One purchasable number from GET /v1/numbers/available.\n\nGeography is best-effort: `city`, `state` and `rateCenter` are null when\nthe inventory source doesn't return per-number detail. Only `phoneNumber`\nis guaranteed, and it is the field to pass back to POST /v1/numbers.","title":"AvailableNumber"},"AvailableNumberListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AvailableNumber"}},"widened":{"type":"boolean","default":false}},"required":["data"],"title":"AvailableNumberListResponse"},"NumberLookupEntry":{"type":"object","properties":{"phoneNumber":{"type":"string"},"lineType":{"type":["string","null"]},"country":{"type":["string","null"]},"rcsEnabled":{"type":["boolean","null"]}},"required":["phoneNumber"],"title":"NumberLookupEntry"},"NumberLookupResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NumberLookupEntry"}}},"required":["data"],"title":"NumberLookupResponse"},"UpdateNumberRequest":{"type":"object","properties":{"externalId":{"type":["string","null"]},"expiresAt":{"type":["string","null"],"format":"date-time"}},"description":"PATCH /v1/numbers/{id}. Only the fields you send are changed.\nexternalId is your own identifier for the number, unique within your\naccount, usable in place of our id as `ext:<externalId>` and echoed on\nevery number response and webhook. expiresAt is a hard end date after\nwhich the number is released automatically. For both, a value sets it,\nnull clears it, omitting it leaves it unchanged. Fields this endpoint\ndoes not support are rejected with 422 rather than ignored.","title":"UpdateNumberRequest"},"MessageResponse":{"type":"object","properties":{"id":{"type":"string"},"from_":{"type":"string"},"to":{"type":"string"},"body":{"type":"string"},"direction":{"type":"string"},"channel":{"type":["string","null"]},"status":{"type":["string","null"]},"failureReason":{"type":["string","null"]},"receivedAt":{"type":"string","format":"date-time"}},"required":["id","from_","to","body","direction","receivedAt"],"title":"MessageResponse"},"MessageListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageResponse"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","hasMore"],"title":"MessageListResponse"},"InboundCallsUpdateRequest":{"type":"object","properties":{"enabled":{"type":"boolean","description":"false rejects inbound calls on this number; true answers them again."}},"required":["enabled"],"title":"InboundCallsUpdateRequest"},"InboundCallsResponse":{"type":"object","properties":{"success":{"type":"boolean"},"inboundCallsEnabled":{"type":"boolean"}},"required":["success","inboundCallsEnabled"],"title":"InboundCallsResponse"},"SendMessageRequestChannel":{"type":"string","enum":["whatsapp"],"description":"Optional transport override for numbers connected to multiple channels. Pass \"whatsapp\" to send via the number's WhatsApp connection instead of its default SMS/iMessage transport. WhatsApp-only numbers use WhatsApp automatically.","title":"SendMessageRequestChannel"},"SendMessageRequestSendStyle":{"type":"string","enum":["celebration","fireworks","lasers","love","confetti","balloons","spotlight","echo","invisible","gentle","loud","slam"],"description":"Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam.","title":"SendMessageRequestSendStyle"},"SendMessageRequestList":{"type":"object","properties":{},"description":"WhatsApp only: a tap-to-open list menu. {\"button\": \"View options\", \"options\": [\"Small\", \"Medium\", \"Large\"]} (max 10 options, 24 chars each), or full form with sections: {\"button\": str, \"sections\": [{\"title\": str, \"rows\": [{\"id\": str, \"title\": str, \"description\": str}]}]}.","title":"SendMessageRequestList"},"SendMessageRequestCta":{"type":"object","properties":{},"description":"WhatsApp only: a single tappable link button on an ordinary message. {\"display_text\": \"Track order\", \"url\": \"https://example.com/t/123\", \"footer\": \"Tap to see live status\"} — `footer` is optional. The url must be absolute and https. Unlike a URL button on a template this needs no Meta review, but as an ordinary message it only reaches someone inside the 24h window.","title":"SendMessageRequestCta"},"SendMessageRequestTemplate":{"type":"object","properties":{},"description":"WhatsApp only: send a Meta-approved message template. This is the only way to reach someone outside the 24h customer service window. {\"name\": \"order_shipped\", \"language\": \"en_US\", \"variables\": [\"1234\"]} — `variables` fill the template body, and `header_variables` does the same for a text header. Pass an array for a POSITIONAL template ({{1}}, {{2}}) or an object for a NAMED one, e.g. {\"variables\": {\"first_name\": \"Pablo\"}} for a body reading \"Thanks {{first_name}}!\". The shape must match how the template was authored. `language` defaults to en_US. The template must already be APPROVED (see the templates endpoints). `body` is NOT delivered for template sends — WhatsApp renders the approved template content — it is kept only as a fallback label if we can't render the template for your message history.","title":"SendMessageRequestTemplate"},"SendMessageRequest":{"type":"object","properties":{"agent_id":{"type":["string","null"],"description":"The ID of the agent sending the message. Determines which phone number and provider to use."},"to_number":{"type":["string","null"],"description":"Recipient phone/address or an existing group identifier. Preserve group identifiers returned by the API. Supply to_number or recipients, not both."},"recipients":{"type":["array","null"],"items":{"type":"string"},"description":"Create a new group on a supported number. Use 2–32 distinct recipients on eligible iMessage lines, or 2–10 phone numbers on supported carrier MMS lines. Mutually exclusive with to_number; response to_number is the group address for later sends. Group sends accept at most one attachment. WhatsApp and branded RCS groups are unsupported."},"body":{"type":"string","description":"Message text. Use an empty string for media-only sends. Text plus media is transport-dependent: voice memos, some iMessage carousels, and branded RCS media messages cannot include body text."},"media_url":{"type":["string","null"],"description":"Single public HTTPS attachment URL. Prefer media_urls and do not supply both fields."},"media_urls":{"type":["array","null"],"items":{"type":"string"},"description":"Public HTTPS attachments, 1–20 on eligible transports. WhatsApp and groups accept one. Some iMessage lines reject text alongside multiple images. Native iMessage voice memos require one audio file and an empty body. Branded RCS media sends accept one file and no body text; see [RCS rich cards](/documentation/guides/rcs#rich-cards) for an image with text."},"number_id":{"type":["string","null"],"description":"Select an attached sending number explicitly. When omitted, an eligible number is chosen automatically; attachment order is not a default-number guarantee."},"from_number":{"type":["string","null"]},"channel":{"$ref":"#/components/schemas/SendMessageRequestChannel","description":"Optional transport override for numbers connected to multiple channels. Pass \"whatsapp\" to send via the number's WhatsApp connection instead of its default SMS/iMessage transport. WhatsApp-only numbers use WhatsApp automatically."},"send_style":{"$ref":"#/components/schemas/SendMessageRequestSendStyle","description":"Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam."},"reply_to_message_id":{"type":["string","null"],"description":"Optional parent message ID (AgentPhone Message.id) to send this message as an inline reply. Supported on iMessage and WhatsApp; the parent must be in the same chat and sent from the same number."},"buttons":{"type":["array","null"],"items":{"type":"string"},"description":"WhatsApp only: up to 3 tappable reply buttons (each max 20 chars). The tapped button's text arrives as a normal inbound message. Pass media_urls alongside buttons to render that image, video, or document as a header above the text, in the same bubble as the buttons (audio has no header form and is rejected)."},"list":{"oneOf":[{"$ref":"#/components/schemas/SendMessageRequestList"},{"type":"null"}],"description":"WhatsApp only: a tap-to-open list menu. {\"button\": \"View options\", \"options\": [\"Small\", \"Medium\", \"Large\"]} (max 10 options, 24 chars each), or full form with sections: {\"button\": str, \"sections\": [{\"title\": str, \"rows\": [{\"id\": str, \"title\": str, \"description\": str}]}]}."},"cta":{"oneOf":[{"$ref":"#/components/schemas/SendMessageRequestCta"},{"type":"null"}],"description":"WhatsApp only: a single tappable link button on an ordinary message. {\"display_text\": \"Track order\", \"url\": \"https://example.com/t/123\", \"footer\": \"Tap to see live status\"} — `footer` is optional. The url must be absolute and https. Unlike a URL button on a template this needs no Meta review, but as an ordinary message it only reaches someone inside the 24h window."},"template":{"oneOf":[{"$ref":"#/components/schemas/SendMessageRequestTemplate"},{"type":"null"}],"description":"WhatsApp only: send a Meta-approved message template. This is the only way to reach someone outside the 24h customer service window. {\"name\": \"order_shipped\", \"language\": \"en_US\", \"variables\": [\"1234\"]} — `variables` fill the template body, and `header_variables` does the same for a text header. Pass an array for a POSITIONAL template ({{1}}, {{2}}) or an object for a NAMED one, e.g. {\"variables\": {\"first_name\": \"Pablo\"}} for a body reading \"Thanks {{first_name}}!\". The shape must match how the template was authored. `language` defaults to en_US. The template must already be APPROVED (see the templates endpoints). `body` is NOT delivered for template sends — WhatsApp renders the approved template content — it is kept only as a fallback label if we can't render the template for your message history."}},"required":["body"],"title":"SendMessageRequest"},"SendMessageResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"from_number":{"type":"string"},"to_number":{"type":"string"},"conversation_id":{"type":["string","null"]},"media_urls":{"type":"array","items":{"type":"string"},"default":[]},"reply_to_message_id":{"type":["string","null"]},"reply_parent_unresolved":{"type":["boolean","null"]}},"required":["id","status","channel","from_number","to_number"],"title":"SendMessageResponse"},"SendReactionRequest":{"type":"object","properties":{"reaction":{"type":"string","description":"iMessage reaction to send. Classic tapbacks (love, like, dislike, laugh, emphasize, question) are supported on every iMessage line. Custom emoji reactions (e.g. \"🔥\", \"😂\", \"👍\") are supported on newer lines only; lines that don't support them return a 400 with upgrade instructions. Custom emoji also require the recipient to be on macOS 14 / iOS 17 or later."}},"required":["reaction"],"title":"SendReactionRequest"},"SendReactionResponse":{"type":"object","properties":{"id":{"type":"string"},"reaction_type":{"type":"string"},"message_id":{"type":"string"},"channel":{"type":"string"}},"required":["id","reaction_type","message_id","channel"],"title":"SendReactionResponse"},"GroupParticipant":{"type":"object","properties":{"identifier":{"type":"string"},"name":{"type":["string","null"]}},"required":["identifier"],"description":"A member of a group chat, mirrored from Conversation.participants.","title":"GroupParticipant"},"AppRoutesConversationsConversationSummaryMetadata":{"type":"object","properties":{},"title":"AppRoutesConversationsConversationSummaryMetadata"},"app__routes__conversations__ConversationSummary":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":["string","null"]},"phoneNumberId":{"type":"string"},"phoneNumber":{"type":"string"},"participant":{"type":"string"},"channel":{"type":"string","default":"native"},"isGroup":{"type":"boolean","default":false},"groupId":{"type":["string","null"]},"groupName":{"type":["string","null"]},"groupIconUrl":{"type":["string","null"]},"participants":{"type":["array","null"],"items":{"$ref":"#/components/schemas/GroupParticipant"}},"lastMessageAt":{"type":"string","format":"date-time"},"lastMessagePreview":{"type":"string"},"messageCount":{"type":"integer"},"metadata":{"oneOf":[{"$ref":"#/components/schemas/AppRoutesConversationsConversationSummaryMetadata"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","phoneNumberId","phoneNumber","participant","lastMessageAt","lastMessagePreview","messageCount","createdAt"],"title":"app__routes__conversations__ConversationSummary"},"app__routes__conversations__ConversationListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/app__routes__conversations__ConversationSummary"}},"hasMore":{"type":"boolean"},"total":{"type":"integer","description":"Total conversations for this account; may be up to a few minutes old (cached per account, default five minutes). Use hasMore for pagination."}},"required":["data","hasMore","total"],"title":"app__routes__conversations__ConversationListResponse"},"ConversationDetailMetadata":{"type":"object","properties":{},"title":"ConversationDetailMetadata"},"MessageInConversationContent":{"type":"object","properties":{},"title":"MessageInConversationContent"},"ReactionInConversation":{"type":"object","properties":{"id":{"type":"string"},"reactionType":{"type":"string"},"fromNumber":{"type":"string"},"direction":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","reactionType","fromNumber","direction","createdAt"],"title":"ReactionInConversation"},"ReplyToInConversation":{"type":"object","properties":{"messageId":{"type":"string"},"message":{"type":"string"},"mediaUrls":{"type":"array","items":{"type":"string"},"default":[]}},"required":["messageId","message"],"title":"ReplyToInConversation"},"MessageInConversation":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"fromNumber":{"type":"string"},"toNumber":{"type":"string"},"direction":{"type":"string"},"senderIdentifier":{"type":["string","null"]},"channel":{"type":["string","null"]},"status":{"type":["string","null"]},"failureReason":{"type":["string","null"]},"errorCode":{"type":["string","null"]},"deliveredAt":{"type":["string","null"],"format":"date-time"},"deliveredChannel":{"type":["string","null"]},"readAt":{"type":["string","null"],"format":"date-time"},"mediaUrl":{"type":["string","null"]},"mediaUrls":{"type":"array","items":{"type":"string"},"default":[]},"receivedAt":{"type":"string","format":"date-time"},"content":{"oneOf":[{"$ref":"#/components/schemas/MessageInConversationContent"},{"type":"null"}]},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/ReactionInConversation"},"default":[]},"replyTo":{"oneOf":[{"$ref":"#/components/schemas/ReplyToInConversation"},{"type":"null"}]}},"required":["id","body","fromNumber","toNumber","direction","receivedAt"],"title":"MessageInConversation"},"ConversationCapabilities":{"type":"object","properties":{"canSendMessages":{"type":"boolean"},"sendDisabledReason":{"type":["string","null"]},"sendChannel":{"type":["string","null"]},"availableChannels":{"type":"array","items":{"type":"string"},"default":[]},"mediaChannels":{"type":"array","items":{"type":"string"},"default":[]},"whatsappWindowExpiresAt":{"type":["string","null"],"format":"date-time"},"media":{"type":"boolean"},"reactions":{"type":"boolean"},"emojiReactions":{"type":"boolean"}},"required":["canSendMessages","media","reactions","emojiReactions"],"description":"What the caller can do in this conversation, derived from its number's\nprovider and compliance state. Drives the dashboard composer/reaction UI.","title":"ConversationCapabilities"},"ConversationDetail":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":["string","null"]},"phoneNumberId":{"type":"string"},"phoneNumber":{"type":"string"},"participant":{"type":"string"},"channel":{"type":"string","default":"native"},"isGroup":{"type":"boolean","default":false},"groupId":{"type":["string","null"]},"groupName":{"type":["string","null"]},"groupIconUrl":{"type":["string","null"]},"participants":{"type":["array","null"],"items":{"$ref":"#/components/schemas/GroupParticipant"}},"lastMessageAt":{"type":"string","format":"date-time"},"messageCount":{"type":"integer"},"metadata":{"oneOf":[{"$ref":"#/components/schemas/ConversationDetailMetadata"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageInConversation"}},"capabilities":{"oneOf":[{"$ref":"#/components/schemas/ConversationCapabilities"},{"type":"null"}]}},"required":["id","phoneNumberId","phoneNumber","participant","lastMessageAt","messageCount","createdAt","messages"],"title":"ConversationDetail"},"UpdateConversationRequestMetadata":{"type":"object","properties":{},"title":"UpdateConversationRequestMetadata"},"UpdateConversationRequest":{"type":"object","properties":{"metadata":{"oneOf":[{"$ref":"#/components/schemas/UpdateConversationRequestMetadata"},{"type":"null"}]},"group_name":{"type":["string","null"],"description":"New display name for a group conversation. iMessage groups only; also renames the underlying iMessage thread. Ignored (omit) for 1:1 chats."}},"description":"Request body for updating a conversation.","title":"UpdateConversationRequest"},"MessagesListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageInConversation"}},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"]}},"required":["data","hasMore"],"title":"MessagesListResponse"},"SendTypingResponse":{"type":"object","properties":{"conversationId":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string"}},"required":["conversationId","channel","status"],"title":"SendTypingResponse"},"SetBackgroundRequest":{"type":"object","properties":{"image_url":{"type":"string","description":"HTTPS URL of the background image. JPEG/PNG/GIF/WebP/HEIC, max 10MB. Recipients on iOS < 18 see the default background; no error is raised."}},"required":["image_url"],"title":"SetBackgroundRequest"},"SetBackgroundResponse":{"type":"object","properties":{"conversationId":{"type":"string"},"channel":{"type":"string"},"hasBackground":{"type":"boolean"},"backgroundId":{"type":["string","null"]},"backgroundVersion":{"type":["integer","null"]},"changed":{"type":"boolean"}},"required":["conversationId","channel","hasBackground","changed"],"title":"SetBackgroundResponse"},"ContactResponse":{"type":"object","properties":{"id":{"type":"string"},"phoneNumber":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"notes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","phoneNumber","name","createdAt","updatedAt"],"title":"ContactResponse"},"ContactListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContactResponse"}},"hasMore":{"type":"boolean"},"total":{"type":"integer"}},"required":["data","hasMore","total"],"title":"ContactListResponse"},"CreateContactRequest":{"type":"object","properties":{"phoneNumber":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"notes":{"type":["string","null"]}},"required":["phoneNumber","name"],"title":"CreateContactRequest"},"ContactCapabilityFlags":{"type":"object","properties":{"imessage":{"type":["boolean","null"]},"sms":{"type":["boolean","null"]},"rcs":{"type":["boolean","null"]}},"title":"ContactCapabilityFlags"},"ContactCapabilitiesResponse":{"type":"object","properties":{"phoneNumber":{"type":"string"},"capabilities":{"$ref":"#/components/schemas/ContactCapabilityFlags"},"checkedAt":{"type":"string","format":"date-time"}},"required":["phoneNumber","capabilities","checkedAt"],"title":"ContactCapabilitiesResponse"},"UpdateContactRequest":{"type":"object","properties":{"phoneNumber":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"notes":{"type":["string","null"]}},"title":"UpdateContactRequest"},"RegistrationIssue":{"type":"object","properties":{"code":{"type":"string","description":"Why the registration needs attention. One of `brand_name_ein_mismatch`, `opt_in_evidence_required`, `campaign_rejected`, `campaign_suspended`, `other`."},"message":{"type":"string","description":"What to fix, in plain language."},"since":{"type":["string","null"],"description":"When the issue was raised (ISO 8601)."}},"required":["code","message"],"title":"RegistrationIssue"},"CampaignStatusResponse":{"type":"object","properties":{"campaign_status":{"type":"string"},"message":{"type":"string"},"stage":{"type":["string","null"]},"issue":{"oneOf":[{"$ref":"#/components/schemas/RegistrationIssue"},{"type":"null"}],"description":"Set when `stage` is `action_required`: the reason and what to change. For a registration under review, resubmitting with PATCH /v1/register clears it. A registration that failed carrier review (`campaign_status` back to `none`) is resubmitted with POST /v1/register; a suspended one needs support."},"sub_account_id":{"type":["string","null"],"description":"Set when the registration lives on a sub-account of the calling account (the default for POST /v1/register). Pass it as the X-Sub-Account-Id header to address that sub-account directly."}},"required":["campaign_status","message"],"title":"CampaignStatusResponse"},"RegistrationBrandDetail":{"type":"object","properties":{"business_name":{"type":["string","null"]},"website_url":{"type":["string","null"]},"industry":{"type":["string","null"]},"entity_type":{"type":["string","null"]},"ein":{"type":["string","null"],"description":"The EIN / Tax ID as submitted."},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"street_address":{"type":["string","null"]},"street_address_2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip_code":{"type":["string","null"]},"country":{"type":["string","null"]}},"title":"RegistrationBrandDetail"},"RegistrationCampaignDetail":{"type":"object","properties":{"use_case":{"type":["string","null"]},"description":{"type":["string","null"]},"message_samples":{"type":"array","items":{"type":"string"},"default":[]},"consent_flow":{"type":["string","null"]},"opt_in_image_url":{"type":["string","null"]},"includes":{"type":"array","items":{"type":"string"},"default":[],"description":"Content types detected in the submitted samples, e.g. 'links', 'phone_numbers'."}},"title":"RegistrationCampaignDetail"},"RegistrationDetailResponse":{"type":"object","properties":{"campaign_status":{"type":"string"},"stage":{"type":["string","null"]},"issue":{"oneOf":[{"$ref":"#/components/schemas/RegistrationIssue"},{"type":"null"}],"description":"Set when `stage` is `action_required`: the reason and what to change."},"sub_account_id":{"type":["string","null"],"description":"Set when the registration lives on a sub-account of the calling account."},"brand":{"oneOf":[{"$ref":"#/components/schemas/RegistrationBrandDetail"},{"type":"null"}]},"campaign":{"oneOf":[{"$ref":"#/components/schemas/RegistrationCampaignDetail"},{"type":"null"}]}},"required":["campaign_status"],"title":"RegistrationDetailResponse"},"RegistrationRequestRegistrationType":{"type":"string","enum":["sole_proprietor","standard_brand","high_volume"],"description":"`sole_proprietor` (\\$25) for individuals without an EIN, `standard_brand` (\\$25) for EIN businesses with lighter volume, or `high_volume` (\\$70) for EIN businesses sending at scale with third-party brand vetting.","title":"RegistrationRequestRegistrationType"},"OrganizationType":{"type":"string","enum":["sole_proprietor","private_corporation","public_corporation","llc","partnership","non_profit","co_op","government"],"title":"OrganizationType"},"ContactTitle":{"type":"string","enum":["ceo","cfo","cto","coo","vp","gm","director","other"],"title":"ContactTitle"},"UseCase":{"type":"string","enum":["account_notification","customer_care","delivery_notification","fraud_alert","higher_education","marketing","polling_voting","public_service_announcement","security_alert","two_factor_authentication"],"title":"UseCase"},"Volume":{"type":"string","enum":["low","high"],"title":"Volume"},"CampaignInclude":{"type":"string","enum":["links","phone_numbers","age_gated","direct_lending"],"title":"CampaignInclude"},"RegistrationRequest":{"type":"object","properties":{"registration_type":{"$ref":"#/components/schemas/RegistrationRequestRegistrationType","description":"`sole_proprietor` (\\$25) for individuals without an EIN, `standard_brand` (\\$25) for EIN businesses with lighter volume, or `high_volume` (\\$70) for EIN businesses sending at scale with third-party brand vetting."},"first_name":{"type":"string","description":"Your first name (or business contact's first name)."},"last_name":{"type":"string","description":"Your last name (or business contact's last name)."},"email":{"type":"string","description":"Contact email address."},"phone_number":{"type":"string","description":"Contact phone number in E.164 format (e.g. `+15551234567`)."},"business_name":{"type":["string","null"],"description":"Legal/registered business name. Required for `standard_brand` and `high_volume`."},"brand_name":{"type":["string","null"],"description":"Public-facing brand name if different from `business_name`."},"organization_type":{"oneOf":[{"$ref":"#/components/schemas/OrganizationType"},{"type":"null"}],"description":"Business structure: `sole_proprietor`, `private_corporation`, `public_corporation`, `llc`, `partnership`, `non_profit`, `co_op`, `government`. Required for `standard_brand` and `high_volume`."},"contact_title":{"oneOf":[{"$ref":"#/components/schemas/ContactTitle"},{"type":"null"}],"description":"Your role: `ceo`, `cfo`, `cto`, `coo`, `vp`, `gm`, `director`, `other`. Required for `standard_brand` and `high_volume`."},"contact_title_other":{"type":["string","null"],"description":"Custom title when `contact_title` is `other`."},"ein":{"type":["string","null"],"description":"EIN / Tax ID number. Required for `standard_brand` and `high_volume`."},"website_url":{"type":["string","null"],"description":"Business website URL."},"industry":{"type":["string","null"],"description":"Industry category (e.g. `technology`, `real_estate`, `retail`, `healthcare`)."},"business_regions":{"type":"array","items":{"type":"string"},"default":["usa_and_canada"],"description":"Regions where the business operates. Defaults to `[\"usa_and_canada\"]`."},"street_address":{"type":"string","description":"Street address of the individual or business."},"street_address_2":{"type":["string","null"]},"city":{"type":"string","description":"City of the individual or business."},"state":{"type":"string","description":"US state abbreviation (e.g. `CA`, `NY`)."},"zip_code":{"type":"string","description":"ZIP code (e.g. `94105`)."},"country":{"type":"string","default":"US","description":"Country code for the registration address. See the request schema and registration form for accepted values."},"planned_numbers":{"type":"integer","default":1,"description":"Number of phone numbers you plan to use. Defaults to `1`. `sole_proprietor` campaigns are limited to 1 number."},"description":{"type":"string","minLength":40,"maxLength":4096,"description":"What your business does, who you message, and what types of messages you send. 40-4096 characters."},"use_cases":{"type":"array","items":{"$ref":"#/components/schemas/UseCase"},"description":"1-5 specific use cases: `customer_care`, `account_notification`, `delivery_notification`, `fraud_alert`, `higher_education`, `marketing`, `polling_voting`, `public_service_announcement`, `security_alert`, `two_factor_authentication`."},"volume":{"$ref":"#/components/schemas/Volume","default":"low","description":"Expected message volume: `low` (default) or `high`."},"message_samples":{"type":"array","items":{"type":"string"},"description":"2-5 example messages you would send. Each 20-1024 chars, include your brand name. Include opt-out language like 'Reply STOP to unsubscribe' in at least one."},"consent_flow":{"type":"string","minLength":40,"maxLength":4096,"description":"How users opt in to receive messages. 40-4096 characters."},"privacy_policy_url":{"type":["string","null"],"description":"URL to your privacy policy. Required for `standard_brand` and `high_volume`."},"terms_of_service_url":{"type":["string","null"],"description":"URL to your terms of service. Required for `standard_brand` and `high_volume`."},"opt_in_image_url":{"type":"string","description":"Publicly accessible HTTPS URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB). Google Drive sharing links are supported."},"includes":{"type":"array","items":{"$ref":"#/components/schemas/CampaignInclude"},"default":[],"description":"Content types in messages: `links`, `phone_numbers`, `age_gated`, `direct_lending`. Defaults to `[]`."},"link_sample":{"type":["string","null"],"maxLength":255,"description":"Example URL if messages contain links. Max 255 characters."},"create_sub_account":{"type":"boolean","default":true,"description":"Create a dedicated sub-account for this campaign. Defaults to `true`. Set `false` to register on your main account."}},"required":["registration_type","first_name","last_name","email","phone_number","street_address","city","state","zip_code","description","use_cases","message_samples","consent_flow","opt_in_image_url"],"title":"RegistrationRequest"},"RegistrationResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"campaign_status":{"type":"string"},"sub_account_id":{"type":["string","null"]},"fee_cents":{"type":"integer"}},"required":["ok","message","campaign_status","fee_cents"],"title":"RegistrationResponse"},"RegistrationUpdateRequest":{"type":"object","properties":{"first_name":{"type":["string","null"],"description":"Contact first name."},"last_name":{"type":["string","null"],"description":"Contact last name."},"email":{"type":["string","null"],"description":"Contact email address."},"phone_number":{"type":["string","null"],"description":"E.164 format, e.g. +15551234567"},"business_name":{"type":["string","null"],"description":"Legal/registered business name."},"brand_name":{"type":["string","null"],"description":"Public-facing brand name if different from business_name."},"organization_type":{"oneOf":[{"$ref":"#/components/schemas/OrganizationType"},{"type":"null"}],"description":"Organization type."},"contact_title":{"oneOf":[{"$ref":"#/components/schemas/ContactTitle"},{"type":"null"}],"description":"Your role."},"contact_title_other":{"type":["string","null"],"description":"Custom title when contact_title is 'other'."},"ein":{"type":["string","null"],"description":"EIN / Tax ID."},"website_url":{"type":["string","null"]},"industry":{"type":["string","null"],"description":"e.g. technology, real_estate, retail, healthcare"},"business_regions":{"type":["array","null"],"items":{"type":"string"},"description":"e.g. ['usa_and_canada']"},"street_address":{"type":["string","null"],"description":"Street address line 1."},"street_address_2":{"type":["string","null"],"description":"Street address line 2 (suite, unit, etc.)."},"city":{"type":["string","null"],"description":"City."},"state":{"type":["string","null"],"description":"State/region code."},"zip_code":{"type":["string","null"],"description":"Postal/ZIP code."},"country":{"type":["string","null"],"description":"Country code, e.g. US."},"description":{"type":["string","null"],"minLength":40,"maxLength":4096,"description":"What your business does, who you message, and what types of messages you send. Min 40 chars."},"use_cases":{"type":["array","null"],"items":{"$ref":"#/components/schemas/UseCase"},"description":"1-5 specific use cases for your SMS campaign."},"volume":{"oneOf":[{"$ref":"#/components/schemas/Volume"},{"type":"null"}],"description":"Expected message volume."},"message_samples":{"type":["array","null"],"items":{"type":"string"},"description":"2-5 example messages. Each must be 20-1024 chars and include your brand name."},"consent_flow":{"type":["string","null"],"minLength":40,"maxLength":4096,"description":"How users opt in to receive messages. Min 40 chars."},"privacy_policy_url":{"type":["string","null"]},"terms_of_service_url":{"type":["string","null"]},"opt_in_image_url":{"type":["string","null"],"description":"Publicly accessible URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB)"},"includes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CampaignInclude"},"description":"Content types included in messages."},"link_sample":{"type":["string","null"],"maxLength":255,"description":"Example URL if messages contain links."}},"description":"Partial update to an existing registration. Every field is optional;\nprovide only what changed. No fee — updates go through review before\ntaking effect.","title":"RegistrationUpdateRequest"},"RegistrationUpdateResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"message":{"type":"string"},"campaign_status":{"type":"string"},"updated_fields":{"type":"array","items":{"type":"string"}},"sub_account_id":{"type":["string","null"],"description":"Set when the update was applied to a registration on a sub-account of the calling account (the default for POST /v1/register)."}},"required":["ok","message","campaign_status","updated_fields"],"title":"RegistrationUpdateResponse"},"CreateOutboundCallRequestModelTier":{"type":"string","enum":["turbo","balanced","max","realtime","live"],"description":"Optional model tier override for this call's built-in conversation. Only applies when ``systemPrompt`` is provided; defaults to the agent's configured modelTier.","title":"CreateOutboundCallRequestModelTier"},"CreateOutboundCallRequest":{"type":"object","properties":{"agentId":{"type":"string","description":"Agent ID to make the call from"},"toNumber":{"type":"string","description":"Phone number to call (E.164 format)"},"fromNumberId":{"type":["string","null"],"description":"Optional phone number ID to use as caller ID. Must belong to the agent. If omitted, the agent's first assigned number is used."},"initialGreeting":{"type":["string","null"],"description":"Optional initial greeting to speak when recipient answers. Pass an empty string to have the agent stay silent and wait for the recipient to speak first."},"voice":{"type":["string","null"],"description":"Voice ID override for this call (uses agent's configured voice if omitted)"},"systemPrompt":{"type":["string","null"],"description":"When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic."},"modelTier":{"$ref":"#/components/schemas/CreateOutboundCallRequestModelTier","description":"Optional model tier override for this call's built-in conversation. Only applies when ``systemPrompt`` is provided; defaults to the agent's configured modelTier."},"variables":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and initial greeting at call time. Requires either ``systemPrompt`` or a hosted-mode agent."},"callScreeningIdentity":{"type":["string","null"],"description":"For outbound calls that hit an automated call screener (e.g. iOS 26 Call Screening or Android Call Screen): the identity the agent gives when asked who is calling. Overrides the agent's stored default for this call. Both identity and purpose are required to enable screening; if only a purpose is set, the agent's name is used."},"callScreeningPurpose":{"type":["string","null"],"description":"For outbound calls that hit an automated call screener: the purpose the agent gives when asked why it is calling. Overrides the agent's stored default for this call."},"disableRecording":{"type":"boolean","default":false,"description":"When true, no audio recording is stored for this call. The transcript is still captured and available via the transcript endpoints and the agent.call_ended webhook. Useful for calls where a party has not consented to being recorded (e.g. two-party consent states)."}},"required":["agentId","toNumber"],"description":"Request model for creating an outbound call.","title":"CreateOutboundCallRequest"},"CreateWebCallRequestMetadata":{"type":"object","properties":{},"description":"Optional metadata to attach to the call","title":"CreateWebCallRequestMetadata"},"CreateWebCallRequest":{"type":"object","properties":{"agentId":{"type":"string","description":"Agent ID to start the web call with"},"metadata":{"oneOf":[{"$ref":"#/components/schemas/CreateWebCallRequestMetadata"},{"type":"null"}],"description":"Optional metadata to attach to the call"},"variables":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and begin message at call time. Requires a hosted-mode agent."}},"required":["agentId"],"description":"Request model for creating a browser-based web call.","title":"CreateWebCallRequest"},"TranscriptTurnRole":{"type":"string","enum":["user","agent"],"title":"TranscriptTurnRole"},"TranscriptTurn":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/TranscriptTurnRole"},"content":{"type":"string","minLength":1}},"required":["role","content"],"title":"TranscriptTurn"},"PushTranscriptRequest":{"type":"object","properties":{"turns":{"type":"array","items":{"$ref":"#/components/schemas/TranscriptTurn"}}},"required":["turns"],"title":"PushTranscriptRequest"},"OriginationUri":{"type":"object","properties":{"name":{"type":"string","default":""},"sip_uri":{"type":"string"},"priority":{"type":"integer","default":10},"weight":{"type":"integer","default":10}},"required":["sip_uri"],"title":"OriginationUri"},"AllowedIp":{"type":"object","properties":{"name":{"type":"string","default":""},"cidr":{"type":"string"}},"required":["cidr"],"title":"AllowedIp"},"SipTrunkCredential":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":["string","null"]},"passwordLast4":{"type":["string","null"]},"credentialListName":{"type":["string","null"]}},"required":["username"],"title":"SipTrunkCredential"},"SipTrunkResponse":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"encrypted":{"type":"boolean"},"transport":{"type":"string"},"mediaEncryption":{"type":"string"},"transfers":{"type":"string"},"transferCallerId":{"type":"string"},"terminationSipUri":{"type":"string"},"originationUris":{"type":"array","items":{"$ref":"#/components/schemas/OriginationUri"}},"allowedIps":{"type":"array","items":{"$ref":"#/components/schemas/AllowedIp"}},"proxyIps":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"credentials":{"type":["array","null"],"items":{"$ref":"#/components/schemas/SipTrunkCredential"}}},"required":["id","name","provider","encrypted","transport","mediaEncryption","transfers","transferCallerId","terminationSipUri","createdAt"],"title":"SipTrunkResponse"},"SipTrunkListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SipTrunkResponse"}}},"required":["data"],"title":"SipTrunkListResponse"},"SipTrunkDeleteResponse":{"type":"object","properties":{"status":{"type":"string"},"id":{"type":"string"}},"required":["status","id"],"title":"SipTrunkDeleteResponse"},"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaTransfers":{"type":"string","enum":["all","sip","none"],"description":"Which transfers the trunk allows.","title":"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaTransfers"},"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaTransferCallerId":{"type":"string","enum":["transferee","transferor"],"description":"Caller ID presented on a transferred leg.","title":"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaTransferCallerId"},"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOriginationUrisItems":{"type":"object","properties":{"sip_uri":{"type":"string","description":"Destination SIP URI, e.g. sip:host.example.com or sip:host;transport=tls."},"name":{"type":"string","description":"Optional label."},"priority":{"type":["integer","null"],"minimum":0,"maximum":65535,"default":10},"weight":{"type":["integer","null"],"minimum":0,"maximum":65535,"default":10}},"required":["sip_uri"],"title":"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOriginationUrisItems"},"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOrigination":{"type":"object","properties":{"uris":{"type":"array","items":{"$ref":"#/components/schemas/V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOriginationUrisItems"},"description":"Empty or omitted clears the origination URIs (only allowed when no numbers are attached)."}},"description":"Where inbound calls to this trunk are delivered.","title":"V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOrigination"},"WebhookResponse":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"secret":{"type":"string"},"status":{"type":"string"},"contextLimit":{"type":"integer"},"timeout":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","url","secret","status","contextLimit","timeout","createdAt"],"title":"WebhookResponse"},"WebhookCreateRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","minLength":1,"maxLength":2083},"contextLimit":{"type":["integer","null"]},"timeout":{"type":["integer","null"]}},"required":["url"],"title":"WebhookCreateRequest"},"WebhookDeliveryResponse":{"type":"object","properties":{"id":{"type":"string"},"messageId":{"type":["string","null"]},"eventType":{"type":["string","null"]},"channel":{"type":["string","null"]},"status":{"type":"string"},"httpStatus":{"type":["integer","null"]},"errorMessage":{"type":["string","null"]},"responseBody":{"type":["string","null"]},"attemptCount":{"type":"integer"},"lastAttemptAt":{"type":["string","null"],"format":"date-time"},"nextRetryAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","messageId","eventType","channel","status","httpStatus","errorMessage","responseBody","attemptCount","lastAttemptAt","nextRetryAt","createdAt"],"title":"WebhookDeliveryResponse"},"PaginatedDeliveriesResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryResponse"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}},"required":["items","total","offset","limit"],"title":"PaginatedDeliveriesResponse"},"WebhookDeliveryStatsResponseByHourItems":{"type":"object","properties":{},"title":"WebhookDeliveryStatsResponseByHourItems"},"WebhookDeliveryStatsResponse":{"type":"object","properties":{"total":{"type":"integer"},"success":{"type":"integer"},"failed":{"type":"integer"},"pending":{"type":"integer"},"successRate":{"type":"number","format":"double"},"byEventType":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"integer"}}},"byHour":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryStatsResponseByHourItems"}}},"required":["total","success","failed","pending","successRate","byEventType","byHour"],"title":"WebhookDeliveryStatsResponse"},"AllTimeStatsResponse":{"type":"object","properties":{"total":{"type":"integer"},"success":{"type":"integer"},"failed":{"type":"integer"},"successRate":{"type":"number","format":"double"}},"required":["total","success","failed","successRate"],"title":"AllTimeStatsResponse"},"TestWebhookRequestChannel":{"type":"string","enum":["sms","imessage","mms","whatsapp","rcs"],"description":"Channel to report in the payload (default sms)","title":"TestWebhookRequestChannel"},"TestWebhookRequest":{"type":"object","properties":{"from":{"type":["string","null"],"description":"Sender number, E.164"},"to":{"type":["string","null"],"description":"Recipient number, E.164"},"message":{"type":["string","null"],"maxLength":1600,"description":"Message text"},"channel":{"oneOf":[{"$ref":"#/components/schemas/TestWebhookRequestChannel"},{"type":"null"}],"description":"Channel to report in the payload (default sms)"}},"description":"Optional overrides for the synthetic agent.message a test delivery carries.\n\nEverything is optional and defaults to the historical sample values, so a\nbare POST behaves exactly as before. Overrides let a handler that routes on\n`to` / `from` (one webhook serving many sub-accounts) exercise its real\npath without buying a number first. The event only ever goes to the\ncalling account's own configured webhook, so `to` is just a string here.","title":"TestWebhookRequest"},"NumberLimits":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"},"remaining":{"type":"integer"}},"required":["used","limit","remaining"],"title":"NumberLimits"},"UsageStats":{"type":"object","properties":{"totalMessages":{"type":"integer"},"messagesLast24h":{"type":"integer"},"messagesLast7d":{"type":"integer"},"messagesLast30d":{"type":"integer"},"smsSegmentsLast30d":{"type":"integer","default":0},"totalCalls":{"type":"integer"},"callsLast24h":{"type":"integer"},"callsLast7d":{"type":"integer"},"callsLast30d":{"type":"integer"},"totalWebhookDeliveries":{"type":"integer"},"successfulWebhookDeliveries":{"type":"integer"},"failedWebhookDeliveries":{"type":"integer"}},"required":["totalMessages","messagesLast24h","messagesLast7d","messagesLast30d","totalCalls","callsLast24h","callsLast7d","callsLast30d","totalWebhookDeliveries","successfulWebhookDeliveries","failedWebhookDeliveries"],"title":"UsageStats"},"UsageResponse":{"type":"object","properties":{"reportGeneratedAt":{"type":"string"},"numbers":{"$ref":"#/components/schemas/NumberLimits"},"stats":{"$ref":"#/components/schemas/UsageStats"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}},"required":["reportGeneratedAt","numbers","stats","periodStart","periodEnd"],"title":"UsageResponse"},"DailyUsagePoint":{"type":"object","properties":{"date":{"type":"string"},"messages":{"type":"integer"},"calls":{"type":"integer"},"webhooks":{"type":"integer"}},"required":["date","messages","calls","webhooks"],"title":"DailyUsagePoint"},"DailyUsageResponse":{"type":"object","properties":{"reportGeneratedAt":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DailyUsagePoint"}},"days":{"type":"integer"}},"required":["reportGeneratedAt","data","days"],"title":"DailyUsageResponse"},"MonthlyUsagePoint":{"type":"object","properties":{"month":{"type":"string"},"messages":{"type":"integer"},"calls":{"type":"integer"},"webhooks":{"type":"integer"}},"required":["month","messages","calls","webhooks"],"title":"MonthlyUsagePoint"},"MonthlyUsageResponse":{"type":"object","properties":{"reportGeneratedAt":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/MonthlyUsagePoint"}},"months":{"type":"integer"}},"required":["reportGeneratedAt","data","months"],"title":"MonthlyUsageResponse"},"NumberUsageItem":{"type":"object","properties":{"numberId":{"type":"string"},"phoneNumber":{"type":"string"},"country":{"type":"string"},"status":{"type":"string"},"agentId":{"type":["string","null"]},"agentName":{"type":["string","null"]},"messages":{"type":"integer"},"calls":{"type":"integer"}},"required":["numberId","phoneNumber","country","status","messages","calls"],"title":"NumberUsageItem"},"NumberUsageResponse":{"type":"object","properties":{"reportGeneratedAt":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/NumberUsageItem"}}},"required":["reportGeneratedAt","data"],"title":"NumberUsageResponse"},"V1UsageByAgentGetParametersPeriod":{"type":"string","enum":["week","month","year"],"title":"V1UsageByAgentGetParametersPeriod"},"AgentUsageItem":{"type":"object","properties":{"agentId":{"type":["string","null"]},"agentName":{"type":"string"},"messages":{"type":"integer"},"calls":{"type":"integer"},"totalSeconds":{"type":"integer"},"isOrphan":{"type":"boolean","default":false}},"required":["agentId","agentName","messages","calls","totalSeconds"],"title":"AgentUsageItem"},"AgentUsageResponse":{"type":"object","properties":{"reportGeneratedAt":{"type":"string"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentUsageItem"}},"period":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}},"required":["reportGeneratedAt","data","period","periodStart","periodEnd"],"title":"AgentUsageResponse"},"WhatsAppConnectRequest":{"type":"object","properties":{"code":{"type":"string","minLength":1,"description":"Exchangeable token code from Embedded Signup"},"waba_id":{"type":["string","null"],"description":"Customer WABA ID from the ES message event. Optional: when the browser handoff is blocked we discover it from the exchanged token."},"phone_number_id":{"type":["string","null"],"description":"Customer business phone number ID (absent for WABA-only signups)"},"business_id":{"type":["string","null"],"description":"Customer business portfolio ID"},"agent_id":{"type":["string","null"],"description":"Optional agent to attach the number to"}},"required":["code"],"title":"WhatsAppConnectRequest"},"WhatsAppNumberConnectRequest":{"type":"object","properties":{"phone_number_id":{"type":"string","minLength":1,"description":"Meta phone_number_id of a number on this WABA"},"agent_id":{"type":["string","null"],"description":"Optional agent to attach the number to"}},"required":["phone_number_id"],"title":"WhatsAppNumberConnectRequest"},"WhatsAppTemplateCreateRequestComponentsItems":{"type":"object","properties":{},"title":"WhatsAppTemplateCreateRequestComponentsItems"},"WhatsAppTemplateCreateRequestLibraryTemplateButtonInputsItems":{"type":"object","properties":{},"title":"WhatsAppTemplateCreateRequestLibraryTemplateButtonInputsItems"},"WhatsAppTemplateCreateRequestLibraryTemplateBodyInputs":{"type":"object","properties":{},"description":"Library templates only: toggles the optional body lines a library entry offers. {\"add_contact_number\", \"add_learn_more_link\", \"add_security_recommendation\", \"add_track_package_link\", \"code_expiration_minutes\"}.","title":"WhatsAppTemplateCreateRequestLibraryTemplateBodyInputs"},"WhatsAppTemplateCreateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"description":"Template name. Meta requires lowercase letters, digits and underscores, and it must be unique on the WABA."},"language":{"type":"string","minLength":2,"default":"en_US","description":"Meta language code, e.g. en_US or es_MX."},"category":{"type":"string","description":"MARKETING, UTILITY, or AUTHENTICATION. Meta may recategorize based on the content."},"parameter_format":{"type":["string","null"],"description":"How the body's placeholders are written: POSITIONAL for {{1}}, {{2}} or NAMED for {{first_name}}. Omit for Meta's default, POSITIONAL. A template's format also dictates the shape you must send: positional templates take an array of variables, named templates take an object keyed by parameter name."},"components":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WhatsAppTemplateCreateRequestComponentsItems"},"description":"Meta's component array, passed through as given. Must include a BODY. Required unless `library_template_name` is set, which supplies its own. Positional: [{\"type\": \"BODY\", \"text\": \"Your order {{1}} has shipped.\", \"example\": {\"body_text\": [[\"1234\"]]}}]. Named: [{\"type\": \"BODY\", \"text\": \"Thanks {{first_name}}!\", \"example\": {\"body_text_named_params\": [{\"param_name\": \"first_name\", \"example\": \"Pablo\"}]}}]. Components containing variables require an `example` or Meta rejects the submission."},"library_template_name":{"type":["string","null"],"minLength":1,"description":"Build from Meta's Template Library instead of authoring one. Use the library entry's slug, e.g. \"appointment_confirmation_1\" (visible under each card in WhatsApp Manager > Template library). A library template used unchanged skips Meta's review and is usable immediately, so this is the fastest route to a sendable template. Omit `components` when using it."},"library_template_button_inputs":{"type":["array","null"],"items":{"$ref":"#/components/schemas/WhatsAppTemplateCreateRequestLibraryTemplateButtonInputsItems"},"description":"Library templates only: fills in the buttons the library entry ships with. Each entry takes {\"type\", \"phone_number\", \"url\", \"otp_type\", \"zero_tap_terms_accepted\", \"supported_apps\"} as the button requires — a URL button needs your url, a CALL button your phone number."},"library_template_body_inputs":{"oneOf":[{"$ref":"#/components/schemas/WhatsAppTemplateCreateRequestLibraryTemplateBodyInputs"},{"type":"null"}],"description":"Library templates only: toggles the optional body lines a library entry offers. {\"add_contact_number\", \"add_learn_more_link\", \"add_security_recommendation\", \"add_track_package_link\", \"code_expiration_minutes\"}."}},"required":["name","category"],"description":"A template submission, passed through to Meta close to verbatim.\n\nOnly structurally-required checks happen here. Meta owns the authoring\nrules (name casing, variable numbering and placement, category fit) and\nreturns specific, actionable errors for them — a partial local validator\nwould reject payloads Meta would have accepted.","title":"WhatsAppTemplateCreateRequest"},"SendVerificationRequest":{"type":"object","properties":{"phone_number":{"type":"string","description":"Phone number in E.164 format (e.g. +639277372243)"}},"required":["phone_number"],"title":"SendVerificationRequest"},"SendVerificationResponse":{"type":"object","properties":{"verification_id":{"type":"string","description":"Pass this to POST /v1/verify/check along with the code the user entered."},"status":{"type":"string","description":"Verification status. `pending` until the code is checked."}},"required":["verification_id","status"],"title":"SendVerificationResponse"},"CheckVerificationRequest":{"type":"object","properties":{"verification_id":{"type":"string","description":"Verification ID returned from /v1/verify/send"},"code":{"type":"string","pattern":"^[0-9]{6}$","description":"6-digit verification code"}},"required":["verification_id","code"],"title":"CheckVerificationRequest"},"CheckVerificationResponse":{"type":"object","properties":{"result":{"type":"string","description":"One of `ok`, `incorrect`, `exhausted`, `expired`, or `already_verified`."},"attempts_remaining":{"type":["integer","null"],"description":"Checks left before the verification is exhausted. 0 once it reaches a final state."}},"required":["result"],"title":"CheckVerificationResponse"},"ContactCardResponse":{"type":"object","properties":{"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"displayName":{"type":["string","null"]},"hasAvatar":{"type":"boolean","default":false}},"title":"ContactCardResponse"},"ContactCardWriteRequest":{"type":"object","properties":{"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"displayName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]}},"title":"ContactCardWriteRequest"},"LocationResponse":{"type":"object","properties":{"phoneNumber":{"type":"string"},"latitude":{"type":["number","null"],"format":"double"},"longitude":{"type":["number","null"],"format":"double"},"status":{"type":"string"},"lastUpdated":{"type":"integer"}},"required":["phoneNumber","status","lastUpdated"],"title":"LocationResponse"},"LocationRefreshResponse":{"type":"object","properties":{"success":{"type":"boolean"},"pollAfterSeconds":{"type":"integer","default":20}},"required":["success"],"title":"LocationRefreshResponse"},"SubmitFeedbackRequestCategory":{"type":"string","enum":["bug","docs_mismatch","friction","feature_gap","quality_degradation","other"],"description":"Kind of issue: `bug`, `docs_mismatch`, `friction`, `feature_gap`, `quality_degradation` or `other`.","title":"SubmitFeedbackRequestCategory"},"SubmitFeedbackRequest":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/SubmitFeedbackRequestCategory","description":"Kind of issue: `bug`, `docs_mismatch`, `friction`, `feature_gap`, `quality_degradation` or `other`."},"note":{"type":"string","description":"What went wrong and what you expected instead. 1 to 4000 characters."},"request_id":{"type":["string","null"],"format":"uuid","description":"The `request_id` of the API call the feedback is about, from the `X-Request-Id` response header or the error body. Feedback is stored once per request id."},"url":{"type":["string","null"],"description":"The page the feedback is about, such as a docs page. http(s) only, up to 2048 characters."},"tags":{"type":["array","null"],"items":{"type":"string"},"description":"Labels for filtering, up to 20, each 1 to 50 characters."}},"required":["category","note"],"title":"SubmitFeedbackRequest"},"SubmitFeedbackResponse":{"type":"object","properties":{"feedback_id":{"type":"string","description":"ID of the stored feedback."},"already_submitted":{"type":"boolean","description":"True when feedback for this `request_id` was already recorded; the original `feedback_id` is returned."},"request_id":{"type":["string","null"],"description":"Unique ID of this request, also in the `X-Request-Id` header. Include it when contacting support."}},"required":["feedback_id","already_submitted","request_id"],"title":"SubmitFeedbackResponse"},"CreateSubAccountRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"],"title":"CreateSubAccountRequest"},"UpdateSubAccountRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"],"title":"UpdateSubAccountRequest"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}