{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/v1/agents/voices":{"get":{"operationId":"list-voices-v-1-agents-voices-get","summary":"List Voices","description":"Return available voices from the configured voice provider.","tags":["agents"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}}}}},"/v1/agents":{"get":{"operationId":"list-agents-v-1-agents-get","summary":"List Agents","description":"List all agents for this account.","tags":["agents"],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","required":false,"schema":{"type":"string","default":20}}],"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"}}}}}},"post":{"operationId":"create-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"/v1/agents/{agent_id}":{"get":{"operationId":"get-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"delete":{"operationId":"delete-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"patch":{"operationId":"update-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"/v1/agents/{agent_id}/numbers":{"post":{"operationId":"attach-number-to-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/agents/{agent_id}/numbers/{number_id}":{"delete":{"operationId":"detach-number-from-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/agents/{agent_id}/conversations":{"get":{"operationId":"list-agent-conversations-v-1-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","default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/agents/{agent_id}/calls":{"get":{"operationId":"list-agent-calls-v-1-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","default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/numbers":{"get":{"operationId":"list-numbers-v-1-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).","tags":["numbers"],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","required":false,"schema":{"type":"string","default":20}}],"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"}}}}}},"post":{"operationId":"create-number-v-1-numbers-post","summary":"Create Number","description":"Provision a new SMS-enabled phone number.\n\n1. Check number limit (lifetime limit)\n2. Search the account's configured SMS provider for available numbers\n3. Purchase the first available one\n4. Configure messaging and voice routing\n5. Store the number in our database","tags":["numbers"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"/v1/numbers/{number_id}":{"get":{"operationId":"get-number-v-1-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.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"delete":{"operationId":"delete-number-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}}},"/v1/numbers/{number_id}/messages":{"get":{"operationId":"get-messages-v-1-numbers-number-id-messages-get","summary":"Get Messages","description":"Get messages for a specific phone number.\n\nSupports cursor-based pagination via before/after timestamps.","tags":["numbers"],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/webhooks":{"get":{"operationId":"get-webhook-v-1-webhooks-get","summary":"Get Webhook","description":"Get the master webhook configuration for this account.","tags":["webhooks"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/WebhookResponse"},{"type":"null"}]}}}}}},"post":{"operationId":"create-or-update-webhook-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}},"delete":{"operationId":"delete-webhook-v-1-webhooks-delete","summary":"Delete Webhook","description":"Remove the master webhook for this account.","tags":["webhooks"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}}}}},"/v1/webhooks/deliveries":{"get":{"operationId":"list-deliveries-v-1-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","default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"hours","in":"query","required":false,"schema":{"type":["integer","null"]}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/webhooks/deliveries/stats":{"get":{"operationId":"delivery-stats-v-1-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","default":24}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/webhooks/deliveries/all-time":{"get":{"operationId":"all-time-stats-v-1-webhooks-deliveries-all-time-get","summary":"All Time Stats","description":"Lightweight all-time delivery counts using indexed COUNT queries.","tags":["webhooks"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllTimeStatsResponse"}}}}}}},"/v1/webhooks/test":{"post":{"operationId":"test-webhook-v-1-webhooks-test-post","summary":"Test Webhook","description":"Send a test webhook to verify the endpoint is working.\n\nSends a fake message payload to the configured URL.\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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/agents/{agent_id}/webhook":{"get":{"operationId":"get-agent-webhook-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"post":{"operationId":"create-or-update-agent-webhook-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}},"delete":{"operationId":"delete-agent-webhook-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/agents/{agent_id}/webhook/deliveries":{"get":{"operationId":"list-agent-deliveries-v-1-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","default":50}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/agents/{agent_id}/webhook/test":{"post":{"operationId":"test-agent-webhook-v-1-agents-agent-id-webhook-test-post","summary":"Test Agent Webhook","description":"Send a test webhook to the agent's webhook endpoint.","tags":["agent-webhooks"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/contacts":{"get":{"operationId":"list-contacts-v-1-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":"limit","in":"query","required":false,"schema":{"type":"integer","default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"post":{"operationId":"create-contact-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/contacts/{contact_id}":{"get":{"operationId":"get-contact-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"delete":{"operationId":"delete-contact-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"patch":{"operationId":"update-contact-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/conversations":{"get":{"operationId":"list-conversations-v-1-conversations-get","summary":"List Conversations","description":"List all conversations for this account.\n\nSorted by most recent activity (lastMessageAt desc).\nSorted by most recent activity.","tags":["conversations"],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","required":false,"schema":{"type":"string","default":20}}],"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"}}}}}}},"/v1/conversations/{conversation_id}":{"get":{"operationId":"get-conversation-v-1-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","default":50}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"patch":{"operationId":"update-conversation-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/conversations/{conversation_id}/messages":{"get":{"operationId":"get-conversation-messages-v-1-conversations-conversation-id-messages-get","summary":"Get Conversation Messages","description":"Get paginated messages for a conversation.\n\nUse before/after for cursor-based pagination.","tags":["conversations"],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/conversations/{conversation_id}/typing":{"post":{"operationId":"send-typing-indicator-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/conversations/{conversation_id}/background":{"post":{"operationId":"set-chat-background-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}},"delete":{"operationId":"remove-chat-background-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/calls":{"get":{"operationId":"list-calls-v-1-calls-get","summary":"List Calls","description":"List all calls for this account.","tags":["calls"],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","required":false,"schema":{"type":"string","default":20}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"operationId":"create-outbound-call-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account.","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"}}}}}},"/v1/calls/web":{"post":{"operationId":"create-web-call-v-1-calls-web-post","summary":"Create Web Call","description":"Create a browser-based web call.\n\nReturns an access token that your frontend passes to the AgentPhone Web SDK\n(`agentphone-web-sdk`) to start the call in the browser. The token\nexpires 30 seconds after creation.\n\nFlow:\n1. Validates the agent belongs to your account\n2. Creates a web call and returns an access token\n3. Your client calls `webClient.startCall({ accessToken })` to connect\n4. Call lifecycle (transcripts, webhooks) works the same as phone calls","tags":["calls"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/calls/{call_id}":{"get":{"operationId":"get-call-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/calls/{call_id}/end":{"post":{"operationId":"end-call-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/calls/{call_id}/recording":{"get":{"operationId":"get-call-recording-v-1-calls-call-id-recording-get","summary":"Get Call Recording","description":"Returns the audio file (WAV format) for a completed call.\n\nThis is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.\n\nRecording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.\n\n**Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.\n\n**Notes:**\n- Recording is available shortly after a call completes\n- Check `recordingAvailable: true` in the call response before fetching\n- The URL can be shared or embedded directly since it requires no authentication","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"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"}}}}}}},"/v1/calls/{call_id}/transcript":{"get":{"operationId":"get-call-transcript-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/calls/{call_id}/transcript/stream":{"get":{"operationId":"stream-call-transcript-v-1-calls-call-id-transcript-stream-get","summary":"Stream Call Transcript","description":"Stream a call's transcript via Server-Sent Events.\n\nOn connect the server replays all existing transcript turns from the\ndatabase, then streams new turns in real time as they arrive from the\nvoice provider.  A ``: heartbeat`` comment is sent every 15 s to keep\nproxies alive.  The stream closes after sending an ``ended`` event\nwhen the call completes (or immediately after replay if the call has\nalready ended).\n\nWorks for both live and completed calls — same URL either way.","tags":["calls"],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/numbers/{number_id}/calls":{"get":{"operationId":"list-calls-for-number-v-1-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","default":20}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/usage":{"get":{"operationId":"get-usage-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}}}}},"/v1/usage/daily":{"get":{"operationId":"get-daily-usage-v-1-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","default":30}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/usage/monthly":{"get":{"operationId":"get-monthly-usage-v-1-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","default":6}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/usage/by-number":{"get":{"operationId":"get-usage-by-number-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberUsageResponse"}}}}}}},"/v1/usage/by-agent":{"get":{"operationId":"get-usage-by-agent-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/messages":{"post":{"operationId":"send-message-v-1-messages-post","summary":"Send Message","description":"Send an outbound message (SMS or iMessage) via the provider assigned to the number.\n\nAttach media by passing public HTTPS URLs in `media_urls`.\n\n### Single attachment\n\nPass a single-item array in `media_urls`. The URL must be publicly accessible.\n\n### Carousel / multi-image (iMessage)\n\nTo send a carousel of images on iMessage, pass 2-20 URLs in `media_urls`. Requirements:\n- Each URL must be a **publicly accessible HTTPS link** to an image (JPEG, PNG, GIF, etc.)\n- Minimum 2 URLs, maximum 20\n- `body` must be omitted or empty (text cannot be sent alongside a carousel)\n- Only supported on iMessage-capable lines\n\n> **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: [\"https://...\"]`.","tags":["messages"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/messages/{message_id}/reactions":{"post":{"operationId":"send-reaction-v-1-messages-message-id-reactions-post","summary":"Send Reaction","description":"Send a tapback reaction to a message (iMessage only).\n\nReactions are available only for iMessage messages. Attempting to react\nto an SMS message or another channel that does not support tapbacks\nreturns a clear error.","tags":["messages"],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/numbers/{number_id}/contact-card":{"get":{"operationId":"get-contact-card-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"put":{"operationId":"put-contact-card-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}},"delete":{"operationId":"delete-contact-card-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/sub-accounts":{"get":{"operationId":"list-sub-accounts-v-1-sub-accounts-get","summary":"List Sub Accounts","tags":["sub-accounts"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"description":"Any type"}}}}}},"post":{"operationId":"create-sub-account-v-1-sub-accounts-post","summary":"Create Sub Account","tags":["sub-accounts"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/sub-accounts/{sub_account_id}":{"delete":{"operationId":"delete-sub-account-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"patch":{"operationId":"update-sub-account-v-1-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":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/register/status":{"get":{"operationId":"get-registration-status-v-1-register-status-get","summary":"Get Registration Status","description":"Check the status of your A2P 10DLC registration.\n\n### Sub-account status\n\nTo check the registration status of a sub-account, pass the `X-Sub-Account-Id` header with the sub-account ID returned from `POST /v1/register`.\n\n### Possible statuses\n\n- `none` -- No registration submitted.\n- `pending` -- Registration is under review.\n- `approved` -- Registration approved. Your account is ready to send messages.","tags":["registration"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}},{"name":"X-Sub-Account-Id","in":"header","description":"Check a sub-account's registration status. Pass the sub-account ID returned from `POST /v1/register`. Omit to check the master account.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatusResponse"}}}}}}},"/v1/register":{"post":{"operationId":"register-a-2-p-v-1-register-post","summary":"Register A2P","description":"Submit an A2P 10DLC registration to enable outbound SMS on your account.\n\nUS carriers require 10DLC registration before your AI agent can send text messages. This endpoint accepts both `sole_proprietor` and `standard_brand` registration types.\n\n### How it works\n\n1. Submit your registration details via this endpoint\n2. A one-time $25 registration fee is deducted from your account balance\n3. We submit your registration to the carriers on your behalf\n4. Carrier approval typically takes 7-10 business days\n\n### Registration types\n\n- **`sole_proprietor`** -- For individuals or small businesses. Simpler requirements, fewer fields.\n- **`standard_brand`** -- For established businesses. Requires `business_name`, `organization_type`, `ein`, `privacy_policy_url`, `terms_of_service_url`.\n\n### Sub-accounts\n\nParent accounts can set `create_sub_account: true` (the default) to create a dedicated sub-account for each registration. This lets you manage multiple campaigns independently. The $25 fee is always charged to the parent account.\n\n### Opt-in image\n\n`opt_in_image_url` must be a publicly accessible HTTPS URL to a screenshot showing how users opt in to receive messages from you (e.g. a consent checkbox on your signup form). Supports PNG, JPG, WEBP, and GIF up to 2MB. Google Drive links (`drive.google.com/file/d/.../view`) are automatically converted if the file is shared publicly.\n\n### Re-submitting\n\nIf your previous registration was rejected, you can call this endpoint again to re-register.","tags":["registration"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}},"/v1/location/{phone_number}":{"get":{"operationId":"get-location-v-1-location-phone-number-get","summary":"Get Location","tags":["location"],"parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"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"}}}}}}},"/v1/location/refresh":{"post":{"operationId":"refresh-locations-v-1-location-refresh-post","summary":"Refresh Locations","tags":["location"],"parameters":[{"name":"Authorization","in":"header","description":"Bearer authentication","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationRefreshResponse"}}}}}}}},"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"],"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 ($0.005/min surcharge).","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"]},"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 ($0.005/min surcharge)."},"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"],"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"],"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 ($0.005/min surcharge).","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"]},"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 ($0.005/min surcharge)."},"maxSilenceMs":{"type":["integer","null"],"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","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","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"],"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 ($0.005/min surcharge).","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"]},"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 ($0.005/min surcharge)."},"maxSilenceMs":{"type":["integer","null"],"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","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","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"},"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","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"},"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"]},"createdAt":{"type":"string","format":"date-time"}},"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"},"CreateNumberRequest":{"type":"object","properties":{"country":{"type":"string","default":"US"},"areaCode":{"type":["string","null"]},"agentId":{"type":["string","null"]}},"title":"CreateNumberRequest"},"MessageResponse":{"type":"object","properties":{"id":{"type":"string"},"from_":{"type":"string"},"to":{"type":"string"},"body":{"type":"string"},"direction":{"type":"string"},"channel":{"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"}},"required":["data","hasMore"],"title":"MessageListResponse"},"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"},"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"},"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"},"UpdateContactRequest":{"type":"object","properties":{"phoneNumber":{"type":["string","null"]},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"notes":{"type":["string","null"]}},"title":"UpdateContactRequest"},"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"},"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"}},"required":["data","hasMore","total"],"title":"app__routes__conversations__ConversationListResponse"},"ConversationDetailMetadata":{"type":"object","properties":{},"title":"ConversationDetailMetadata"},"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"]},"mediaUrl":{"type":["string","null"]},"mediaUrls":{"type":"array","items":{"type":"string"},"default":[]},"receivedAt":{"type":"string","format":"date-time"},"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"},"ConversationDetail":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":["string","null"]},"phoneNumberId":{"type":"string"},"phoneNumber":{"type":"string"},"participant":{"type":"string"},"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"}}},"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"}},"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"},"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"},"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."},"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."}},"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"},"PlanLimits":{"type":"object","properties":{"numbers":{"type":"integer"},"messagesPerMonth":{"type":"integer"},"voiceMinutesPerMonth":{"type":"integer"},"maxCallDurationMinutes":{"type":"integer"},"concurrentCalls":{"type":"integer"}},"required":["numbers","messagesPerMonth","voiceMinutesPerMonth","maxCallDurationMinutes","concurrentCalls"],"title":"PlanLimits"},"PlanInfo":{"type":"object","properties":{"name":{"type":"string"},"limits":{"$ref":"#/components/schemas/PlanLimits"}},"required":["name","limits"],"title":"PlanInfo"},"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"},"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":{"plan":{"$ref":"#/components/schemas/PlanInfo"},"numbers":{"$ref":"#/components/schemas/NumberLimits"},"stats":{"$ref":"#/components/schemas/UsageStats"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}},"required":["plan","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":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DailyUsagePoint"}},"days":{"type":"integer"}},"required":["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":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MonthlyUsagePoint"}},"months":{"type":"integer"}},"required":["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":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NumberUsageItem"}}},"required":["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":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentUsageItem"}},"period":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}},"required":["data","period","periodStart","periodEnd"],"title":"AgentUsageResponse"},"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"},"SendMessageRequest":{"type":"object","properties":{"agent_id":{"type":["string","null"]},"to_number":{"type":["string","null"],"description":"Recipient of an existing chat: a phone (any format, normalized to E.164), US short code, email, or a group id (grp_...). Provide this OR `recipients` (to start a new group), not both."},"recipients":{"type":["array","null"],"items":{"type":"string"},"description":"Start a NEW iMessage group by listing 2 or more recipients (phones or emails). The first message is delivered to all of them, an iMessage group is created, and the response `to_number` returns the new group id (grp_...) to use for follow-up sends. iMessage numbers only."},"body":{"type":"string"},"media_url":{"type":["string","null"]},"media_urls":{"type":["array","null"],"items":{"type":"string"}},"number_id":{"type":["string","null"]},"from_number":{"type":["string","null"]},"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 in iMessage."}},"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"},"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"},"CreateSubAccountRequest":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"title":"CreateSubAccountRequest"},"UpdateSubAccountRequest":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"title":"UpdateSubAccountRequest"},"CampaignStatusResponse":{"type":"object","properties":{"campaign_status":{"type":"string"},"message":{"type":"string"}},"required":["campaign_status","message"],"title":"CampaignStatusResponse"},"RegistrationRequestRegistrationType":{"type":"string","enum":["sole_proprietor","standard_brand"],"description":"'sole_proprietor' or 'standard_brand'","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' or 'standard_brand'"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone_number":{"type":"string","description":"E.164 format, e.g. +15551234567"},"business_name":{"type":["string","null"],"description":"Legal/registered business name. Required for standard_brand."},"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":"Required for standard_brand."},"contact_title":{"oneOf":[{"$ref":"#/components/schemas/ContactTitle"},{"type":"null"}],"description":"Your role. Required for standard_brand."},"contact_title_other":{"type":["string","null"],"description":"Custom title when contact_title is 'other'."},"ein":{"type":["string","null"],"description":"EIN / Tax ID. Required for standard_brand."},"website_url":{"type":["string","null"]},"industry":{"type":["string","null"],"description":"e.g. technology, real_estate, retail, healthcare"},"business_regions":{"type":"array","items":{"type":"string"},"default":["usa_and_canada"]},"street_address":{"type":"string"},"street_address_2":{"type":["string","null"]},"city":{"type":"string"},"state":{"type":"string"},"zip_code":{"type":"string"},"country":{"type":"string","default":"US"},"planned_numbers":{"type":"integer","default":1,"description":"Number of phone numbers you plan to use"},"description":{"type":"string","description":"What your business does, who you message, and what types of messages you send. Min 40 chars."},"use_cases":{"type":"array","items":{"$ref":"#/components/schemas/UseCase"},"description":"1-5 specific use cases for your SMS campaign."},"volume":{"$ref":"#/components/schemas/Volume","default":"low","description":"Expected message volume."},"message_samples":{"type":"array","items":{"type":"string"},"description":"2-5 example messages. Each must be 20-1024 chars and include your brand name."},"consent_flow":{"type":"string","description":"How users opt in to receive messages. Min 40 chars."},"privacy_policy_url":{"type":["string","null"],"description":"Required for standard_brand."},"terms_of_service_url":{"type":["string","null"],"description":"Required for standard_brand."},"opt_in_image_url":{"type":"string","description":"Publicly accessible URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB)"},"includes":{"type":"array","items":{"$ref":"#/components/schemas/CampaignInclude"},"default":[],"description":"Content types included in messages."},"link_sample":{"type":["string","null"],"description":"Example URL if messages contain links."},"create_sub_account":{"type":"boolean","default":true,"description":"Create a dedicated sub-account for this campaign. 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","default":2500}},"required":["ok","message","campaign_status"],"title":"RegistrationResponse"},"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"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}