{"openapi":"3.1.0","info":{"title":"iZap API","description":"iZap - Smart WhatsApp Business Automation Platform\n\n    ## Features\n    * WhatsApp Business API Integration\n    * AI-Powered Chat Automation\n    * Order Management System\n    * Multi-Business Support\n    * Real-time Message Processing\n    * Webhook Management\n    * Business Analytics & Reporting\n\n    ## Authentication\n    Most endpoints require authentication via Bearer token or business-specific\n    API keys. Webhook endpoints are secured with signature verification.\n\n    Example:\n    ```\n    Authorization: Bearer <your_api_token>\n    ```\n\n    ## WhatsApp Integration\n    Uses the Meta WhatsApp Cloud API for seamless message delivery and\n    webhook processing.\n    ","contact":{"name":"API Support","email":"support@izap.ai"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"version":"11.1279.0"},"paths":{"/api/v1/webhook-endpoints":{"get":{"tags":["webhooks"],"summary":"List webhook endpoints","description":"Returns the webhook endpoints registered for the business, newest first. Signing secrets are never included — a secret is readable only in the response that creates or rotates it. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"listCurrentWebhookEndpoints","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpointOut"},"title":"Response List Endpoints Api V1 Webhook Endpoints Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["webhooks"],"summary":"Register a webhook endpoint","description":"Registers a URL to receive signed event deliveries and returns it along with its signing secret. **The secret is shown exactly once** — store it now; afterwards you can only rotate it. The URL must be a publicly resolvable HTTPS address, and every entry in `subscribed_events` must be a known event type. Requires a plan that includes event webhooks. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"createCurrentWebhookEndpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/webhook-endpoints/{endpoint_id}":{"patch":{"tags":["webhooks"],"summary":"Update a webhook endpoint","description":"Changes an endpoint's URL, label, subscribed events or enabled state; omitted fields are left alone. Re-enabling an endpoint also clears the consecutive-failure streak that auto-disabled it, so a single later failure will not disable it again. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"updateCurrentWebhookEndpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete a webhook endpoint","description":"Removes the endpoint and stops delivering to it. Past deliveries are retained. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"deleteCurrentWebhookEndpoint","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/webhook-endpoints/{endpoint_id}/rotate-secret":{"post":{"tags":["webhooks"],"summary":"Rotate an endpoint's signing secret","description":"Issues a new signing secret and returns it. **The previous secret stops verifying immediately** and there is no overlap window, so deploy the new one to your receiver before rotating. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"rotateCurrentWebhookSigningSecret","security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/webhook-endpoints/deliveries/{delivery_id}/resend":{"post":{"tags":["webhooks"],"summary":"Resend a delivery","description":"Queues a past delivery to be sent again. The stored request body is replayed byte for byte, so the original signature still verifies. Responds `202` once queued; the send itself happens in the background. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"resendCurrentWebhookDelivery","security":[{"bearerAuth":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Resend Delivery Api V1 Webhook Endpoints Deliveries  Delivery Id  Resend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats":{"get":{"tags":["chats"],"summary":"List a business's chats","description":"Returns the business's conversations with paging, and optional filters for kind and assistant. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"listCurrentBusinessChats","security":[{"bearerAuth":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","description":"Filter by Chat.kind. 'trainer' (default) returns sandbox conversations from the AI Trainer UI; 'real' returns customer conversations created from WhatsApp webhooks; 'all' returns both. The default is 'trainer' to preserve the historical behavior of this endpoint, which was trainer-only via a consumer-nickname heuristic.","default":"trainer","title":"Kind"},"description":"Filter by Chat.kind. 'trainer' (default) returns sandbox conversations from the AI Trainer UI; 'real' returns customer conversations created from WhatsApp webhooks; 'all' returns both. The default is 'trainer' to preserve the historical behavior of this endpoint, which was trainer-only via a consumer-nickname heuristic."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"1-based page number for chat pagination (used by the trainer's infinite scroll).","default":1,"title":"Page"},"description":"1-based page number for chat pagination (used by the trainer's infinite scroll)."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of chats to return per page (default 30, max 100).","default":30,"title":"Page Size"},"description":"Number of chats to return per page (default 30, max 100)."},{"name":"messages_per_chat","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"How many of the most-recent messages to embed per chat. Defaults to 1, which is enough for the list's last-message preview and ordering. Full conversation threads should be fetched on demand from GET /chats/{chat_id}/messages (paginated) rather than over-fetched here — embedding the whole thread for every chat on the page made this endpoint load thousands of messages per request.","default":1,"title":"Messages Per Chat"},"description":"How many of the most-recent messages to embed per chat. Defaults to 1, which is enough for the list's last-message preview and ordering. Full conversation threads should be fetched on demand from GET /chats/{chat_id}/messages (paginated) rather than over-fetched here — embedding the whole thread for every chat on the page made this endpoint load thousands of messages per request."},{"name":"refine_queue","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Refine trainer queue filter for kind=real. 'pending' = no OK review and no issues; 'reviewed' = has OK review or any issue.","title":"Refine Queue"},"description":"Refine trainer queue filter for kind=real. 'pending' = no OK review and no issues; 'reviewed' = has OK review or any issue."},{"name":"chatbot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Optional assistant ID to filter chats by (per-assistant trainer from dash).","title":"Chatbot Id"},"description":"Optional assistant ID to filter chats by (per-assistant trainer from dash)."},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO-8601 timestamp. When set, only chats whose last activity (the same timestamp this list orders by) is strictly *newer than* `since` are returned — exclusive, not inclusive, so polling with `since=<last seen timestamp>` never returns a chat already seen. For incremental sync: pass the newest `timestamp` from the previous response as `since` on the next poll instead of refetching and diffing a full page client-side.","title":"Since"},"description":"ISO-8601 timestamp. When set, only chats whose last activity (the same timestamp this list orders by) is strictly *newer than* `since` are returned — exclusive, not inclusive, so polling with `since=<last seen timestamp>` never returns a chat already seen. For incremental sync: pass the newest `timestamp` from the previous response as `since` on the next poll instead of refetching and diffing a full page client-side."},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["chats"],"summary":"Create a sandbox chat","description":"Creates a trainer sandbox conversation for the business named in the `business-id` header. Sandbox chats exercise an assistant without messaging a real customer, and a business with no connected WhatsApp number may keep only a limited number of them.","operationId":"createChat","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The business hit the free plan's sandbox-chat limit, or the plan does not include the REST API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/upload":{"post":{"tags":["messages"],"summary":"Upload an attachment","description":"Uploads a file to be attached to a message on this conversation, and returns the stored reference to pass when sending that message.","operationId":"uploadChatAttachment","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_files_api_v1_chats__chat_id__upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too many uploads for this business in the current rate-limit window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/messages":{"post":{"tags":["messages"],"summary":"Send a message to a chat","description":"Sends a message as a human agent and stores it on the conversation. The assistant does not reply to messages sent this way. Attachments are supported.","operationId":"sendChatMessage","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendChatMessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The business hit the free plan's per-chat daily message limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The 24-hour customer service window for this conversation is closed. Send an approved template message to reopen it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["messages"],"summary":"List a chat's messages","description":"Returns the conversation's messages newest first, with paging. Each message carries its author, content, timestamp and delivery status. Any chat id belonging to the conversation may be used.","operationId":"listChatMessages","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Page Size"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO-8601 timestamp. When set, only messages strictly *newer than* `since` are returned (exclusive — a message timestamped exactly at `since` is not repeated). Intended for incremental polling: pass the newest `timestamp` seen so far instead of refetching a full page and diffing client-side.","title":"Since"},"description":"ISO-8601 timestamp. When set, only messages strictly *newer than* `since` are returned (exclusive — a message timestamped exactly at `since` is not repeated). Intended for incremental polling: pass the newest `timestamp` seen so far instead of refetching a full page and diffing client-side."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Messages Api V1 Chats  Chat Id  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/messages/template":{"post":{"tags":["messages"],"summary":"Send a template message to a chat","description":"Sends an approved WhatsApp template into the conversation. This is the only way to reach a customer outside the 24-hour customer-service window. A rendered copy is stored so agents see what was sent.","operationId":"sendChatTemplateMessage","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatTemplateSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendChatTemplateMessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/template-conversations":{"post":{"tags":["messages"],"summary":"Start a conversation with a template","description":"Adds a contact by international phone number (E.164, leading `+`) and opens the conversation by sending an approved WhatsApp template. An existing contact with the same number is reused. Pass `whatsapp_number_id` when the business has more than one WhatsApp number. The business is taken from the `business-id` header.","operationId":"startTemplateConversation","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTemplateConversationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTemplateConversationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/messages/{message_id}":{"post":{"tags":["messages"],"summary":"Retrieve a message's details","description":"Returns one message with its delivery details, optionally including the replies generated in the same exchange. This operation only reads; it uses `POST` for historical reasons. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"getCurrentBusinessChatMessageDetails","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"message_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Message Id"}},{"name":"include_replies","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Replies"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageDetailsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/pause":{"post":{"tags":["chats"],"summary":"Pause the assistant on a chat","description":"Stops the assistant answering automatically on this conversation so a human can take over. Incoming messages are still received and stored.","operationId":"pauseChatAssistant","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPauseIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAssistantPauseOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/unpause":{"post":{"tags":["chats"],"summary":"Resume the assistant on a chat","description":"Hands the conversation back to the assistant, which resumes answering incoming messages automatically.","operationId":"resumeChatAssistant","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAssistantPauseOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/pause-status":{"get":{"tags":["chats"],"summary":"Check whether the assistant is paused","description":"Reports whether automatic replies are currently paused on the conversation, and until when.","operationId":"getChatPauseStatus","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPauseStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/status":{"put":{"tags":["chats"],"summary":"Set a chat's status","description":"Sets the conversation's status — the value the inbox filters on. The status is held against the business/customer pair, so it survives a conversation being closed and reopened.","operationId":"setChatStatus","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatStatusIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/read":{"put":{"tags":["chats"],"summary":"Mark a chat as read","description":"Marks the conversation read for the whole team as of now. Read state is shared between agents rather than tracked per agent, and the timestamp is stamped server-side.","operationId":"markChatRead","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatReadStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}/snooze":{"put":{"tags":["chats"],"summary":"Snooze a chat","description":"Snoozes the conversation until the given instant, or wakes it by sending `null`. Like read state, snoozing applies to the whole team.","operationId":"snoozeChat","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSnoozeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatReadStateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/chats/{chat_id}":{"delete":{"tags":["chats"],"summary":"Delete a chat","description":"Deletes the conversation. Deleting one that is already deleted returns `410`.","operationId":"deleteChat","security":[{"bearerAuth":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The free plan does not allow deleting chats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"410":{"description":"The chat is already deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/menus":{"get":{"tags":["menus"],"summary":"List the business menus","description":"Returns the product catalog menus published by the business named in the `business-id` header.","operationId":"listBusinessMenus","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessMenuOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["menus"],"summary":"Create a menu","description":"Creates a product catalog menu for the business named in the `business-id` header.","operationId":"createBusinessMenu","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MenuUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MenusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/current":{"get":{"tags":["businesses"],"summary":"Retrieve a business","description":"Returns the business profile, including its opening hours, menus and assistants. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"getCurrentBusiness","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["businesses"],"summary":"Update a business","description":"Partially updates the business profile. Only the fields present in the request body are changed. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"updateCurrentBusiness","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/hours":{"get":{"tags":["businesses"],"summary":"Retrieve opening hours","description":"Returns the opening hours grouped per weekday. These are the hours the assistant uses to decide whether the business is currently open. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"getCurrentBusinessHours","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessHoursOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["businesses"],"summary":"Replace opening hours","description":"Replaces the whole week's opening hours in one call — a weekday omitted from the request is treated as closed. Changes take effect on live conversations immediately. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"updateCurrentBusinessHours","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessHoursIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessHoursOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/menus/{menu_id}":{"put":{"tags":["menus"],"summary":"Update a menu","description":"Replaces the contents of an existing menu.","operationId":"updateBusinessMenu","security":[{"bearerAuth":[]}],"parameters":[{"name":"menu_id","in":"path","required":true,"schema":{"type":"string","title":"Menu Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MenuUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MenusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/register":{"post":{"tags":["whatsapp-cloud"],"summary":"Register a WhatsApp Cloud number","description":"Exchanges an Embedded Signup code and registers the WhatsApp Business Account in the background. Returns `202` with a `task_id`; poll the registration task until its status is `completed` or `failed`. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"registerCurrentWhatsAppNumber","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppCloudRegisterRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppCloudRegisterAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/register/tasks/{task_id}":{"get":{"tags":["whatsapp-cloud"],"summary":"Check a number registration task","description":"Returns the progress of an asynchronous number registration. Read-only and safe to poll. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"getCurrentWhatsAppNumberRegistrationTask","security":[{"bearerAuth":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppCloudRegisterTaskStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/send_catalog":{"post":{"tags":["whatsapp-cloud"],"summary":"Send the product catalog","description":"Sends an interactive catalog message to a WhatsApp recipient. The catalog is the one linked to the business's WhatsApp Business Account in Meta's Commerce Manager. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"sendCurrentWhatsAppCatalog","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendCatalogRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendCatalogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/numbers":{"get":{"tags":["whatsapp-cloud"],"summary":"List WhatsApp Cloud numbers","description":"Returns the WhatsApp Cloud numbers connected to the business, along with the assistant bound to each. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"listCurrentWhatsAppNumbers","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppNumbersOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/numbers/{number_id}/assistant":{"put":{"tags":["whatsapp-cloud"],"summary":"Bind an assistant to a number","description":"Points a connected number at one of the business's assistants. Inbound messages to that number are answered by the assistant bound here. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"setCurrentWhatsAppNumberAssistant","security":[{"bearerAuth":[]}],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppNumberAssistantIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppNumberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/numbers/{number_id}":{"delete":{"tags":["whatsapp-cloud"],"summary":"Remove a number from iZap","description":"Disconnects a WhatsApp Cloud number from the platform: it stops reaching any assistant and its stored credentials are discarded. The number itself stays registered at Meta and can be connected again later. Conversation history is kept. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"deleteCurrentWhatsAppNumber","security":[{"bearerAuth":[]}],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/numbers/{number_id}/disconnect":{"post":{"tags":["whatsapp-cloud"],"summary":"Revoke iZap's access to a number at Meta","description":"Revokes iZap's access to the number at Meta and removes it from the platform. Unlike `deleteCurrentWhatsAppNumber`, which only disconnects the number from iZap, this also unsubscribes from the WhatsApp Business Account's webhooks at Meta and optionally deregisters the number from Cloud API entirely (`deregister`). Reconnecting requires a full Embedded Signup run. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"disconnectCurrentWhatsAppNumber","security":[{"bearerAuth":[]}],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/WhatsAppNumberDisconnectIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppNumberDisconnectOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/numbers/{number_id}/live":{"get":{"tags":["whatsapp-cloud"],"summary":"Read a number's live status at Meta","description":"Fetches the number's current quality rating, verification state and status directly from Meta. Read-only. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"getCurrentWhatsAppNumberLiveStatus","security":[{"bearerAuth":[]}],"parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppPhoneLiveOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/whatsapp_cloud/waba_info":{"get":{"tags":["whatsapp-cloud"],"summary":"Read WhatsApp Business Account details","description":"Fetches business-verification details for the WhatsApp Business Account from Meta. The values are account-level, so they are the same for every number under the business. The business is taken from the `business-id` header rather than the URL; the path-scoped form of this operation is deprecated.","operationId":"getCurrentWhatsAppBusinessAccountInfo","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppWabaInfoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses":{"post":{"tags":["businesses"],"summary":"Create a business","description":"Creates a business together with its default settings, assistant and credentials. The authenticated user becomes its owner.","operationId":"createBusiness","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessDetailsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/businesses/library/images":{"post":{"tags":["business-library"],"summary":"Upload a library image","description":"Uploads an image to the library of the authenticated user's business so it can later be attached to messages. The business is taken from the credential; this operation accepts no business parameter.","operationId":"uploadBusinessLibraryImage","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID whose library is targeted. Required when the user has more than one business.","title":"Business-Id"},"description":"Business UUID whose library is targeted. Required when the user has more than one business."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_business_library_image_for_current_business_api_v1_businesses_library_images_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessLibraryImageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["business-library"],"summary":"List library images","description":"Returns the library images of the authenticated user's business, newest first, paged with `limit` and `offset`.","operationId":"listBusinessLibraryImages","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID whose library is targeted. Required when the user has more than one business.","title":"Business-Id"},"description":"Business UUID whose library is targeted. Required when the user has more than one business."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessLibraryImageListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/library/images/{image_id}":{"delete":{"tags":["business-library"],"summary":"Delete a library image","description":"Removes an image from the library. Messages already sent that referenced it are unaffected.","operationId":"deleteBusinessLibraryImage","security":[{"bearerAuth":[]}],"parameters":[{"name":"image_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Image Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID whose library is targeted. Required when the user has more than one business.","title":"Business-Id"},"description":"Business UUID whose library is targeted. Required when the user has more than one business."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/library/documents":{"post":{"tags":["business-library"],"summary":"Upload a library document","description":"Uploads a document or video to the library of the authenticated user's business so it can later be attached to messages. PDF, DOCX and MP4 are accepted; the type is read from the file's content, not its name.","operationId":"uploadBusinessLibraryDocument","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID whose library is targeted. Required when the user has more than one business.","title":"Business-Id"},"description":"Business UUID whose library is targeted. Required when the user has more than one business."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_business_library_document_for_current_business_api_v1_businesses_library_documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessLibraryImageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["business-library"],"summary":"List library documents","description":"Returns the library documents and videos of the authenticated user's business, newest first, paged with `limit` and `offset`.","operationId":"listBusinessLibraryDocuments","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID whose library is targeted. Required when the user has more than one business.","title":"Business-Id"},"description":"Business UUID whose library is targeted. Required when the user has more than one business."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessLibraryDocumentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/library/documents/{document_id}":{"delete":{"tags":["business-library"],"summary":"Delete a library document","description":"Removes a document from the library. Messages already sent that referenced it are unaffected.","operationId":"deleteBusinessLibraryDocument","security":[{"bearerAuth":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Business UUID whose library is targeted. Required when the user has more than one business.","title":"Business-Id"},"description":"Business UUID whose library is targeted. Required when the user has more than one business."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/chatbots/{chatbot_id}/contact-filter":{"get":{"tags":["businesses"],"summary":"Retrieve an assistant's contact filter","description":"Returns which contacts may trigger the assistant: the filter mode, and the numbers on its allowlist and blocklist. Messages from a contact the filter excludes are still received and stored, but the assistant is never invoked for them — no AI reply, greeting or off-hours message is sent.","operationId":"getAssistantContactFilter","security":[{"bearerAuth":[]}],"parameters":[{"name":"chatbot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chatbot Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFilterOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["businesses"],"summary":"Set an assistant's contact filter mode","description":"Chooses who may trigger the assistant: `off` (everyone), `allowlist` (only the numbers on the allowlist) or `blocklist` (everyone except the numbers on the blocklist). Takes effect on the next inbound message. Both lists are kept when the mode changes; an empty allowlist silences the assistant for every contact.","operationId":"setAssistantContactFilterMode","security":[{"bearerAuth":[]}],"parameters":[{"name":"chatbot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chatbot Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFilterModeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFilterOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/chatbots/{chatbot_id}/contact-filter/entries":{"post":{"tags":["businesses"],"summary":"Add contacts to an assistant's contact filter","description":"Adds up to 500 phone numbers to the allowlist or blocklist in one call. Numbers are stored in canonical E.164 form, so different spellings of one number are one entry. Adding a number that is already listed is not an error; the response reports it separately, along with any input that is not a usable phone number.","operationId":"addAssistantContactFilterEntries","security":[{"bearerAuth":[]}],"parameters":[{"name":"chatbot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chatbot Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFilterEntriesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFilterEntriesAddedOut"}}}},"422":{"description":"The request body failed validation, or the allowlist/blocklist is already full.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/businesses/chatbots/{chatbot_id}/contact-filter/entries/{entry_id}":{"delete":{"tags":["businesses"],"summary":"Remove a contact from an assistant's contact filter","description":"Removes one entry from the list it is on. Takes effect on the next inbound message.","operationId":"deleteAssistantContactFilterEntry","security":[{"bearerAuth":[]}],"parameters":[{"name":"chatbot_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chatbot Id"}},{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}},{"name":"business-id","in":"header","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.","title":"Business-Id"},"description":"UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/auth/token/introspect":{"get":{"tags":["api-tokens"],"summary":"Introspect the presented credential","description":"Resolves the credential on the request to its principal, or returns `401` if it is not valid. Accepts a JWT, a session cookie, a personal access token or a business API key — use it to confirm that a token is still good and who it belongs to.","operationId":"introspectToken","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrincipalResponse"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/me/api-tokens":{"get":{"tags":["api-tokens"],"summary":"List personal access tokens","description":"Returns the personal access tokens belonging to the authenticated user. Only metadata is returned; a token's value is never readable after it is created.","operationId":"listApiTokens","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TokenResponse"},"type":"array","title":"Response List Personal Access Tokens Api V1 Me Api Tokens Get"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["api-tokens"],"summary":"Create a personal access token","description":"Issues a new personal access token for the authenticated user. The token value appears exactly once, in this response — store it before discarding the response, because it cannot be retrieved again.","operationId":"createApiToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/me/api-tokens/{token_id}":{"delete":{"tags":["api-tokens"],"summary":"Revoke a personal access token","description":"Revokes the token immediately. Every later request presenting it is rejected.","operationId":"revokeApiToken","security":[{"bearerAuth":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/whatsapp_templates":{"get":{"tags":["whatsapp-templates"],"summary":"List message templates","description":"Returns the business's WhatsApp message templates, optionally filtered by review status.","operationId":"listWhatsAppTemplates","security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TemplateStatus"},{"type":"null"}],"title":"Status"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["whatsapp-templates"],"summary":"Create a message template","description":"Creates a template as a local draft. A draft cannot be used for sending until it has been submitted to Meta and approved.","operationId":"createWhatsAppTemplate","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/whatsapp_templates/{template_id}":{"get":{"tags":["whatsapp-templates"],"summary":"Retrieve a message template","description":"Returns one template, including its body, variables and current review status.","operationId":"getWhatsAppTemplate","security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["whatsapp-templates"],"summary":"Update a message template","description":"Updates a template. Its content can only be changed while the template is still a local draft or has been rejected — an approved template has to be replaced by a new one.","operationId":"updateWhatsAppTemplate","security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["whatsapp-templates"],"summary":"Delete a message template","description":"Deletes the template. Messages already sent with it are unaffected.","operationId":"deleteWhatsAppTemplate","security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/whatsapp_templates/{template_id}/submit":{"post":{"tags":["whatsapp-templates"],"summary":"Submit a template for review","description":"Submits the template to Meta for approval. Review is asynchronous — poll the template, or sync from Meta, to see the outcome.","operationId":"submitWhatsAppTemplate","security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/whatsapp_templates/sync":{"post":{"tags":["whatsapp-templates"],"summary":"Sync template status from Meta","description":"Pulls the current review status of the business's templates from Meta and updates the stored copies, so templates approved or rejected on Meta's side become visible here.","operationId":"syncWhatsAppTemplates","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/transmissions/preview":{"post":{"tags":["transmissions"],"summary":"Preview a transmission","description":"Validates the recipient list and template and stores the result as a draft, without sending anything. Review the draft, then confirm it to dispatch.","operationId":"previewTransmission","security":[{"bearerAuth":[]}],"parameters":[{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransmissionPreviewIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionPreviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/transmissions/{transmission_id}/confirm":{"post":{"tags":["transmissions"],"summary":"Confirm and dispatch a transmission","description":"Releases a draft transmission for delivery. **This sends real messages to real recipients and cannot be undone.**","operationId":"confirmTransmission","security":[{"bearerAuth":[]}],"parameters":[{"name":"transmission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transmission Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/transmissions/{transmission_id}/cancel":{"post":{"tags":["transmissions"],"summary":"Cancel a transmission","description":"Cancels a transmission that has not finished. Cancelling one that already completed, failed or was cancelled is a no-op that returns its current status. A send in progress stops cooperatively, so messages already dispatched are still delivered.","operationId":"cancelTransmission","security":[{"bearerAuth":[]}],"parameters":[{"name":"transmission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transmission Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/transmissions/{transmission_id}/archive":{"post":{"tags":["transmissions"],"summary":"Archive a transmission","description":"Hides a draft or cancelled transmission from the default list without deleting it. Idempotent for already-archived rows. Does not send or confirm; confirming an archived transmission is rejected.","operationId":"archiveTransmission","security":[{"bearerAuth":[]}],"parameters":[{"name":"transmission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transmission Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/transmissions":{"get":{"tags":["transmissions"],"summary":"List transmissions","description":"Returns the business's bulk sends, newest first. Archived rows are omitted unless `status=archived` is passed. Optionally filter by any other status.","operationId":"listTransmissions","security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"description":"Case-insensitive substring of the name.","title":"Q"},"description":"Case-insensitive substring of the name."},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTransmissionsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/transmissions/{transmission_id}":{"get":{"tags":["transmissions"],"summary":"Retrieve a transmission","description":"Returns one transmission with its current status and per-recipient counts.","operationId":"getTransmission","security":[{"bearerAuth":[]}],"parameters":[{"name":"transmission_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transmission Id"}},{"name":"business-id","in":"header","required":true,"schema":{"type":"string","format":"uuid","title":"Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransmissionStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The credential is valid but not authorized for this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The resource, or the business named in the request, does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"default":{"description":"Unexpected error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"schemas":{"Body_upload_business_library_document_for_current_business_api_v1_businesses_library_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["file"],"title":"Body_upload_business_library_document_for_current_business_api_v1_businesses_library_documents_post"},"Body_upload_business_library_image_for_current_business_api_v1_businesses_library_images_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["file"],"title":"Body_upload_business_library_image_for_current_business_api_v1_businesses_library_images_post"},"Body_upload_files_api_v1_chats__chat_id__upload_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_upload_files_api_v1_chats__chat_id__upload_post"},"BusinessCreateRequest":{"properties":{"business_name":{"type":"string","title":"Business Name"},"owner_contact":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Owner Contact"},"owner_contact_region":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Owner Contact Region"},"owner_name":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}],"title":"Owner Name"}},"type":"object","required":["business_name"],"title":"BusinessCreateRequest"},"BusinessDetailsOut":{"properties":{"business_id":{"type":"string","format":"uuid","title":"Business Id"},"business_name":{"type":"string","title":"Business Name"},"owner_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Contact"}},"type":"object","required":["business_id","business_name"],"title":"BusinessDetailsOut"},"BusinessHoursDayIn":{"properties":{"mode":{"type":"string","enum":["open_all_day","closed","custom"],"title":"Mode"},"ranges":{"items":{"$ref":"#/components/schemas/TimeRangeIn"},"type":"array","title":"Ranges"}},"type":"object","required":["mode"],"title":"BusinessHoursDayIn"},"BusinessHoursDayOut":{"properties":{"mode":{"type":"string","enum":["open_all_day","closed","custom"],"title":"Mode"},"ranges":{"items":{"$ref":"#/components/schemas/TimeRangeOut"},"type":"array","title":"Ranges"}},"type":"object","required":["mode"],"title":"BusinessHoursDayOut"},"BusinessHoursIn":{"properties":{"monday":{"$ref":"#/components/schemas/BusinessHoursDayIn"},"tuesday":{"$ref":"#/components/schemas/BusinessHoursDayIn"},"wednesday":{"$ref":"#/components/schemas/BusinessHoursDayIn"},"thursday":{"$ref":"#/components/schemas/BusinessHoursDayIn"},"friday":{"$ref":"#/components/schemas/BusinessHoursDayIn"},"saturday":{"$ref":"#/components/schemas/BusinessHoursDayIn"},"sunday":{"$ref":"#/components/schemas/BusinessHoursDayIn"}},"type":"object","required":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"title":"BusinessHoursIn"},"BusinessHoursOut":{"properties":{"monday":{"$ref":"#/components/schemas/BusinessHoursDayOut"},"tuesday":{"$ref":"#/components/schemas/BusinessHoursDayOut"},"wednesday":{"$ref":"#/components/schemas/BusinessHoursDayOut"},"thursday":{"$ref":"#/components/schemas/BusinessHoursDayOut"},"friday":{"$ref":"#/components/schemas/BusinessHoursDayOut"},"saturday":{"$ref":"#/components/schemas/BusinessHoursDayOut"},"sunday":{"$ref":"#/components/schemas/BusinessHoursDayOut"}},"type":"object","required":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"title":"BusinessHoursOut"},"BusinessLibraryDocumentListResponse":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/BusinessLibraryImageOut"},"type":"array","title":"Documents"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_next":{"type":"boolean","title":"Has Next"}},"type":"object","required":["documents","total","limit","offset","has_next"],"title":"BusinessLibraryDocumentListResponse","description":"Paginated list of library documents and videos (newest first).\n\nSame row shape as the image listing — the two differ in which document types they\ncarry, not in what is known about one — but a distinct model so the OpenAPI schema\nnames the collection for what it holds."},"BusinessLibraryImageListResponse":{"properties":{"images":{"items":{"$ref":"#/components/schemas/BusinessLibraryImageOut"},"type":"array","title":"Images"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_next":{"type":"boolean","title":"Has Next"}},"type":"object","required":["images","total","limit","offset","has_next"],"title":"BusinessLibraryImageListResponse","description":"Paginated list of library images with stable ordering (newest first)."},"BusinessLibraryImageOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"business_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Id"},"filename":{"type":"string","title":"Filename"},"original_filename":{"type":"string","title":"Original Filename"},"content_type":{"type":"string","title":"Content Type"},"document_type":{"type":"string","title":"Document Type"},"file_size":{"type":"integer","title":"File Size"},"url":{"type":"string","title":"Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"uploaded_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Uploaded By User Id"},"created":{"type":"string","format":"date-time","title":"Created"}},"type":"object","required":["id","business_id","filename","original_filename","content_type","document_type","file_size","url","created"],"title":"BusinessLibraryImageOut","description":"Metadata for an image stored in the business library.\n\nBacked by the :class:`aizap.models.documents.Document` model, filtered to\nimage document types."},"BusinessMenuOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"menus":{"items":{"$ref":"#/components/schemas/MenusOut"},"type":"array","title":"Menus"}},"type":"object","required":["id","business_name","menus"],"title":"BusinessMenuOut"},"BusinessOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"hours":{"items":{"$ref":"#/components/schemas/HoursOut"},"type":"array","title":"Hours"},"menus":{"items":{"$ref":"#/components/schemas/MenusOut"},"type":"array","title":"Menus"},"chatbot":{"anyOf":[{"$ref":"#/components/schemas/ChatbotOut"},{"type":"null"}]},"chatbots":{"items":{"$ref":"#/components/schemas/ChatbotOut"},"type":"array","title":"Chatbots","default":[]}},"type":"object","required":["id","business_name","hours","menus"],"title":"BusinessOut"},"BusinessSimpleOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"business_name":{"type":"string","title":"Business Name"}},"type":"object","required":["id","business_name"],"title":"BusinessSimpleOut"},"BusinessUpdateRequest":{"properties":{"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"}},"type":"object","title":"BusinessUpdateRequest","description":"Partial update for a business's profile. Optional fields only; unset ones are left alone.\n\nKept intentionally narrow (name + timezone) so GOG-3129 (business hours) can extend this\nsame endpoint with an `hours` field later instead of introducing a second PATCH route."},"ChatAssistantPauseOut":{"properties":{"status":{"type":"string","enum":["paused","unpaused"],"title":"Status"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"business_id":{"type":"string","format":"uuid","title":"Business Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},"type":"object","required":["status","chat_id","business_id","phone_number"],"title":"ChatAssistantPauseOut","description":"Response for ``POST /chats/{chat_id}/pause`` and ``.../unpause``."},"ChatConsumerOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nickname"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},"type":"object","required":["id"],"title":"ChatConsumerOut"},"ChatListOut":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/ChatOut"},"type":"array","title":"Chats"},"pagination":{"$ref":"#/components/schemas/PaginationMeta"}},"type":"object","required":["chats","pagination"],"title":"ChatListOut"},"ChatMessageDetailsOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"sender":{"type":"string","title":"Sender"},"receiver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"chat_messages":{"anyOf":[{"items":{"$ref":"#/components/schemas/SingleChatMessage"},"type":"array"},{"type":"null"}],"title":"Chat Messages"},"reply_group":{"anyOf":[{"$ref":"#/components/schemas/ChatMessageDetailsOut"},{"type":"null"}]},"user_message":{"anyOf":[{"$ref":"#/components/schemas/SingleChatMessage"},{"type":"null"}]},"function_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/ResponseOutputFunction"},"type":"array"},{"type":"null"}],"title":"Function Calls"},"resp_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resp Id"},"last_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Last Message Id"}},"type":"object","required":["id","chat_id","sender","timestamp"],"title":"ChatMessageDetailsOut"},"ChatMessageStatus":{"type":"string","enum":["new","queued","sending","sent","failed","delivered","undelivered","receiving","received","accepted","scheduled","read","played","cancelled"],"title":"ChatMessageStatus"},"ChatMessageSummaryOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"no_reply":{"type":"boolean","title":"No Reply"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"status":{"anyOf":[{"$ref":"#/components/schemas/ChatMessageStatus"},{"type":"null"}]},"error_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Error Code"},"error_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Reason"},"message_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Sid"},"receiver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"sender_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Sender User Id"},"client_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Message Id"}},"type":"object","required":["id","content","no_reply","timestamp","status","error_code","error_reason","sender_user_id"],"title":"ChatMessageSummaryOut","description":"A chat message as embedded in the send-message responses below."},"ChatOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Conversation Id"},"business_id":{"type":"string","format":"uuid","title":"Business Id"},"session_id":{"type":"string","format":"uuid","title":"Session Id"},"last_message":{"anyOf":[{"$ref":"#/components/schemas/LastMessageOut"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"messages":{"items":{},"type":"array","title":"Messages"},"created":{"type":"string","format":"date-time","title":"Created"},"instructions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Instructions"},"custom_instructions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Custom Instructions"},"kind":{"type":"string","title":"Kind","default":"real"},"consumer":{"anyOf":[{"$ref":"#/components/schemas/ChatConsumerOut"},{"type":"null"}]},"refine_reviewed":{"type":"boolean","title":"Refine Reviewed","default":false},"refine_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refine Verdict"}},"type":"object","required":["id","business_id","session_id","timestamp","messages","created"],"title":"ChatOut"},"ChatPauseIn":{"properties":{"ttl_seconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Ttl Seconds","description":"Temporary pause duration in seconds. Omit for a permanent human hold."}},"type":"object","title":"ChatPauseIn"},"ChatPauseStatusOut":{"properties":{"is_paused":{"type":"boolean","title":"Is Paused"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"business_id":{"type":"string","format":"uuid","title":"Business Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"ttl_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ttl Seconds"},"hold":{"type":"boolean","title":"Hold"},"held_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Held By User Id"},"held_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Held At"},"origin":{"anyOf":[{"type":"string","enum":["operator","human_support","smb_echo","off_hours","api","mcp"]},{"type":"null"}],"title":"Origin"}},"type":"object","required":["is_paused","chat_id","business_id","phone_number","ttl_seconds","hold"],"title":"ChatPauseStatusOut","description":"Response for ``GET /chats/{chat_id}/pause-status``."},"ChatReadStateOut":{"properties":{"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"business_id":{"type":"string","format":"uuid","title":"Business Id"},"last_read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Read At"},"snoozed_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Snoozed Until"}},"type":"object","required":["chat_id","business_id"],"title":"ChatReadStateOut","description":"The shared read / snooze state of one conversation."},"ChatSnoozeIn":{"properties":{"snoozed_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Snoozed Until","description":"Timezone-aware instant to snooze until. Null un-snoozes."}},"type":"object","title":"ChatSnoozeIn","description":"When to wake the conversation, or ``null`` to wake it now."},"ChatStatusIn":{"properties":{"status":{"type":"string","enum":["open","pending","resolved","archived","blocked"],"title":"Status","description":"New status for the conversation."}},"type":"object","required":["status"],"title":"ChatStatusIn","description":"The conversation's CRM status, as shown by the inbox status filter."},"ChatStatusOut":{"properties":{"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"business_id":{"type":"string","format":"uuid","title":"Business Id"},"status":{"type":"string","enum":["open","pending","resolved","archived","blocked"],"title":"Status"}},"type":"object","required":["chat_id","business_id","status"],"title":"ChatStatusOut"},"ChatTemplateSendRequest":{"properties":{"template_id":{"type":"string","format":"uuid","title":"Template Id"},"variables":{"additionalProperties":{"type":"string"},"type":"object","title":"Variables","description":"Body/button variable values, keyed '1','2',…"}},"type":"object","required":["template_id"],"title":"ChatTemplateSendRequest","description":"Send an approved template into an existing live-chat conversation."},"ChatbotOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"ai_model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Model Name"},"custom_instructions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Custom Instructions"},"is_active":{"type":"boolean","title":"Is Active","default":false},"avatar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar"},"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"platform":{"anyOf":[{"type":"string","const":"whatsapp"},{"type":"null"}],"title":"Platform"},"whatsapp_numbers":{"items":{"$ref":"#/components/schemas/ChatbotWhatsAppNumberOut"},"type":"array","title":"Whatsapp Numbers","default":[]},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"messaging_backend":{"type":"string","enum":["external","izap"],"title":"Messaging Backend","default":"izap"},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"},"effective_locale":{"type":"string","title":"Effective Locale"},"locale_source":{"type":"string","enum":["configured","inferred","default"],"title":"Locale Source","default":"default"},"detect_client_language":{"type":"boolean","title":"Detect Client Language","default":false},"ai_pause_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ai Pause Minutes"},"ai_pause_minutes_default":{"type":"integer","title":"Ai Pause Minutes Default","default":60},"hold_ai_after_manual_reply":{"type":"boolean","title":"Hold Ai After Manual Reply","default":false}},"type":"object","required":["id","effective_locale"],"title":"ChatbotOut"},"ChatbotWhatsAppNumberOut":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"verified_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"quality_rating":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality Rating"},"phone_number_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number Id"}},"type":"object","required":["phone_number"],"title":"ChatbotWhatsAppNumberOut","description":"The WhatsApp number a chatbot answers on, as shown in the dash assistant card."},"ContactFilterEntriesAddedOut":{"properties":{"added":{"items":{"$ref":"#/components/schemas/ContactFilterEntryOut"},"type":"array","title":"Added"},"already_listed":{"items":{"type":"string"},"type":"array","title":"Already Listed","description":"Contacts that were already on the list, in canonical form."},"invalid":{"items":{"type":"string"},"type":"array","title":"Invalid","description":"Inputs that are not a usable phone number, as sent."}},"type":"object","required":["added","already_listed","invalid"],"title":"ContactFilterEntriesAddedOut"},"ContactFilterEntriesIn":{"properties":{"list":{"$ref":"#/components/schemas/ContactFilterList","description":"Which list to add the contacts to: `allow` or `block`."},"phone_numbers":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Phone Numbers","description":"A WhatsApp phone number with its country code (`+5585987504325`; spaces, dashes and parentheses are ignored), or a WhatsApp business-scoped user ID for contacts whose number is hidden. Numbers are stored in canonical E.164 form."},"label":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Label","description":"Optional note stored with each contact."}},"type":"object","required":["list","phone_numbers"],"title":"ContactFilterEntriesIn"},"ContactFilterEntryOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"phone_number":{"type":"string","title":"Phone Number","description":"A WhatsApp phone number with its country code (`+5585987504325`; spaces, dashes and parentheses are ignored), or a WhatsApp business-scoped user ID for contacts whose number is hidden. Numbers are stored in canonical E.164 form."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"created":{"type":"string","format":"date-time","title":"Created"}},"type":"object","required":["id","phone_number","created"],"title":"ContactFilterEntryOut"},"ContactFilterList":{"type":"string","enum":["allow","block"],"title":"ContactFilterList"},"ContactFilterMode":{"type":"string","enum":["off","allowlist","blocklist"],"title":"ContactFilterMode"},"ContactFilterModeIn":{"properties":{"mode":{"$ref":"#/components/schemas/ContactFilterMode"}},"type":"object","required":["mode"],"title":"ContactFilterModeIn"},"ContactFilterOut":{"properties":{"mode":{"$ref":"#/components/schemas/ContactFilterMode","description":"`off`: every contact can trigger the assistant. `allowlist`: only contacts on the allowlist can. `blocklist`: every contact except those on the blocklist can."},"allowlist":{"items":{"$ref":"#/components/schemas/ContactFilterEntryOut"},"type":"array","title":"Allowlist"},"blocklist":{"items":{"$ref":"#/components/schemas/ContactFilterEntryOut"},"type":"array","title":"Blocklist"}},"type":"object","required":["mode","allowlist","blocklist"],"title":"ContactFilterOut"},"CreateChatIn":{"properties":{"session_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Session Id"},"instructions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Instructions"},"chatbot_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Chatbot Id"}},"type":"object","title":"CreateChatIn"},"CreateMessageIn":{"properties":{"content":{"type":"string","maxLength":4096,"title":"Content"},"sender_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Sender User Id"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/MessageAttachment"},"type":"array"},{"type":"null"}],"title":"Attachments"},"client_message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Client Message Id"}},"type":"object","required":["content"],"title":"CreateMessageIn","description":"Schema for creating a new message in a chat"},"CreateTokenRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name","description":"Human-readable label for the token."},"expires_in_days":{"anyOf":[{"type":"integer","maximum":3650.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Expires In Days","description":"Days until the token expires. Null for a non-expiring token."},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"Optional permission scopes (``Permission`` enum values). Omitted or empty means full access within the credential's normal permissions."}},"type":"object","required":["name"],"title":"CreateTokenRequest","description":"Mint a new token. ``expires_in_days`` omitted/null means it never expires."},"CreateTransmissionPreviewIn":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Human label for the transmission."},"transmission_type":{"$ref":"#/components/schemas/TransmissionType","description":"Transmission kind: 'whatsapp_template' or 'whatsapp_freeform'.","default":"whatsapp_template"},"max_messages_per_minute":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Max Messages Per Minute","description":"Sending pace cap. Must be between 1 and 200 messages per minute.","default":60},"template_name":{"type":"string","maxLength":512,"minLength":1,"title":"Template Name","description":"Name of the pre-approved WhatsApp Cloud API template to send. Required for 'whatsapp_template'; not accepted for 'whatsapp_freeform', which stores a fixed default.","default":"freeform"},"template_language":{"type":"string","maxLength":15,"minLength":2,"title":"Template Language","description":"Template language/locale code as registered with Meta, e.g. 'pt_BR'.","default":"pt_BR"},"recipients":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","maxItems":5000,"minItems":1,"title":"Recipients","description":"Parsed CSV rows; each row maps a string column header to its string cell value. Must include the phone column and the columns that supply the template's variables."},"phone_column":{"type":"string","maxLength":255,"minLength":1,"title":"Phone Column","description":"Name of the CSV column holding the recipient phone number (E.164 or local).","default":"phone"},"variable_columns":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Variable Columns","description":"For positional templates ({{1}}, {{2}}, ...): the ordered CSV header names mapping to {{1}}, {{2}}, ... If omitted, the first non-phone columns are used in order. Ignored for templates with named placeholders."},"message_text":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Message Text","description":"Text to send. Required for 'whatsapp_freeform', which only reaches contacts inside the WhatsApp customer-service window; others are skipped."},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At","description":"When to send. Omit or null to send immediately on confirm. If the value has no timezone offset it is interpreted in 'timezone'."},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"IANA timezone used to interpret a naive 'scheduled_at'. Defaults to the business's configured timezone (America/Sao_Paulo when none is set)."},"business_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Id"}},"type":"object","required":["name","recipients"],"title":"CreateTransmissionPreviewIn","description":"Validate CSV recipients against a template and create a DRAFT transmission.\n\nNo messages are sent. ``recipients`` are parsed CSV rows (header -> value); each\nrow must contain ``phone_column`` and the columns that fill the template's\nvariables. Confirm the returned draft id with ``confirm_transmission`` to send."},"DeleteChatResponse":{"properties":{"message":{"type":"string","title":"Message"},"deleted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deleted At"},"can_be_restored":{"type":"boolean","title":"Can Be Restored","default":true}},"type":"object","required":["message"],"title":"DeleteChatResponse"},"FileUploadResponse":{"properties":{"files":{"items":{"$ref":"#/components/schemas/UploadedFile"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"FileUploadResponse","description":"Response for file upload"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HoursOut":{"properties":{"start_hour":{"type":"string","title":"Start Hour"},"end_hour":{"type":"string","title":"End Hour"},"operating_days":{"items":{},"type":"array","title":"Operating Days"}},"type":"object","required":["start_hour","end_hour","operating_days"],"title":"HoursOut"},"LastMessageOut":{"properties":{"status":{"type":"string","title":"Status"},"content":{"type":"string","title":"Content"},"no_reply":{"type":"boolean","title":"No Reply","default":false}},"type":"object","required":["status","content"],"title":"LastMessageOut"},"ListTransmissionsOut":{"properties":{"transmissions":{"items":{"$ref":"#/components/schemas/TransmissionStatusOut"},"type":"array","title":"Transmissions"},"total":{"type":"integer","title":"Total"},"business_id":{"type":"string","format":"uuid","title":"Business Id"}},"type":"object","required":["transmissions","total","business_id"],"title":"ListTransmissionsOut"},"MenuUpdateIn":{"properties":{"menu_json":{"title":"Menu Json"}},"type":"object","required":["menu_json"],"title":"MenuUpdateIn"},"MenusOut":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"menu_json":{"title":"Menu Json"}},"type":"object","required":["menu_json"],"title":"MenusOut"},"MessageAttachment":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"filename":{"type":"string","title":"Filename"},"file_type":{"type":"string","maxLength":255,"title":"File Type"},"file_size":{"type":"integer","title":"File Size"},"url":{"type":"string","title":"Url"}},"type":"object","required":["filename","file_type","file_size","url"],"title":"MessageAttachment","description":"Schema for message attachments"},"PaginationMeta":{"properties":{"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total_count":{"type":"integer","title":"Total Count"},"total_pages":{"type":"integer","title":"Total Pages"},"has_next":{"type":"boolean","title":"Has Next"},"has_previous":{"type":"boolean","title":"Has Previous"}},"type":"object","required":["page","page_size","total_count","total_pages","has_next","has_previous"],"title":"PaginationMeta"},"PreviewRowErrorOut":{"properties":{"row_index":{"type":"integer","title":"Row Index"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"error":{"type":"string","title":"Error"}},"type":"object","required":["row_index","phone","error"],"title":"PreviewRowErrorOut"},"PrincipalResponse":{"properties":{"kind":{"type":"string","title":"Kind","description":"'user' or 'business_api_key'."},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id","description":"Set when authenticated as a user."},"business_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Id","description":"Set when authenticated as a business API key."},"token_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Token Id","description":"Id of the token row used, if any."}},"type":"object","required":["kind"],"title":"PrincipalResponse","description":"Introspection result: who the presented credential authenticates as."},"RegistrationTaskStatus":{"type":"string","enum":["pending","processing","completed","failed"],"title":"RegistrationTaskStatus","description":"Lifecycle of an async registration job.\n\n``PENDING`` is created by ``POST /auth/register`` before the worker picks it\nup. ``PROCESSING`` means the dramatiq actor is running. Terminal states are\n``COMPLETED`` (account ready) and ``FAILED`` (see ``error_code`` / ``error_detail``)."},"ResponseOutputFunction":{"properties":{"type":{"type":"string","const":"function_call","title":"Type"},"call_id":{"type":"string","title":"Call Id"},"name":{"type":"string","title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["type","call_id","name","arguments"],"title":"ResponseOutputFunction"},"SendCatalogRequest":{"properties":{"to":{"type":"string","title":"To"},"body":{"type":"string","title":"Body"},"footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Footer"},"thumbnail_product_retailer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Product Retailer Id"}},"type":"object","required":["to","body"],"title":"SendCatalogRequest"},"SendCatalogResponse":{"properties":{"status":{"type":"string","title":"Status"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error"},"source":{"type":"string","title":"Source"}},"type":"object","required":["status","source"],"title":"SendCatalogResponse"},"SendChatMessageOut":{"properties":{"user_message":{"$ref":"#/components/schemas/ChatMessageSummaryOut"},"ai_messages":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatMessageSummaryOut"},"type":"array"},{"type":"null"}],"title":"Ai Messages"},"ai_response_pending":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ai Response Pending"}},"type":"object","required":["user_message"],"title":"SendChatMessageOut","description":"Response for ``POST /chats/{chat_id}/messages``.\n\n``ai_messages``/``ai_response_pending`` are absent on the human-assistant\npath (no AI reply was generated) and present on the AI path — kept absent\nrather than null via ``response_model_exclude_unset`` on the route."},"SendChatTemplateMessageOut":{"properties":{"user_message":{"$ref":"#/components/schemas/ChatMessageSummaryOut"}},"type":"object","required":["user_message"],"title":"SendChatTemplateMessageOut","description":"Response for ``POST /chats/{chat_id}/messages/template``."},"SingleChatMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"sender":{"type":"string","title":"Sender"},"receiver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver"},"sender_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Type"},"message":{"type":"string","title":"Message"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"status":{"type":"string","title":"Status"},"message_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Sid"},"error_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Error Code"},"error_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Reason"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"sender_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Sender User Id"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/MessageAttachment"},"type":"array"},{"type":"null"}],"title":"Attachments"},"user_message":{"anyOf":[{"$ref":"#/components/schemas/SingleChatMessage"},{"type":"null"}]},"no_reply":{"type":"boolean","title":"No Reply","default":false}},"type":"object","required":["id","chat_id","sender","message","timestamp","status"],"title":"SingleChatMessage"},"StartTemplateConversationOut":{"properties":{"user_message":{"$ref":"#/components/schemas/ChatMessageSummaryOut"},"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"consumer_id":{"type":"string","format":"uuid","title":"Consumer Id"}},"type":"object","required":["user_message","chat_id","consumer_id"],"title":"StartTemplateConversationOut","description":"Response for ``POST /chats/template-conversations``."},"StartTemplateConversationRequest":{"properties":{"template_id":{"type":"string","format":"uuid","title":"Template Id"},"variables":{"additionalProperties":{"type":"string"},"type":"object","title":"Variables","description":"Body/button variable values, keyed '1','2',…"},"phone":{"type":"string","title":"Phone","description":"International phone number, E.164 with leading '+'"},"name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Email"},"whatsapp_number_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Whatsapp Number Id"}},"type":"object","required":["template_id","phone"],"title":"StartTemplateConversationRequest","description":"Add a contact and open the conversation with an approved template.\n\n``phone`` is any international number in E.164 form (leading ``+``). The business\nline to send from may be omitted only when the business has a single line."},"TemplateButton":{"properties":{"type":{"type":"string","title":"Type","description":"QUICK_REPLY | URL | PHONE_NUMBER | VOICE_CALL | FLOW | REQUEST_CONTACT_INFO | ORDER_DETAILS"},"text":{"type":"string","maxLength":25,"title":"Text","default":""},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Url"},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone Number"},"flow_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Flow Id"},"flow_action":{"anyOf":[{"type":"string","enum":["navigate","data_exchange"]},{"type":"null"}],"title":"Flow Action"},"navigate_screen":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Navigate Screen"}},"type":"object","required":["type"],"title":"TemplateButton","description":"A single template button.\n\n``type`` is one of QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, FLOW, REQUEST_CONTACT_INFO, ORDER_DETAILS. URL/PHONE_NUMBER\nbuttons carry the corresponding ``url``/``phone_number`` field; FLOW buttons carry\n``flow_id`` and, when navigating, ``navigate_screen``. REQUEST_CONTACT_INFO has no\n``text`` because Meta sets its label. Combination rules are checked\non submission by ``validate_for_submission``."},"TemplateButtonOut":{"properties":{"type":{"type":"string","title":"Type","description":"QUICK_REPLY | URL | PHONE_NUMBER | VOICE_CALL | FLOW | REQUEST_CONTACT_INFO | ORDER_DETAILS | COPY_CODE | OTP"},"text":{"type":"string","title":"Text","default":""},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"flow_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Action"},"navigate_screen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Navigate Screen"}},"type":"object","required":["type"],"title":"TemplateButtonOut","description":"Stored/returned button. Label length is uncapped so synced templates can be listed."},"TemplateCategory":{"type":"string","enum":["marketing","utility","authentication"],"title":"TemplateCategory","description":"WhatsApp/Meta template category. Drives approval rules and pricing."},"TemplateHeaderFormat":{"type":"string","enum":["none","text","image","video","document"],"title":"TemplateHeaderFormat"},"TemplateListResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/WhatsAppTemplateOut"},"type":"array","title":"Templates"},"total_count":{"type":"integer","title":"Total Count"}},"type":"object","required":["templates","total_count"],"title":"TemplateListResponse"},"TemplateStatus":{"type":"string","enum":["draft","pending","approved","rejected","paused","disabled"],"title":"TemplateStatus","description":"Lifecycle/approval status of a template.\n\nDRAFT is local-only (not yet submitted to Meta). The remaining values mirror\nthe statuses returned by the WhatsApp Cloud API."},"TemplateSyncResponse":{"properties":{"synced":{"type":"integer","title":"Synced"},"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"message":{"type":"string","title":"Message"},"unchanged":{"type":"integer","title":"Unchanged","default":0}},"type":"object","required":["synced","created","updated","message"],"title":"TemplateSyncResponse","description":"Result of a sync against the WhatsApp Cloud backend."},"TimeRangeIn":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"}},"type":"object","required":["start","end"],"title":"TimeRangeIn"},"TimeRangeOut":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"}},"type":"object","required":["start","end"],"title":"TimeRangeOut","description":"Echoes stored ``start_hour``/``end_hour`` verbatim, unvalidated.\n\nExisting rows predate the strict HH:MM format ``TimeRangeIn`` enforces on new\nwrites (``BusinessService.is_open`` itself tolerates \"H\", \"HH:MM\", \"HH:MM:SS\"),\nso a read must never 500 on legacy data shaped that way."},"TokenCreatedResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"token_prefix":{"type":"string","title":"Token Prefix","description":"Non-secret leading chars, e.g. 'izap_pat_AbC'."},"last_four":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Four","description":"Last four chars of the token, for recognition."},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"Permission scopes. Null means full access within the credential's normal permissions."},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked":{"type":"boolean","title":"Revoked"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created":{"type":"string","format":"date-time","title":"Created"},"token":{"type":"string","title":"Token","description":"The plaintext token. Store it now; it cannot be retrieved again."}},"type":"object","required":["id","name","token_prefix","expires_at","revoked","last_used_at","created","token"],"title":"TokenCreatedResponse","description":"Returned once at creation — the only time the plaintext ``token`` is exposed."},"TokenResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"token_prefix":{"type":"string","title":"Token Prefix","description":"Non-secret leading chars, e.g. 'izap_pat_AbC'."},"last_four":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Four","description":"Last four chars of the token, for recognition."},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"Permission scopes. Null means full access within the credential's normal permissions."},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked":{"type":"boolean","title":"Revoked"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created":{"type":"string","format":"date-time","title":"Created"}},"type":"object","required":["id","name","token_prefix","expires_at","revoked","last_used_at","created"],"title":"TokenResponse","description":"Non-secret view of a token, safe to list."},"TransmissionPreviewOut":{"properties":{"transmission_id":{"type":"string","format":"uuid","title":"Transmission Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"transmission_type":{"type":"string","title":"Transmission Type"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"template_language":{"type":"string","title":"Template Language"},"uses_named_variables":{"type":"boolean","title":"Uses Named Variables"},"recipient_count":{"type":"integer","title":"Recipient Count"},"valid_count":{"type":"integer","title":"Valid Count"},"invalid_count":{"type":"integer","title":"Invalid Count"},"duplicate_count":{"type":"integer","title":"Duplicate Count"},"not_on_whatsapp_count":{"type":"integer","title":"Not On Whatsapp Count","default":0},"outside_window_count":{"type":"integer","title":"Outside Window Count","default":0},"column_mapping":{"additionalProperties":{"type":"string"},"type":"object","title":"Column Mapping"},"phone_column":{"type":"string","title":"Phone Column"},"sample_errors":{"items":{"$ref":"#/components/schemas/PreviewRowErrorOut"},"type":"array","title":"Sample Errors"},"estimated_duration_seconds":{"type":"integer","title":"Estimated Duration Seconds"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"business_id":{"type":"string","format":"uuid","title":"Business Id"}},"type":"object","required":["transmission_id","name","status","transmission_type","template_name","template_language","uses_named_variables","recipient_count","valid_count","invalid_count","duplicate_count","column_mapping","phone_column","sample_errors","estimated_duration_seconds","scheduled_at","warnings","business_id"],"title":"TransmissionPreviewOut"},"TransmissionStatusOut":{"properties":{"transmission_id":{"type":"string","format":"uuid","title":"Transmission Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"transmission_type":{"type":"string","title":"Transmission Type"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"total_recipients":{"type":"integer","title":"Total Recipients"},"sent_count":{"type":"integer","title":"Sent Count"},"failed_count":{"type":"integer","title":"Failed Count"},"pending_count":{"type":"integer","title":"Pending Count"},"progress_pct":{"type":"number","title":"Progress Pct"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created"},"business_id":{"type":"string","format":"uuid","title":"Business Id"}},"type":"object","required":["transmission_id","name","status","transmission_type","template_name","total_recipients","sent_count","failed_count","pending_count","progress_pct","scheduled_at","started_at","completed_at","business_id"],"title":"TransmissionStatusOut"},"TransmissionType":{"type":"string","enum":["whatsapp_template","whatsapp_freeform"],"title":"TransmissionType","description":"The kind of bulk message a transmission sends.\n\n``WHATSAPP_TEMPLATE`` sends an approved template to a phone list. ``WHATSAPP_FREEFORM``\nsends a fixed text and only reaches contacts inside Meta's 24h customer-service window.\nModelled as an enum so further channels can be added without a schema change to the\nstored value."},"UploadedFile":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"filename":{"type":"string","title":"Filename"},"file_type":{"type":"string","title":"File Type"},"file_size":{"type":"integer","title":"File Size"},"url":{"type":"string","title":"Url"}},"type":"object","required":["id","filename","file_type","file_size","url"],"title":"UploadedFile","description":"Schema for uploaded file metadata.\n\nFiles can be stored in either S3 (object storage) or local filesystem,\ndepending on the storage backend configuration. The URL format depends\non the storage backend:\n- Local filesystem: `/uploads/chats/{chat_id}/{filename}`\n- S3: Presigned URL or direct bucket URL (format depends on S3 configuration)"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookEndpointCreate":{"properties":{"label":{"type":"string","maxLength":100,"minLength":1,"title":"Label"},"url":{"type":"string","maxLength":500,"title":"Url"},"subscribed_events":{"items":{"type":"string"},"type":"array","title":"Subscribed Events"}},"type":"object","required":["label","url"],"title":"WebhookEndpointCreate"},"WebhookEndpointCreated":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"type":"string","title":"Label"},"url":{"type":"string","title":"Url"},"subscribed_events":{"items":{"type":"string"},"type":"array","title":"Subscribed Events"},"enabled":{"type":"boolean","title":"Enabled"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_delivery_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Delivery At"},"created":{"type":"string","format":"date-time","title":"Created"},"signing_secret":{"type":"string","title":"Signing Secret"}},"type":"object","required":["id","label","url","subscribed_events","enabled","consecutive_failures","last_error","last_delivery_at","created","signing_secret"],"title":"WebhookEndpointCreated","description":"``WebhookEndpointOut`` plus the one-time secret. Returned by create and rotate only."},"WebhookEndpointOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"type":"string","title":"Label"},"url":{"type":"string","title":"Url"},"subscribed_events":{"items":{"type":"string"},"type":"array","title":"Subscribed Events"},"enabled":{"type":"boolean","title":"Enabled"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"last_delivery_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Delivery At"},"created":{"type":"string","format":"date-time","title":"Created"}},"type":"object","required":["id","label","url","subscribed_events","enabled","consecutive_failures","last_error","last_delivery_at","created"],"title":"WebhookEndpointOut","description":"Everything about an endpoint except its secret, which is unreadable by design."},"WebhookEndpointUpdate":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Label"},"url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Url"},"subscribed_events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subscribed Events"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"WebhookEndpointUpdate"},"WhatsAppCloudRegisterAccepted":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"status":{"$ref":"#/components/schemas/RegistrationTaskStatus","default":"pending"}},"type":"object","required":["task_id"],"title":"WhatsAppCloudRegisterAccepted","description":"202 body of ``POST /{business_id}/whatsapp_cloud/register``."},"WhatsAppCloudRegisterRequest":{"properties":{"code":{"type":"string","title":"Code"},"waba_business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Business Id"},"phone_number_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number Id"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"}},"type":"object","required":["code"],"title":"WhatsAppCloudRegisterRequest"},"WhatsAppCloudRegisterTaskStatus":{"properties":{"task_id":{"type":"string","format":"uuid","title":"Task Id"},"status":{"$ref":"#/components/schemas/RegistrationTaskStatus"},"business":{"anyOf":[{"$ref":"#/components/schemas/BusinessSimpleOut"},{"type":"null"}]},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error"}},"type":"object","required":["task_id","status"],"title":"WhatsAppCloudRegisterTaskStatus","description":"Poll body of ``GET /{business_id}/whatsapp_cloud/register/tasks/{task_id}``."},"WhatsAppNumberAssistantIn":{"properties":{"assistant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assistant Id"}},"type":"object","title":"WhatsAppNumberAssistantIn","description":"``null`` detaches whichever assistant currently answers on the number."},"WhatsAppNumberDisconnectIn":{"properties":{"deregister":{"type":"boolean","title":"Deregister","default":false}},"type":"object","title":"WhatsAppNumberDisconnectIn"},"WhatsAppNumberDisconnectOut":{"properties":{"removed":{"type":"boolean","title":"Removed"},"access_revoked":{"type":"boolean","title":"Access Revoked"},"deregistered":{"type":"boolean","title":"Deregistered"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","default":[]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["removed","access_revoked","deregistered"],"title":"WhatsAppNumberDisconnectOut"},"WhatsAppNumberOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"phone_number":{"type":"string","title":"Phone Number"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"verified_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"quality_rating":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality Rating"},"phone_number_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number Id"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"},"platform_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Type"},"code_verification_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code Verification Status"},"assistant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assistant Id"},"assistant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Name"},"messaging_backend":{"type":"string","enum":["external","izap"],"title":"Messaging Backend","default":"izap"}},"type":"object","required":["id","phone_number"],"title":"WhatsAppNumberOut"},"WhatsAppNumbersOut":{"properties":{"numbers":{"items":{"$ref":"#/components/schemas/WhatsAppNumberOut"},"type":"array","title":"Numbers"},"viewer_is_owner":{"type":"boolean","title":"Viewer Is Owner"}},"type":"object","required":["numbers","viewer_is_owner"],"title":"WhatsAppNumbersOut"},"WhatsAppPhoneLiveOut":{"properties":{"phone_number_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number Id"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","title":"WhatsAppPhoneLiveOut"},"WhatsAppTemplateCreate":{"properties":{"name":{"type":"string","maxLength":512,"minLength":1,"pattern":"^[a-z0-9_]+$","title":"Name"},"display_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Display Name"},"language":{"type":"string","maxLength":10,"title":"Language","default":"pt_BR"},"category":{"$ref":"#/components/schemas/TemplateCategory","default":"utility"},"header_format":{"$ref":"#/components/schemas/TemplateHeaderFormat","default":"none"},"header_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Header Text"},"header_media_document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Header Media Document Id"},"body_text":{"type":"string","maxLength":1024,"minLength":1,"title":"Body Text"},"footer_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer Text"},"buttons":{"items":{"$ref":"#/components/schemas/TemplateButton"},"type":"array","title":"Buttons"},"call_permission_request":{"type":"boolean","title":"Call Permission Request","description":"Add Meta's call permission request component (marketing/utility only, no buttons).","default":false},"example_variables":{"items":{"type":"string"},"type":"array","title":"Example Variables"},"waba_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Waba Id"}},"type":"object","required":["name","body_text"],"title":"WhatsAppTemplateCreate"},"WhatsAppTemplateOut":{"properties":{"name":{"type":"string","maxLength":512,"minLength":1,"pattern":"^[a-z0-9_]+$","title":"Name"},"display_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Display Name"},"language":{"type":"string","maxLength":10,"title":"Language","default":"pt_BR"},"category":{"$ref":"#/components/schemas/TemplateCategory","default":"utility"},"header_format":{"$ref":"#/components/schemas/TemplateHeaderFormat","default":"none"},"header_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Header Text"},"header_media_document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Header Media Document Id"},"body_text":{"type":"string","maxLength":1024,"minLength":1,"title":"Body Text"},"footer_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer Text"},"buttons":{"items":{"$ref":"#/components/schemas/TemplateButtonOut"},"type":"array","title":"Buttons"},"call_permission_request":{"type":"boolean","title":"Call Permission Request","description":"Add Meta's call permission request component (marketing/utility only, no buttons).","default":false},"example_variables":{"items":{"type":"string"},"type":"array","title":"Example Variables"},"id":{"type":"string","format":"uuid","title":"Id"},"business_id":{"type":"string","format":"uuid","title":"Business Id"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"},"status":{"$ref":"#/components/schemas/TemplateStatus"},"provider_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Template Id"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"quality_score":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality Score"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"created":{"type":"string","format":"date-time","title":"Created"},"modified":{"type":"string","format":"date-time","title":"Modified"}},"type":"object","required":["name","body_text","id","business_id","status","created","modified"],"title":"WhatsAppTemplateOut"},"WhatsAppTemplateUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Display Name"},"language":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Language"},"category":{"anyOf":[{"$ref":"#/components/schemas/TemplateCategory"},{"type":"null"}]},"header_format":{"anyOf":[{"$ref":"#/components/schemas/TemplateHeaderFormat"},{"type":"null"}]},"header_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Header Text"},"header_media_document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Header Media Document Id"},"body_text":{"anyOf":[{"type":"string","maxLength":1024,"minLength":1},{"type":"null"}],"title":"Body Text"},"footer_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer Text"},"buttons":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateButton"},"type":"array"},{"type":"null"}],"title":"Buttons"},"call_permission_request":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Call Permission Request"},"example_variables":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Example Variables"}},"type":"object","title":"WhatsAppTemplateUpdate","description":"Partial update. Content edits to APPROVED/PAUSED templates are sent to Meta immediately."},"WhatsAppWabaInfoOut":{"properties":{"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"},"info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Info"}},"type":"object","title":"WhatsAppWabaInfoOut"},"ApiErrorDetail":{"additionalProperties":true,"description":"The structured ``detail`` object some error responses carry.\n\nSeveral handlers (the REST API plan gate, the free-tier limits, the\nwebhooks entitlement gate, the closed customer-service window) raise\n``HTTPException(detail={\"code\": ..., \"message\": ..., ...})`` — a fixed\n``code``/``message`` pair plus extra fields specific to that error.\n``extra=\"allow\"`` keeps those fields in the documented shape instead of\ndropping them.","properties":{"code":{"title":"Code","type":"string"},"message":{"title":"Message","type":"string"}},"required":["code","message"],"title":"ApiErrorDetail","type":"object"},"ApiError":{"description":"The response body of a handled API error.\n\n``detail`` is either a plain string (FastAPI's default for an\n``HTTPException`` raised with a string, and for the ``default`` fastapi-users\nmessages like ``\"Not authenticated\"``) or the structured\n:class:`ApiErrorDetail` object described above. ``code`` is present only on\nthe top-level shape ``aizap.core.exceptions.AppException`` produces for its\nown 5xx responses (``\"INTERNAL_ERROR\"`` / ``\"DB_ERROR\"``); it does not\nduplicate the ``code`` nested inside a structured ``detail``.","properties":{"detail":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ApiErrorDetail"}],"title":"Detail"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Code"}},"required":["detail"],"title":"ApiError","type":"object"}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal access token (izap_pat_…) sent as Authorization: Bearer <token>; dashboard session JWTs are also accepted."}}},"tags":[{"name":"api-tokens","description":"Personal access tokens for calling this API, plus introspection of the token presented on a request."},{"name":"businesses","description":"Create a business, read and update its profile, and manage its opening hours."},{"name":"business-library","description":"Reusable images belonging to the caller's business, referenced when composing messages."},{"name":"menus","description":"Product catalog menus a business publishes to its customers."},{"name":"whatsapp-cloud","description":"Provision and inspect the WhatsApp Cloud API numbers attached to a business: registration, WABA details, per-number assistant binding and catalog sends."},{"name":"chats","description":"Conversation lifecycle — list, create and delete chats, and control read, snooze, status and AI pause state."},{"name":"messages","description":"Read a conversation's messages, send free-form or template replies, and upload attachments."},{"name":"whatsapp-templates","description":"Manage WhatsApp message templates: draft them locally, submit them to Meta for review and sync approval status back."},{"name":"transmissions","description":"Bulk template sends. A transmission is previewed into a draft, then confirmed or cancelled — confirming dispatches to real recipients."},{"name":"webhooks","description":"Register URLs that receive signed event deliveries when something happens in a business, rotate their signing secrets, and replay an individual delivery."},{"name":"orders","description":"Server-rendered order visualisation page for a business slug, behind HTTP Basic auth."}]}