{"openapi":"3.1.0","info":{"title":"Sabimee API","description":"WhatsApp-first AI Business Operating Platform — API gateway. Documents, retrieval, and grounded AI chat for one organization.","contact":{"name":"Sabimee Engineering"},"version":"0.1.0"},"paths":{"/health/live":{"get":{"tags":["health"],"summary":"Health Live","description":"Liveness probe — the process is up. No dependencies are consulted.","operationId":"health_live_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Live Health Live Get"}}}}}}},"/health/ready":{"get":{"tags":["health"],"summary":"Health Ready","description":"Readiness probe — database, Redis, and configuration. ``503`` on failure.","operationId":"health_ready_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Ready Health Ready Get"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health","description":"General health — one word, backed by the database probe.\n\n``degraded`` rather than a named dependency: a status page needs to know\nsomething is wrong, and an anonymous caller does not need to know what.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/organizations":{"post":{"tags":["organizations"],"summary":"Create Organization","description":"Self-service signup. The first user is then created via `POST /users`.","operationId":"create_organization_organizations_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["organizations"],"summary":"List Organizations","description":"The caller's own organization.\n\nA list of one, not a directory. A user belongs to exactly one organization,\nso anything else this endpoint could return would belong to someone else.\n``limit`` and ``offset`` are kept so the response shape and the client\ncontract do not change.","operationId":"list_organizations_organizations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationRead"},"title":"Response List Organizations Organizations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}":{"get":{"tags":["organizations"],"summary":"Get Organization","operationId":"get_organization_organizations__organization_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["organizations"],"summary":"Update Organization","operationId":"update_organization_organizations__organization_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["organizations"],"summary":"Delete Organization","operationId":"delete_organization_organizations__organization_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users":{"post":{"tags":["users"],"summary":"Create User","description":"Create a user.\n\nTwo modes, and only two:\n\n* **Authenticated** — a member of an organization adds another user to\n  *their own* organization. A payload naming a different one is a ``403``:\n  ownership has been validated and the answer is no.\n* **Anonymous onboarding** — the first user of an organization that has\n  none. Without this an organization could never be claimed, since there\n  would be nobody able to authenticate for it. Every other anonymous case\n  is a ``401``, and deliberately indistinguishable from \"no such\n  organization\", so the endpoint cannot be used to enumerate tenants.","operationId":"create_user_users_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["users"],"summary":"List Users","description":"List the caller's organization's users.\n\nThere is no ``organization_id`` parameter. One that was accepted and then\nignored would be worse than none at all: the API would document a filter it\ndoes not honour, and a reviewer would have to read the handler to find out.","operationId":"list_users_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponse"},"title":"Response List Users Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}":{"get":{"tags":["users"],"summary":"Get User","operationId":"get_user_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["users"],"summary":"Update User","operationId":"update_user_users__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Delete User","operationId":"delete_user_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Read Current User","operationId":"read_current_user_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","description":"Redeem a refresh token for a new pair. The presented token is spent.","operationId":"refresh_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents":{"post":{"tags":["documents"],"summary":"Upload Document","operationId":"upload_document_documents_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["documents"],"summary":"List Documents","operationId":"list_documents_documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DocumentStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}":{"get":{"tags":["documents"],"summary":"Get Document","operationId":"get_document_documents__document_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["documents"],"summary":"Update Document","description":"Switch a document on or off for answering.\n\nThe only mutable field. Status belongs to the processing pipeline and is\nnot settable here — a document cannot be talked into being `processed`.","operationId":"update_document_documents__document_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["documents"],"summary":"Delete Document","operationId":"delete_document_documents__document_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/process":{"post":{"tags":["processing"],"summary":"Process Document","operationId":"process_document_documents__document_id__process_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingResultResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/content":{"get":{"tags":["processing"],"summary":"Get Document Content","operationId":"get_document_content_documents__document_id__content_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingResultResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/chunk":{"post":{"tags":["chunking"],"summary":"Chunk Document","operationId":"chunk_document_documents__document_id__chunk_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/chunks":{"get":{"tags":["chunking"],"summary":"List Chunks","operationId":"list_chunks_documents__document_id__chunks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/chunks/{chunk_index}":{"get":{"tags":["chunking"],"summary":"Get Chunk","operationId":"get_chunk_documents__document_id__chunks__chunk_index__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"chunk_index","in":"path","required":true,"schema":{"type":"integer","minimum":0,"title":"Chunk Index"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChunkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/embed":{"post":{"tags":["embeddings"],"summary":"Embed Document","operationId":"embed_document_documents__document_id__embed_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/embeddings":{"get":{"tags":["embeddings"],"summary":"Get Embeddings","operationId":"get_embeddings_documents__document_id__embeddings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/index":{"post":{"tags":["vector-store"],"summary":"Index Document","operationId":"index_document_documents__document_id__index_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["vector-store"],"summary":"Get Index Status","operationId":"get_index_status_documents__document_id__index_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["vector-store"],"summary":"Delete Index","operationId":"delete_index_documents__document_id__index_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/search":{"post":{"tags":["vector-store"],"summary":"Search","operationId":"search_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/retrieval":{"post":{"tags":["retrieval"],"summary":"Retrieve","operationId":"retrieve_retrieval_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/chat":{"post":{"tags":["chat"],"summary":"Chat","operationId":"chat_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/conversations/chat":{"post":{"tags":["conversations"],"summary":"Conversation Chat","operationId":"conversation_chat_conversations_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/conversations":{"get":{"tags":["conversations"],"summary":"List Conversations","operationId":"list_conversations_conversations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversations/{conversation_id}":{"get":{"tags":["conversations"],"summary":"Get Conversation","operationId":"get_conversation_conversations__conversation_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["conversations"],"summary":"Delete Conversation","operationId":"delete_conversation_conversations__conversation_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customers":{"post":{"tags":["customers"],"summary":"Create Customer","operationId":"create_customer_customers_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["customers"],"summary":"List Customers","description":"List and search the caller's organization's customers.\n\nFilters combine: every one supplied must match. ``total`` counts everything\nthat matched, not what this page returned.","operationId":"list_customers_customers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"description":"Match anywhere in the stored E.164 number.","title":"Phone Number"},"description":"Match anywhere in the stored E.164 number."},{"name":"full_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"description":"Case-insensitive partial match.","title":"Full Name"},"description":"Case-insensitive partial match."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CustomerStatus"},{"type":"null"}],"title":"Status"}},{"name":"preferred_language","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}],"title":"Preferred Language"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/customers/{customer_id}":{"get":{"tags":["customers"],"summary":"Get Customer","operationId":"get_customer_customers__customer_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["customers"],"summary":"Update Customer","operationId":"update_customer_customers__customer_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["customers"],"summary":"Delete Customer","description":"Deactivate a customer.\n\nReturns the customer rather than ``204``, and its status is ``INACTIVE``.\nNothing is removed — see :meth:`CustomerService.delete` for why a business's\ncustomer records must survive their relationship ending. The response body\nis what tells an honest client that this was a deactivation.","operationId":"delete_customer_customers__customer_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/balances/outstanding":{"get":{"tags":["balances"],"summary":"What the caller's customers still owe","description":"Every customer of the caller's organization who still owes it money.\n\nOne row per customer per currency, ordered by currency, then by largest\ndebt, then by identifier — the same deterministic order the conversational\nanswer uses. Currencies are never merged: a business selling in two of them\ngets two totals, and there is no field in the response that could hold a\nsum across them.\n\nA business owed nothing gets an empty statement and a ``200``. That is an\nanswer, not a missing resource.","operationId":"outstanding_balances_balances_outstanding_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutstandingBalancesRead"}}}}},"security":[{"HTTPBearer":[]}]}},"/inventory/stock":{"get":{"tags":["inventory"],"summary":"What the caller's business has in stock","description":"Every stocked product in the caller's catalogue, and how much there is.\n\nOldest catalogue entry first, which is the order the service already\nreturns so a listing does not move under somebody reading it.\n\n**A service is not stock and is not listed.** Nobody counts haircuts, so a\ncatalogue entry with no unit is left out — the rule Phase 5.8 established,\napplied by asking the service rather than by listing the catalogue here.\n\nA product that is catalogued but has never been received reads as zero\nrather than being absent: it belongs on a count sheet, and its absence from\nthe ledger is what the count is checking.","operationId":"stock_levels_inventory_stock_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLevelsRead"}}}}},"security":[{"HTTPBearer":[]}]}},"/business-hours":{"get":{"tags":["business-hours"],"summary":"When the caller's business is open","description":"The caller's whole week, Monday first.\n\nSeven days every time. A day the business has never configured is listed\nwith no periods and ``is_configured`` false — that is the absence of a\nstatement, not a claim to be shut, and scheduling already depends on\ntelling the two apart.\n\nA day may carry more than one period: a morning and an afternoon with a\nbreak between them are two intervals, not a contradiction.","operationId":"week_hours_business_hours_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeekHoursRead"}}}}},"security":[{"HTTPBearer":[]}]}},"/reporting/sales":{"get":{"tags":["reporting"],"summary":"What the caller's business sold in a period","description":"Confirmed and fulfilled orders in the period, totalled by currency.\n\nCurrencies are never merged: a business selling in two of them gets two\ntotals, and no field in the response could hold a sum across them. Amounts\nare integer minor units.\n\nA business that sold nothing gets an empty list of totals and a ``200``.\nThat is an answer, not a missing resource.\n\nRefuses with ``409`` when the business has not set a timezone — including\nwhen it has no profile at all, which is the same absence for the same\nreason.","operationId":"sales_report_reporting_sales_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ReportPeriod","description":"Which calendar period to report on. Required."},"description":"Which calendar period to report on. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesReportRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reporting/payments":{"get":{"tags":["reporting"],"summary":"What the caller's business took in a period","description":"Money received in the period, grouped by currency and by method.\n\nThe two groupings are the same money seen twice — what came in, and how it\narrived — not two different figures. Currencies are never merged, and\namounts are integer minor units.\n\n**Every payment in the window is counted, whatever its status.** That is\nReporting's own rule and it is not the same as an outstanding balance,\nwhich counts only what the business accepted; the two answer different\nquestions and this endpoint does not reconcile them.\n\nA business that took nothing gets empty lists and a ``200``. Refuses with\n``409`` when the business has not set a timezone.","operationId":"payment_report_reporting_payments_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ReportPeriod","description":"Which calendar period to report on. Required."},"description":"Which calendar period to report on. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentReportRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reporting/appointments":{"get":{"tags":["reporting"],"summary":"How the caller's diary stands for a period","description":"Appointments in the period, counted by lifecycle status.\n\n**A count, never a diary.** No appointment row is returned, so there is no\ncustomer, phone number, or note in the response — and no per-row service\nname to look up, which is what would make a list of appointments an N+1.\nOne statement answers this whatever the diary holds.\n\nCounted on **when the appointment is**, not when it was booked: one booked\nlast month for this Friday belongs to this week. That is why the window\ncovers the whole calendar period including the part still ahead.\n\nAn empty diary gets an empty list and a ``200``. Refuses with ``409`` when\nthe business has not set a timezone.","operationId":"appointment_report_reporting_appointments_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ReportPeriod","description":"Which calendar period to report on. Required."},"description":"Which calendar period to report on. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentReportRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reporting/inventory":{"get":{"tags":["reporting"],"summary":"What the caller's business has, now","description":"Every catalogue entry and what there is of it, now.\n\n**No period, and no timezone to refuse for.** Stock is a present fact\nrather than a range, so there is no calendar boundary to get right — the\nservice says so itself and takes neither argument. A business with no\nprofile at all still gets its stock.\n\n**This is not `GET /inventory/stock` twice.** That answers from\n`InventoryService.all_stock`, which lists stocked goods only — a service\nhas no unit and nobody counts haircuts. This is Reporting's own aggregate,\nwhich lists every catalogue entry and carries a null unit for the ones that\nare not stocked. A product that has never been received reads as zero\nrather than vanishing.\n\nQuantities are exact decimals, never floats.","operationId":"inventory_report_reporting_inventory_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryReportRead"}}}}},"security":[{"HTTPBearer":[]}]}},"/analytics/sales-trend":{"get":{"tags":["analytics"],"summary":"How the caller's sales compare with the period before","description":"Sales over the period, against the comparable period before it.\n\nThe earlier window is found by asking for the same *kind* of period at the\nlast instant before this one opens, so a month is compared with a calendar\nmonth and never with \"the previous thirty days\". The two windows are\nhalf-open and meet exactly, so no order is counted in both.\n\n**The figures say what changed, never why.** The operational record holds\nno reason a customer did or did not buy, so there is no field here for one.\n\nCurrencies are never merged, amounts are integer minor units, and a period\nthat began from nothing has a null percentage rather than a division by\nzero dressed up as precision.\n\nRefuses with ``409`` when the business has not set a timezone, including\nwhen it has no profile at all.","operationId":"sales_trend_analytics_sales_trend_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ReportPeriod","description":"Which calendar period to analyse. Required."},"description":"Which calendar period to analyse. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesTrendRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/busiest-days":{"get":{"tags":["analytics"],"summary":"Which weekdays carried the most work","description":"Orders and appointments in the period, counted by weekday.\n\nAlways seven days, Monday first. A weekday nothing happened on is a zero\nrather than an omission — \"we are never busy on Sunday\" is a finding, and\ndropping the row would hide it.\n\nRefuses with ``409`` when the business has not set a timezone.","operationId":"busiest_days_analytics_busiest_days_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ReportPeriod","description":"Which calendar period to analyse. Required."},"description":"Which calendar period to analyse. Required."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusiestDaysRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pricing":{"get":{"tags":["pricing"],"summary":"What the caller's business charges","description":"Every priced product in the caller's catalogue, and its current price.\n\nOldest catalogue entry first, which is the order the catalogue already\nreturns, so a listing does not move under somebody reading it.\n\nA product the business has not priced is **absent** rather than present\nwith a null amount: a price list carries prices, and \"we sell it but have\nnot priced it\" is a question for `/inventory/stock`.\n\nAmounts are exact decimals in the currency they were recorded in. Nothing\nhere converts between currencies or merges them.\n\nA business that has priced nothing gets an empty list and a ``200``. That is\nan answer, not a missing resource.","operationId":"price_list_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceListRead"}}}}},"security":[{"HTTPBearer":[]}]}},"/orders":{"get":{"tags":["orders"],"summary":"A page of the caller's own orders, newest first","description":"The caller's own orders, newest first.\n\n**Every rule here already existed.** The ordering is the one `recent_for`\nuses — `created_at` descending, identifier breaking ties — so a page is\ndeterministic. The paging is the `limit`/`offset`/`total` contract\n`/customers` and `/users` already enforce, with the same bounds. The fields\nare `OrderSummary`'s, minus the lines that `/orders/{reference}` carries.\n\n**`MAX_LISTED` is not reused.** Its comment says it is how many past orders\n\"a customer is shown when they ask\" — a WhatsApp reply limit, and not a\nrule about how many records an HTTP caller may page through.\n\n**No window and no filters.** No collection endpoint in this API takes a\ndate range, and adding one for orders would be a business rule nobody has\nstated. Filtering by reference is not offered either: that question is\nalready answered by `/orders/{reference}`.\n\n`total` counts every order the business has, not what this page returned.","operationId":"list_orders_orders_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderListRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orders/{reference}":{"get":{"tags":["orders"],"summary":"One of the caller's own orders, by its reference","description":"The order this reference names, within the caller's own business.\n\nEvery line is returned; an order with a line missing is an order nobody can\nreconcile. A draft that has not been priced reports a null total and null\nline prices rather than zeros — \"not decided yet\" and \"free\" are different\nthings.\n\nA reference the caller's organization does not have is a ``404``, whether\nit belongs to another business or to nobody.","operationId":"read_order_orders__reference__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string","title":"Reference"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payments/{reference}":{"get":{"tags":["payments"],"summary":"One of the caller's own payments, by its reference","description":"The payment this reference names, within the caller's own business.\n\nThe lifecycle stamps come back as recorded: `confirmed_at` is null until\nthe business accepted the money, and `cancelled_at` and `refunded_at` stay\nnull unless those things happened. A `REQUESTED` payment is a claim the\nbusiness has not yet accepted, which is exactly what a reconciliation needs\nto be able to see.\n\nAmounts are integer minor units. A reference the caller's organization does\nnot have is a ``404``, whether it belongs to another business or to nobody.","operationId":"read_payment_payments__reference__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string","title":"Reference"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/appointments/{reference}":{"get":{"tags":["appointments"],"summary":"One of the caller's own appointments, by its reference","description":"The appointment this reference names, within the caller's own business.\n\nCarries the zone it was booked in as well as the instants: an appointment\nis a time somebody has to turn up, and the instant alone would not say when\nthat is for them.\n\nA cancelled or completed appointment still reads back — the record of the\none that did not happen is often exactly what support needs.\n\nA reference the caller's organization does not have is a ``404``, whether\nit belongs to another business or to nobody.","operationId":"read_appointment_appointments__reference__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string","title":"Reference"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notifications/templates":{"post":{"tags":["notifications"],"summary":"Create Template","description":"Write a template and its first version, both active.\n\nThe name is how a capability asks for it — `appointment-reminder` and\n`payment-reminder` are the two the reminder capabilities send — so it is\nthe caller's to choose and must be unique within the organization.","operationId":"create_template_notifications_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateWithVersionsRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/notifications/templates/{name}":{"get":{"tags":["notifications"],"summary":"Read Template","description":"A template and every version of it, newest last.\n\nScoped to the caller's organization, so a name another business uses is\nindistinguishable from a name nobody uses.","operationId":"read_template_notifications_templates__name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateWithVersionsRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notifications/templates/{name}/versions":{"post":{"tags":["notifications"],"summary":"Add Version","description":"New words for an existing template.\n\nThe previous version is retired rather than rewritten, so a notification\nalready sent still reads as it was sent.","operationId":"add_version_notifications_templates__name__versions_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateVersionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateVersionRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/whatsapp/accounts":{"post":{"tags":["channels"],"summary":"Register a business number to the caller's organization","description":"Map a WhatsApp business number to the caller's own organization.\n\nThis is what makes a business reachable. Until its number is registered\nevery inbound message is dropped, because the gateway resolves the tenant\nfrom the number and has nothing to resolve it to.\n\n**The organization is the caller's, and is not a parameter.** It comes from\nthe authenticated principal, so there is no field a client could set to\nregister a number against somebody else. The provider comes from the route,\nwhich is why an unsupported one is a 404 rather than a value to validate.\n\nThe account is attributed to the calling user, which is the organization\nuser channel conversations are recorded under.\n\nNothing here contacts Meta. Registering a number is a local mapping; the\nprovider credential is deployment configuration and never travels through\nthis request.","operationId":"register_account_channels_whatsapp_accounts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/channels/whatsapp/webhook":{"get":{"tags":["channels"],"summary":"Meta webhook subscription handshake","description":"Echo Meta's challenge back, proving we hold the verify token.\n\nThe challenge is returned as plain text with no envelope: Meta compares the\nbody byte for byte, and a JSON wrapper fails the subscription.","operationId":"verify_webhook_channels_whatsapp_webhook_get","parameters":[{"name":"hub.mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub.Mode"}},{"name":"hub.verify_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub.Verify Token"}},{"name":"hub.challenge","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hub.Challenge"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Meta webhook events","description":"Receive one webhook delivery: messages, delivery statuses, or both.","operationId":"receive_webhook_channels_whatsapp_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}}}}},"/onboarding/begin":{"post":{"tags":["onboarding"],"summary":"Begin Onboarding","description":"Ask the first question, or repeat the one a paused conversation stopped on.\n\nNot `201`: starting twice is resuming, and the second call creates nothing.","operationId":"begin_onboarding_onboarding_begin_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingBegin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingTurnRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/answer":{"post":{"tags":["onboarding"],"summary":"Answer Onboarding","description":"Take one answer and return the next thing Sabimee says.\n\nAn answer that could not be understood is a `200` with ``understood`` false\nand the same step — it is a normal turn of a conversation, not a client\nerror, and a `422` would tell the owner they had made a mistake.","operationId":"answer_onboarding_onboarding_answer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingAnswer"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingTurnRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/status":{"post":{"tags":["onboarding"],"summary":"Onboarding Status","description":"Where a conversation stands. A `POST` so the number stays out of the URL.","operationId":"onboarding_status_onboarding_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingBegin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingSessionRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/profile":{"get":{"tags":["onboarding"],"summary":"Read Business Profile","description":"The authenticated caller's own business profile.\n\nThe organization comes from the token and never from the request, so there\nis no tenant to name and nothing to forge — the same rule the customers and\nusers APIs follow.\n\nAny member may read the profile. The owner's own phone number is withheld\nfrom everyone but the ``owner``: it is a person's number, and it is the\nnumber WhatsApp owner commands are authorized by.","operationId":"read_business_profile_onboarding_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessProfileRead"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["onboarding"],"summary":"Update Business Profile","description":"Change fields of the caller's own business profile. Owner only.\n\nOnly the fields in the body are touched; ``business_phone`` and\n``owner_email`` may be cleared with ``null``. Every value goes through the\nparser onboarding uses, and one unusable value refuses the whole request\nwith nothing written. The organization comes from the token, so there is no\ntenant to name. Each changed field is audited by name, never by value.\n\nThe business's name, public phone, email and reply language also need the\nowner's ``current_password`` — checked before anything is parsed or\nwritten, throttled per user, and never logged or echoed.","operationId":"update_business_profile_onboarding_profile_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessProfileSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/knowledge":{"post":{"tags":["knowledge"],"summary":"Create Knowledge","operationId":"create_knowledge_knowledge_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["knowledge"],"summary":"List Knowledge","operationId":"list_knowledge_knowledge_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeKind"},{"type":"null"}],"title":"Kind"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeStatus"},{"type":"null"}],"title":"Status"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeSource"},{"type":"null"}],"title":"Source"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledge/{record_id}":{"get":{"tags":["knowledge"],"summary":"Get Knowledge","operationId":"get_knowledge_knowledge__record_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["knowledge"],"summary":"Update Knowledge","description":"Correct a record, or switch it on or off.\n\nActivation is a ``status`` change rather than its own endpoint, so there is\none path that writes state and it cannot drift from another that also does.","operationId":"update_knowledge_knowledge__record_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Record Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["knowledge"],"summary":"Delete Knowledge","operationId":"delete_knowledge_knowledge__record_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"record_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Record Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AppointmentRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"reference":{"type":"string","title":"Reference"},"status":{"$ref":"#/components/schemas/AppointmentStatus"},"service":{"type":"string","title":"Service"},"scheduled_start":{"type":"string","format":"date-time","title":"Scheduled Start"},"scheduled_end":{"type":"string","format":"date-time","title":"Scheduled End"},"timezone":{"type":"string","title":"Timezone"}},"type":"object","required":["id","reference","status","service","scheduled_start","scheduled_end","timezone"],"title":"AppointmentRead","description":"One appointment, in the shape the domain already publishes."},"AppointmentReportRead":{"properties":{"window":{"$ref":"#/components/schemas/sabimee_api__reporting__schemas__WindowRead"},"counts":{"items":{"$ref":"#/components/schemas/StatusCountRead"},"type":"array","title":"Counts"}},"type":"object","required":["window","counts"],"title":"AppointmentReportRead","description":"How the diary stands for the period, counted by status.\n\n**A count, never a diary.** There is no appointment row here, and so no\ncustomer, no phone number, and no note — and no per-row service-name\nlookup, which is what makes an appointment *list* an N+1 and this an\naggregate that costs one statement.\n\nThe dataclass also derives a `total`; it is not published, because nothing\nin the repository presents one and a client summing the counts gets the\nsame number from the same place."},"AppointmentStatus":{"type":"string","enum":["REQUESTED","CONFIRMED","COMPLETED","CANCELLED"],"title":"AppointmentStatus","description":"Where an appointment is in its life."},"Body_upload_document_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_document_documents_post"},"BusiestDaysRead":{"properties":{"window":{"$ref":"#/components/schemas/sabimee_api__analytics__schemas__WindowRead"},"days":{"items":{"$ref":"#/components/schemas/DayActivityRead"},"type":"array","title":"Days"}},"type":"object","required":["window","days"],"title":"BusiestDaysRead","description":"Which days carried the most work.\n\nAlways seven days, Monday first. A quiet day is a zero rather than an\nomission, so nothing to paginate and nothing a page could leave out."},"BusinessProfileRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"business_name":{"type":"string","title":"Business Name"},"business_type":{"$ref":"#/components/schemas/BusinessType"},"country_code":{"type":"string","title":"Country Code"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"preferred_language":{"$ref":"#/components/schemas/Language"},"owner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Name"},"owner_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Phone Number"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"employee_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Employee Count"},"offerings":{"items":{"type":"string"},"type":"array","title":"Offerings"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","business_name","business_type","country_code","timezone","preferred_language","owner_name","owner_phone_number","owner_email","employee_count","offerings","created_at","updated_at"],"title":"BusinessProfileRead","description":"The business Sabimee now knows about.\n\nOptional exactly where the column is. WhatsApp onboarding never asks for the\nowner's name, the head count, or (when skipped) the timezone, so a profile it\ncreated holds ``NULL`` there — and a read that demanded values would fail on\nevery such business rather than report what is known.\n\n``owner_phone_number`` is the owner's own number, and the number WhatsApp\nowner commands are authorized by. It is returned to the organization's\n``owner`` only; every other member reads ``null``."},"BusinessProfileSettings":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"business_type":{"$ref":"#/components/schemas/BusinessType"},"country_code":{"type":"string","title":"Country Code"},"state_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Region"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"business_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Phone"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"business_hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Hours"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"preferred_language":{"$ref":"#/components/schemas/Language"},"offerings":{"items":{"type":"string"},"type":"array","title":"Offerings"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"changed":{"items":{"type":"string"},"type":"array","title":"Changed"}},"type":"object","required":["id","business_name","business_type","country_code","state_region","city","business_phone","owner_email","business_hours","timezone","preferred_language","offerings","updated_at"],"title":"BusinessProfileSettings","description":"The profile as the owner API returns it after a change.\n\nDeliberately not :class:`BusinessProfileRead`: it leaves out the owner's own\nphone number, and it tolerates the fields WhatsApp onboarding never asks for."},"BusinessProfileUpdate":{"properties":{"business_name":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Business Name"},"business_type":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Business Type"},"country_code":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Country Code"},"state_region":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"State Region"},"city":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"City"},"business_phone":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Business Phone"},"owner_email":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Owner Email"},"business_hours":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Business Hours"},"timezone":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Timezone"},"preferred_language":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Preferred Language"},"offerings":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Offerings"},"current_password":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Current Password"}},"additionalProperties":false,"type":"object","title":"BusinessProfileUpdate","description":"A partial change to the caller's own business profile.\n\nOnly the fields present in the body are touched. Unknown fields are refused,\nand so is ``null`` for anything outside :data:`CLEARABLE_PROFILE_FIELDS`.\nThe bounds here only keep an oversized body away from the parsers; whether a\nvalue is *usable* is decided by the same parsers onboarding uses."},"BusinessType":{"type":"string","enum":["RETAIL","FOOD","FASHION","BEAUTY","SERVICES","HEALTH","EDUCATION","LOGISTICS","OTHER"],"title":"BusinessType","description":"What kind of business this is.\n\nClosed, for the same reason the language enum is closed: a free-text\nindustry cannot be reported on and accumulates four spellings of \"retail\".\n``other`` is a real answer here rather than a fallback — it is chosen by an\nowner who says so, never assigned because a parser gave up."},"ChannelAccountCreate":{"properties":{"phone_number_id":{"type":"string","maxLength":64,"minLength":1,"title":"Phone Number Id"},"display_phone_number":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Display Phone Number"}},"type":"object","required":["phone_number_id"],"title":"ChannelAccountCreate","description":"A business number to register against the caller's own organization.\n\nThere is no `organization_id` here on purpose: the tenant comes from the\nauthenticated caller, and a field a client could set would be a field a\nclient could point at somebody else.\n\nNo credential appears either. The provider's token is deployment\nconfiguration (`WHATSAPP_ACCESS_TOKEN`), never per-request input — a secret\nthat travelled through an API would end up in a log or a client's history."},"ChannelAccountRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"provider":{"type":"string","title":"Provider"},"phone_number_id":{"type":"string","title":"Phone Number Id"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"agent_user_id":{"type":"string","format":"uuid","title":"Agent User Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","organization_id","provider","phone_number_id","display_phone_number","agent_user_id","status"],"title":"ChannelAccountRead","description":"A registered business number.\n\nCarries no credential and no other organization's data. `agent_user_id` is\nthe organization's own user that channel conversations are attributed to."},"ChatRequest":{"properties":{"message":{"type":"string","maxLength":4096,"minLength":1,"title":"Message"},"top_k":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Top K"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"}},"type":"object","required":["message"],"title":"ChatRequest"},"ChatResponse":{"properties":{"response":{"type":"string","title":"Response"},"citations":{"items":{"$ref":"#/components/schemas/Citation"},"type":"array","title":"Citations"},"sources":{"items":{"$ref":"#/components/schemas/ChatSource"},"type":"array","title":"Sources"},"model":{"type":"string","title":"Model"},"usage":{"$ref":"#/components/schemas/ChatUsage"},"confidence":{"type":"number","title":"Confidence"},"elapsed_ms":{"type":"integer","title":"Elapsed Ms"}},"type":"object","required":["response","citations","sources","model","usage","confidence","elapsed_ms"],"title":"ChatResponse"},"ChatSource":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"chunk_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Chunk Ids"}},"type":"object","required":["document_id","chunk_ids"],"title":"ChatSource","description":"A document the answer was grounded in, and which chunks were used."},"ChatUsage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens"},"completion_tokens":{"type":"integer","title":"Completion Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"}},"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"title":"ChatUsage"},"ChunkResponse":{"properties":{"chunk_index":{"type":"integer","title":"Chunk Index"},"chunk_text":{"type":"string","title":"Chunk Text"},"character_count":{"type":"integer","title":"Character Count"},"token_count":{"type":"integer","title":"Token Count"},"start_offset":{"type":"integer","title":"Start Offset"},"end_offset":{"type":"integer","title":"End Offset"}},"type":"object","required":["chunk_index","chunk_text","character_count","token_count","start_offset","end_offset"],"title":"ChunkResponse","description":"A single chunk, addressed by its index within the document."},"ChunkSummaryResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"chunk_count":{"type":"integer","title":"Chunk Count"},"total_characters":{"type":"integer","title":"Total Characters"},"estimated_tokens":{"type":"integer","title":"Estimated Tokens"}},"type":"object","required":["document_id","chunk_count","total_characters","estimated_tokens"],"title":"ChunkSummaryResponse","description":"Aggregate view of a document's chunk set — never the chunks themselves."},"Citation":{"properties":{"citation_id":{"type":"string","title":"Citation Id"},"source":{"$ref":"#/components/schemas/ContextSourceType","default":"DOCUMENT"},"document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Document Id"},"knowledge_record_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Record Id"},"knowledge_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Title"},"chunk_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Chunk Ids"},"similarity_score":{"type":"number","title":"Similarity Score"}},"type":"object","required":["citation_id","similarity_score"],"title":"Citation","description":"One grounded reference behind an answer.\n\nMirrors :class:`~sabimee_api.retrieval.schemas.ContextSection`: exactly one\nidentifier, agreeing with ``source``. A knowledge citation carries the\nrecord's ``title`` instead of chunk ids, because a record is one unit and\nnaming it in the owner's own words is more useful to a reader than an\nidentifier — and safe if it is ever shown."},"ContextSection":{"properties":{"source":{"$ref":"#/components/schemas/ContextSourceType","default":"DOCUMENT"},"document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Document Id"},"knowledge_record_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Knowledge Record Id"},"knowledge_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Title"},"chunk_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Chunk Ids"},"similarity_score":{"type":"number","title":"Similarity Score"},"chunk_text":{"type":"string","title":"Chunk Text"}},"type":"object","required":["similarity_score","chunk_text"],"title":"ContextSection","description":"A stretch of retrieved text, and where it came from.\n\nFor a document this is a contiguous run of chunks: ``chunk_ids`` holds every\nchunk merged into the section, in reading order, and ``similarity_score`` is\nthe best score among them. For a knowledge record it is the record itself —\none record is one retrievable unit, so there are no chunks and the score is\nthe record's own.\n\n**Exactly one identifier is set, and it must agree with ``source``.** The\nsame shape ``knowledge_records`` uses for its two authors, and for the same\nreason: a section whose provenance nobody can state is worse than no section.\n``source`` defaults to ``document`` so that every caller written before\nstructured knowledge existed keeps working unchanged."},"ContextSourceType":{"type":"string","enum":["DOCUMENT","STRUCTURED_KNOWLEDGE"],"title":"ContextSourceType","description":"Where a piece of retrieved context came from.\n\nTwo values, and there is no third today: business memories are answered by\ntheir own capability and never reach retrieval, and prices are answered by\n``PricingCapability`` before retrieval is consulted."},"ConversationChatRequest":{"properties":{"conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Conversation Id"},"message":{"type":"string","maxLength":4096,"minLength":1,"title":"Message"},"top_k":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Top K"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"}},"type":"object","required":["message"],"title":"ConversationChatRequest"},"ConversationChatResponse":{"properties":{"conversation_id":{"type":"string","format":"uuid","title":"Conversation Id"},"response":{"type":"string","title":"Response"},"citations":{"items":{"$ref":"#/components/schemas/Citation"},"type":"array","title":"Citations"},"sources":{"items":{"$ref":"#/components/schemas/ChatSource"},"type":"array","title":"Sources"},"usage":{"$ref":"#/components/schemas/ChatUsage"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["conversation_id","response","citations","sources","usage","confidence"],"title":"ConversationChatResponse"},"ConversationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"messages":{"items":{"$ref":"#/components/schemas/ConversationMessageResponse"},"type":"array","title":"Messages"}},"type":"object","required":["id","title","created_at","updated_at","messages"],"title":"ConversationDetail","description":"A conversation with its messages, oldest first."},"ConversationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ConversationSummary"},"type":"array","title":"Items"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","limit","offset"],"title":"ConversationListResponse"},"ConversationMessageResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"role":{"$ref":"#/components/schemas/MessageRole"},"content":{"type":"string","title":"Content"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"prompt_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prompt Tokens"},"completion_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completion Tokens"},"total_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Tokens"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","role","content","model","prompt_tokens","completion_tokens","total_tokens","created_at"],"title":"ConversationMessageResponse"},"ConversationSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"message_count":{"type":"integer","title":"Message Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","title","message_count","created_at","updated_at"],"title":"ConversationSummary","description":"A conversation in a list — no messages."},"CurrencyMovementRead":{"properties":{"currency":{"type":"string","title":"Currency"},"now_minor":{"type":"integer","title":"Now Minor"},"before_minor":{"type":"integer","title":"Before Minor"},"now_orders":{"type":"integer","title":"Now Orders"},"before_orders":{"type":"integer","title":"Before Orders"},"change_minor":{"type":"integer","title":"Change Minor"},"percentage":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Percentage"}},"type":"object","required":["currency","now_minor","before_minor","now_orders","before_orders","change_minor","percentage"],"title":"CurrencyMovementRead","description":"How one currency's takings compare with the period before."},"CurrentPriceRead":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id"},"name":{"type":"string","title":"Name"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"currency":{"type":"string","title":"Currency"},"effective_from":{"type":"string","format":"date-time","title":"Effective From"}},"type":"object","required":["product_id","name","amount","currency","effective_from"],"title":"CurrentPriceRead","description":"What one product costs now."},"CustomerBalanceRead":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"name":{"type":"string","title":"Name"},"currency":{"type":"string","title":"Currency"},"ordered_minor":{"type":"integer","title":"Ordered Minor"},"paid_minor":{"type":"integer","title":"Paid Minor"},"outstanding_minor":{"type":"integer","title":"Outstanding Minor"},"orders":{"type":"integer","title":"Orders"}},"type":"object","required":["customer_id","name","currency","ordered_minor","paid_minor","outstanding_minor","orders"],"title":"CustomerBalanceRead","description":"One customer's debt, in one currency."},"CustomerCreate":{"properties":{"phone_number":{"type":"string","maxLength":20,"minLength":3,"title":"Phone Number"},"country_code":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country Code"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"preferred_language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]},"customer_type":{"$ref":"#/components/schemas/CustomerType","default":"INDIVIDUAL"},"status":{"$ref":"#/components/schemas/CustomerStatus","default":"ACTIVE"},"email":{"anyOf":[{"type":"string","maxLength":320,"pattern":"^[^@\\s]+@[^@\\s.]+(?:\\.[^@\\s.]+)+$"},{"type":"null"}],"title":"Email"},"date_of_birth":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date Of Birth"},"gender":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Gender"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Notes"},"tags":{"items":{"type":"string"},"type":"array","maxItems":32,"title":"Tags"}},"type":"object","required":["phone_number"],"title":"CustomerCreate","description":"A new customer.\n\n``organization_id`` is absent on purpose: the tenant comes from the\nauthenticated caller, exactly as it does for users and documents. A field a\nclient could set would be a field a client could forge."},"CustomerListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"CustomerListResponse","description":"A page of customers.\n\nThe total is included because a customer list is something a business owner\npages through, and \"1–50 of 3\" versus \"1–50 of 3,000\" is the difference\nbetween a finished screen and an unusable one."},"CustomerResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"phone_number":{"type":"string","title":"Phone Number"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"preferred_language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]},"detected_language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]},"customer_type":{"$ref":"#/components/schemas/CustomerType"},"status":{"$ref":"#/components/schemas/CustomerStatus"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"date_of_birth":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date Of Birth"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"first_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Seen At"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"conversation_count":{"type":"integer","title":"Conversation Count"},"lifetime_value":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Lifetime Value"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","phone_number","country_code","full_name","preferred_language","detected_language","customer_type","status","email","date_of_birth","gender","notes","tags","first_seen_at","last_seen_at","conversation_count","lifetime_value","created_at","updated_at"],"title":"CustomerResponse"},"CustomerStatus":{"type":"string","enum":["ACTIVE","INACTIVE","BLOCKED"],"title":"CustomerStatus","description":"Whether the organization is currently doing business with them.\n\n``inactive`` is also what a deleted customer becomes: customers are never\nphysically removed, because orders, invoices, and payments will reference\nthem and a business's records must not develop holes."},"CustomerType":{"type":"string","enum":["INDIVIDUAL","BUSINESS","VIP","EMPLOYEE"],"title":"CustomerType","description":"What kind of counterparty this customer is."},"CustomerUpdate":{"properties":{"phone_number":{"anyOf":[{"type":"string","maxLength":20,"minLength":3},{"type":"null"}],"title":"Phone Number"},"country_code":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Country Code"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"},"preferred_language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]},"customer_type":{"anyOf":[{"$ref":"#/components/schemas/CustomerType"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/CustomerStatus"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":320,"pattern":"^[^@\\s]+@[^@\\s.]+(?:\\.[^@\\s.]+)+$"},{"type":"null"}],"title":"Email"},"date_of_birth":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date Of Birth"},"gender":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Gender"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Notes"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Tags"}},"type":"object","title":"CustomerUpdate","description":"A partial update. Every field is optional; absent means \"leave alone\".\n\n``detected_language`` is not updatable through the API. It records what a\ndetector observed, and a value typed in by hand would be neither observed\nnor a preference — that is what ``preferred_language`` is for."},"DayActivityRead":{"properties":{"weekday":{"type":"integer","title":"Weekday"},"name":{"type":"string","title":"Name"},"appointments":{"type":"integer","title":"Appointments"},"orders":{"type":"integer","title":"Orders"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["weekday","name","appointments","orders","total"],"title":"DayActivityRead","description":"How busy one weekday was."},"DayHoursRead":{"properties":{"day":{"type":"string","title":"Day"},"is_configured":{"type":"boolean","title":"Is Configured"},"intervals":{"items":{"$ref":"#/components/schemas/IntervalRead"},"type":"array","title":"Intervals"}},"type":"object","required":["day","is_configured","intervals"],"title":"DayHoursRead","description":"One day of the week, whether or not anything was ever said about it."},"DocumentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DocumentResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"DocumentListResponse"},"DocumentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"uploaded_by":{"type":"string","format":"uuid","title":"Uploaded By"},"filename":{"type":"string","title":"Filename"},"original_filename":{"type":"string","title":"Original Filename"},"content_type":{"type":"string","title":"Content Type"},"file_size":{"type":"integer","title":"File Size"},"checksum_sha256":{"type":"string","title":"Checksum Sha256"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","uploaded_by","filename","original_filename","content_type","file_size","checksum_sha256","status","is_active","created_at","updated_at"],"title":"DocumentResponse"},"DocumentStatus":{"type":"string","enum":["uploaded","processing","processed","failed"],"title":"DocumentStatus","description":"How far the processing pipeline got. Written only by the pipeline.\n\nWhether a business still wants to be answered from the document is a\nseparate question, and is ``is_active`` — see the model."},"DocumentUpdate":{"properties":{"is_active":{"type":"boolean","title":"Is Active"}},"additionalProperties":false,"type":"object","required":["is_active"],"title":"DocumentUpdate","description":"The one thing a person may change about a stored document.\n\n``extra=\"forbid\"``, so ``{\"status\": \"processed\"}`` is a 422 rather than a\nfield quietly ignored. Processing status belongs to the pipeline, and a\nrequest that appears to set it and does not would be worse than one that\ncannot: the caller would believe it worked."},"EmbeddingSummaryResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"embedding_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Embedding Model"},"dimensions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dimensions"},"embedded_chunk_count":{"type":"integer","title":"Embedded Chunk Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["document_id","embedding_model","dimensions","embedded_chunk_count","created_at"],"title":"EmbeddingSummaryResponse","description":"Aggregate view of a document's embeddings — never the vectors."},"ExtractionMethod":{"type":"string","enum":["pdfplumber","python-docx","utf8"],"title":"ExtractionMethod"},"FigureConflictReport":{"properties":{"knowledge_record_id":{"type":"string","format":"uuid","title":"Knowledge Record Id"},"knowledge_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Title"},"document_id":{"type":"string","format":"uuid","title":"Document Id"},"knowledge_figures":{"items":{"type":"string"},"type":"array","title":"Knowledge Figures"},"document_figures":{"items":{"type":"string"},"type":"array","title":"Document Figures"}},"type":"object","required":["knowledge_record_id","knowledge_title","document_id","knowledge_figures","document_figures"],"title":"FigureConflictReport","description":"A disagreement about a number, for an owner to resolve later."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IndexStatusResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"indexed_chunks":{"type":"integer","title":"Indexed Chunks"},"embedding_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Embedding Model"},"dimensions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dimensions"},"indexed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Indexed At"}},"type":"object","required":["document_id","indexed_chunks","embedding_model","dimensions","indexed_at"],"title":"IndexStatusResponse","description":"How much of a document is in the vector index."},"IntervalRead":{"properties":{"opens_at":{"type":"string","format":"time","title":"Opens At"},"closes_at":{"type":"string","format":"time","title":"Closes At"}},"type":"object","required":["opens_at","closes_at"],"title":"IntervalRead","description":"One period a business is open, in its own local time."},"InventoryReportRead":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/StockLineRead"},"type":"array","title":"Lines"}},"type":"object","required":["lines"],"title":"InventoryReportRead","description":"What there is, now.\n\n**Carries no window**, because the report carries no period: stock is a\npresent fact rather than a range, so there is no calendar boundary to\nresolve and nothing to refuse a business for.\n\n**This is not `GET /inventory/stock` twice.** That endpoint answers from\n`InventoryService.all_stock`, which lists only stocked goods — a service\nhas no unit and nobody counts haircuts. This one is Reporting's own\naggregate, which lists every catalogue entry and carries a null unit for\nthe ones that are not stocked. Two questions, two answers, and the\ndifference is in the `unit` field rather than hidden."},"KnowledgeCreate":{"properties":{"kind":{"$ref":"#/components/schemas/KnowledgeKind"},"title":{"type":"string","maxLength":255,"minLength":1,"title":"Title"},"body":{"type":"string","maxLength":4000,"minLength":1,"title":"Body"},"status":{"$ref":"#/components/schemas/KnowledgeStatus","default":"draft"}},"additionalProperties":false,"type":"object","required":["kind","title","body"],"title":"KnowledgeCreate","description":"A new record. Starts as a draft unless the caller says otherwise."},"KnowledgeKind":{"type":"string","enum":["faq","policy","procedure"],"title":"KnowledgeKind","description":"What a record *is*. Three kinds, and deliberately not a fourth.\n\nAn instruction — \"never promise same-day delivery\" — is not here. It governs\nhow answers are produced rather than being one, and it is kept out of\nanything retrievable on purpose."},"KnowledgeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/KnowledgeResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"KnowledgeListResponse"},"KnowledgeResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"kind":{"$ref":"#/components/schemas/KnowledgeKind"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"status":{"$ref":"#/components/schemas/KnowledgeStatus"},"source":{"$ref":"#/components/schemas/KnowledgeSource"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"created_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By User Id"},"created_by_customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By Customer Id"},"updated_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By User Id"},"updated_by_customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Updated By Customer Id"},"conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Conversation Id"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","kind","title","body","status","source","language","created_by_user_id","created_by_customer_id","updated_by_user_id","updated_by_customer_id","conversation_id","version","created_at","updated_at"],"title":"KnowledgeResponse","description":"One record, with everything an owner needs to judge it.\n\nDeliberately in business terms: what it says, what kind of thing it is,\nwhere it came from, whether it is in use, when it changed and who changed\nit. No embedding, no vector, no score."},"KnowledgeSource":{"type":"string","enum":["owner","admin","conversational","uploaded_document"],"title":"KnowledgeSource","description":"Which door a record came through.\n\n``owner`` and ``admin`` record the role of the API author *at the time of\nwriting*: a historical fact that does not change when their role later does,\nwhich is why it is stored rather than derived from the user row.\n\n``uploaded_document`` is reserved for a record derived from a file. Nothing\ncreates one today — Sabimee does not infer policy from prose — and it is\nnamed here so that the vocabulary is stated rather than invented later."},"KnowledgeStatus":{"type":"string","enum":["draft","active","inactive"],"title":"KnowledgeStatus","description":"Where a record is in its life.\n\n``draft`` is the one that carries weight: a record captured from a\nconversation stays here until its author confirms it, and nothing in\n``draft`` is ever answered from."},"KnowledgeUpdate":{"properties":{"kind":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeKind"},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string","maxLength":4000,"minLength":1},{"type":"null"}],"title":"Body"},"status":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeStatus"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"KnowledgeUpdate","description":"A correction, or a change of state.\n\n``extra=\"forbid\"``, so a request naming a field this does not accept — a\n``source``, an ``organization_id``, an author — is a ``422`` rather than a\nvalue quietly discarded. Provenance is recorded, never supplied."},"Language":{"type":"string","enum":["ENGLISH","PIDGIN","YORUBA","IGBO","HAUSA"],"title":"Language","description":"The languages Sabimee supports in version 1.\n\nClosed by design. A free-text language field cannot be routed on, cannot be\nreported on, and quietly accumulates 'english', 'English', 'eng', and 'en'\nas four different languages. Adding one here is a deliberate change with a\nmigration behind it.\n\nNigerian Pidgin is a language in its own right, not broken English, and is\nlisted as one."},"LoginRequest":{"properties":{"email":{"type":"string","maxLength":320,"minLength":1,"title":"Email"},"password":{"type":"string","maxLength":128,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MessageRole":{"type":"string","enum":["user","assistant"],"title":"MessageRole"},"MethodTotalRead":{"properties":{"currency":{"type":"string","title":"Currency"},"method":{"type":"string","title":"Method"},"count":{"type":"integer","title":"Count"},"amount_minor":{"type":"integer","title":"Amount Minor"}},"type":"object","required":["currency","method","count","amount_minor"],"title":"MethodTotalRead","description":"How much came in one way, in one currency."},"NotificationChannel":{"type":"string","enum":["WHATSAPP"],"title":"NotificationChannel","description":"A channel a notification can be delivered over."},"OnboardingAnswer":{"properties":{"phone_number":{"type":"string","maxLength":32,"minLength":1,"title":"Phone Number"},"text":{"type":"string","maxLength":1000,"minLength":1,"title":"Text"}},"type":"object","required":["phone_number","text"],"title":"OnboardingAnswer","description":"One answer, exactly as the owner wrote it."},"OnboardingBegin":{"properties":{"phone_number":{"type":"string","maxLength":32,"minLength":1,"title":"Phone Number"}},"type":"object","required":["phone_number"],"title":"OnboardingBegin","description":"Start, or resume, the conversation for a number."},"OnboardingSessionRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"phone_number":{"type":"string","title":"Phone Number"},"status":{"$ref":"#/components/schemas/OnboardingStatus"},"current_step":{"$ref":"#/components/schemas/OnboardingStep"},"detected_language":{"anyOf":[{"$ref":"#/components/schemas/Language"},{"type":"null"}]},"organization_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Organization Id"},"business_profile_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Profile Id"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","phone_number","status","current_step","detected_language","organization_id","business_profile_id","started_at","completed_at"],"title":"OnboardingSessionRead","description":"The state of a conversation, without the answers given so far.\n\nThe answers are deliberately not exposed: they are working notes on their\nway to becoming a profile, and the profile is what anything downstream\nshould read."},"OnboardingStatus":{"type":"string","enum":["IN_PROGRESS","COMPLETED","ABANDONED"],"title":"OnboardingStatus","description":"Where an onboarding conversation stands.\n\n``abandoned`` exists but is never reached by a timer. The specification\nrequires that onboarding *\"may be paused and resumed without losing\nprogress\"*, and a session that expired on its own would be the opposite of\nthat — someone who answers three questions on Monday and the rest on Friday\nhas paused, not failed."},"OnboardingStep":{"type":"string","enum":["BUSINESS_NAME","BUSINESS_TYPE","COUNTRY","TIMEZONE","PREFERRED_LANGUAGE","OWNER_NAME","EMAIL","EMPLOYEE_COUNT","OFFERINGS","CONFIRM","DONE"],"title":"OnboardingStep","description":"One question, and the two terminal states.\n\nThe value is what a paused session stores, so these strings are a\npersistence format: renaming one is a migration, not a rename."},"OnboardingTurnRead":{"properties":{"step":{"$ref":"#/components/schemas/OnboardingStep"},"prompt":{"type":"string","title":"Prompt"},"status":{"$ref":"#/components/schemas/OnboardingStatus"},"understood":{"type":"boolean","title":"Understood"},"organization_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Organization Id"},"business_profile_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Profile Id"}},"type":"object","required":["step","prompt","status","understood","organization_id","business_profile_id"],"title":"OnboardingTurnRead","description":"What Sabimee says next."},"OrderLineRead":{"properties":{"position":{"type":"integer","title":"Position"},"description":{"type":"string","title":"Description"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"},"unit_price":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Unit Price"},"line_total":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Line Total"}},"type":"object","required":["position","description","quantity","unit_price","line_total"],"title":"OrderLineRead","description":"One line, as it stands."},"OrderListItemRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"reference":{"type":"string","title":"Reference"},"status":{"$ref":"#/components/schemas/OrderStatus"},"currency":{"type":"string","title":"Currency"},"order_total":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Order Total"},"is_priced":{"type":"boolean","title":"Is Priced"}},"type":"object","required":["id","reference","status","currency","order_total","is_priced"],"title":"OrderListItemRead","description":"One order as a list shows it.\n\n`OrderSummary` without its lines. The lines are the record of what was\nordered and belong to `GET /orders/{reference}`; a page of fifty orders\ncarrying every line of each would be a different, much heavier thing than\nthe summary a listing is for."},"OrderListRead":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OrderListItemRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"OrderListRead","description":"A page of orders.\n\nThe envelope `/customers` already uses, for the reason it already gives:\nthe total is included because a list is something a business owner pages\nthrough, and \"1-50 of 3\" versus \"1-50 of 3,000\" is the difference between a\nfinished screen and an unusable one. `total` counts everything the business\nhas, not what this page returned."},"OrderRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"reference":{"type":"string","title":"Reference"},"status":{"$ref":"#/components/schemas/OrderStatus"},"currency":{"type":"string","title":"Currency"},"order_total":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Order Total"},"is_priced":{"type":"boolean","title":"Is Priced"},"lines":{"items":{"$ref":"#/components/schemas/OrderLineRead"},"type":"array","title":"Lines"}},"type":"object","required":["id","reference","status","currency","order_total","is_priced","lines"],"title":"OrderRead","description":"An order, in the shape the domain already publishes.\n\nEvery line is carried. An order with a line missing is an order nobody can\nreconcile, so there is nothing here to paginate and nothing a page could\nleave out — the lines are the record, not a listing of it."},"OrderStatus":{"type":"string","enum":["DRAFT","CONFIRMED","FULFILLED","CANCELLED"],"title":"OrderStatus","description":"Where an order is in its life."},"OrganizationCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"slug":{"type":"string","maxLength":255,"minLength":1,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","title":"Slug"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/OrganizationStatus","default":"active"}},"type":"object","required":["name","slug"],"title":"OrganizationCreate"},"OrganizationRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/OrganizationStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","slug","description","status","created_at","updated_at"],"title":"OrganizationRead"},"OrganizationStatus":{"type":"string","enum":["active","inactive","archived"],"title":"OrganizationStatus"},"OrganizationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"$ref":"#/components/schemas/OrganizationStatus"},{"type":"null"}]}},"type":"object","title":"OrganizationUpdate"},"OutstandingBalancesRead":{"properties":{"balances":{"items":{"$ref":"#/components/schemas/CustomerBalanceRead"},"type":"array","title":"Balances"},"totals":{"items":{"$ref":"#/components/schemas/sabimee_api__balances__schemas__CurrencyTotalRead"},"type":"array","title":"Totals"}},"type":"object","required":["balances","totals"],"title":"OutstandingBalancesRead","description":"The whole statement: every debtor, and the totals they add up to.\n\nNot a page. This is a computed statement rather than a collection of\nrecords — one row per customer per currency still owing something — and\ntruncating it would mean not naming a debtor, which is the one thing a\nreconciliation answer must not do. See the phase report for the measurement\nbehind that: two aggregate statements, whatever the history behind them."},"PaymentMethod":{"type":"string","enum":["CASH","BANK_TRANSFER","CARD","POS","MOBILE_MONEY"],"title":"PaymentMethod","description":"How the money moved. A closed set."},"PaymentRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"reference":{"type":"string","title":"Reference"},"status":{"$ref":"#/components/schemas/PaymentStatus"},"method":{"$ref":"#/components/schemas/PaymentMethod"},"amount_minor":{"type":"integer","title":"Amount Minor"},"currency":{"type":"string","title":"Currency"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"confirmed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Confirmed At"},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cancelled At"},"refunded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refunded At"}},"type":"object","required":["id","reference","status","method","amount_minor","currency","created_at","confirmed_at","cancelled_at","refunded_at"],"title":"PaymentRead","description":"One payment, in the shape the domain already publishes."},"PaymentReportRead":{"properties":{"window":{"$ref":"#/components/schemas/sabimee_api__reporting__schemas__WindowRead"},"by_currency":{"items":{"$ref":"#/components/schemas/sabimee_api__reporting__schemas__CurrencyTotalRead"},"type":"array","title":"By Currency"},"by_method":{"items":{"$ref":"#/components/schemas/MethodTotalRead"},"type":"array","title":"By Method"}},"type":"object","required":["window","by_currency","by_method"],"title":"PaymentReportRead","description":"What came in during the period, by currency and by method.\n\nTwo groupings of the same money, not two different figures: `by_currency`\nis what the period took, and `by_method` is how it arrived. Neither is a\npage — both are `GROUP BY` aggregates bounded by the currencies and methods\nthe business actually uses.\n\nNo payment row, reference, or customer reaches this shape."},"PaymentStatus":{"type":"string","enum":["REQUESTED","CONFIRMED","CANCELLED","REFUNDED"],"title":"PaymentStatus","description":"Where a payment is in its life."},"PriceListRead":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CurrentPriceRead"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"PriceListRead","description":"Everything the business has priced.\n\nNot a page. The list is the catalogue's priced entries, which is what a\nprice list is; capping it would leave a product off with nothing to say so.\nThe internal identifier of the price row is not published — the product is\nwhat a caller has, and the figure in force is what it needs."},"ProcessingResultResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"processing_status":{"$ref":"#/components/schemas/ProcessingStatus"},"extraction_method":{"$ref":"#/components/schemas/ExtractionMethod"},"character_count":{"type":"integer","title":"Character Count"},"word_count":{"type":"integer","title":"Word Count"},"processed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processed At"}},"type":"object","required":["document_id","processing_status","extraction_method","character_count","word_count","processed_at"],"title":"ProcessingResultResponse","description":"Processing metadata for one document — never the text itself."},"ProcessingStatus":{"type":"string","enum":["processing","processed","failed"],"title":"ProcessingStatus"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","minLength":1,"title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"ReportPeriod":{"type":"string","enum":["TODAY","YESTERDAY","THIS_WEEK","LAST_WEEK","THIS_MONTH","LAST_MONTH","THIS_YEAR","LAST_YEAR"],"title":"ReportPeriod","description":"How far back — and, for the diary, how far ahead — a report looks."},"RetrievalRequest":{"properties":{"query":{"type":"string","maxLength":4096,"minLength":1,"title":"Query"},"top_k":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Top K"}},"type":"object","required":["query"],"title":"RetrievalRequest"},"RetrievalResponse":{"properties":{"query":{"type":"string","title":"Query"},"contexts":{"items":{"$ref":"#/components/schemas/ContextSection"},"type":"array","title":"Contexts"},"retrieved_chunks":{"type":"integer","title":"Retrieved Chunks"},"retrieved_documents":{"type":"integer","title":"Retrieved Documents"},"confidence":{"type":"number","title":"Confidence"},"considered_chunks":{"type":"integer","title":"Considered Chunks"},"retrieved_knowledge_records":{"type":"integer","title":"Retrieved Knowledge Records","default":0},"figure_conflicts":{"items":{"$ref":"#/components/schemas/FigureConflictReport"},"type":"array","title":"Figure Conflicts"},"elapsed_ms":{"type":"integer","title":"Elapsed Ms"}},"type":"object","required":["query","contexts","retrieved_chunks","retrieved_documents","confidence","considered_chunks","elapsed_ms"],"title":"RetrievalResponse"},"SalesReportRead":{"properties":{"window":{"$ref":"#/components/schemas/sabimee_api__reporting__schemas__WindowRead"},"totals":{"items":{"$ref":"#/components/schemas/sabimee_api__reporting__schemas__CurrencyTotalRead"},"type":"array","title":"Totals"}},"type":"object","required":["window","totals"],"title":"SalesReportRead","description":"What was sold in the period, by currency.\n\nNot a page and not a collection of orders: a `GROUP BY` aggregate whose\nlength is the number of currencies the business trades in. There is nothing\nhere a page could omit."},"SalesTrendRead":{"properties":{"window":{"$ref":"#/components/schemas/sabimee_api__analytics__schemas__WindowRead"},"before":{"$ref":"#/components/schemas/sabimee_api__analytics__schemas__WindowRead"},"movements":{"items":{"$ref":"#/components/schemas/CurrencyMovementRead"},"type":"array","title":"Movements"}},"type":"object","required":["window","before","movements"],"title":"SalesTrendRead","description":"What sales did over the period, against the period before it.\n\n**A direction is not a cause.** The movements say what changed and by how\nmuch, and carry no field for why — the operational record holds no reason a\ncustomer did or did not buy, and a response that named one would be\ninventing it.\n\nNot paginated: one movement per currency present in either window."},"SearchHitResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"chunk_id":{"type":"string","format":"uuid","title":"Chunk Id"},"chunk_index":{"type":"integer","title":"Chunk Index"},"similarity_score":{"type":"number","title":"Similarity Score"}},"type":"object","required":["document_id","chunk_id","chunk_index","similarity_score"],"title":"SearchHitResponse"},"SearchRequest":{"properties":{"query_embedding":{"items":{"type":"number"},"type":"array","maxItems":4096,"minItems":1,"title":"Query Embedding"},"top_k":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Top K"}},"additionalProperties":false,"type":"object","required":["query_embedding"],"title":"SearchRequest","description":"A similarity query.\n\nEvery constraint is enforced here rather than downstream, so an invalid\nvector is a ``422`` from the request boundary and never a ``500`` or\n``502`` from something that tried to compute with it."},"SearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/SearchHitResponse"},"type":"array","title":"Results"},"top_k":{"type":"integer","title":"Top K"}},"type":"object","required":["results","top_k"],"title":"SearchResponse"},"StatusCountRead":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["status","count"],"title":"StatusCountRead","description":"How many appointments stand at one lifecycle status."},"StockLevelRead":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id"},"name":{"type":"string","title":"Name"},"unit":{"type":"string","title":"Unit"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"}},"type":"object","required":["product_id","name","unit","quantity"],"title":"StockLevelRead","description":"How much of one product the business has."},"StockLevelsRead":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StockLevelRead"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"StockLevelsRead","description":"Everything the business stocks, and how much of each.\n\nNot a page. The listing is the whole catalogue's stocked entries, which is\nwhat somebody counting against it needs; capping it would leave a product\noff the count sheet with nothing to say so."},"StockLineRead":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id"},"name":{"type":"string","title":"Name"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"}},"type":"object","required":["product_id","name","unit","quantity"],"title":"StockLineRead","description":"What there is of one product, now."},"TemplateCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"content":{"type":"string","minLength":1,"title":"Content"}},"type":"object","required":["name","content"],"title":"TemplateCreate","description":"A new template and the words it starts with.\n\nNo `organization_id` and no `channel`: the tenant is the authenticated\ncaller's, and WhatsApp is the only channel Sabimee speaks — a field for\neither would be a field a client could get wrong."},"TemplateRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"channel":{"$ref":"#/components/schemas/NotificationChannel"},"status":{"$ref":"#/components/schemas/TemplateStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","channel","status","created_at"],"title":"TemplateRead","description":"A template, without content — content belongs to a version."},"TemplateStatus":{"type":"string","enum":["ACTIVE","INACTIVE"],"title":"TemplateStatus","description":"Whether a template, or one of its versions, may be used."},"TemplateVersionCreate":{"properties":{"content":{"type":"string","minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"TemplateVersionCreate","description":"New words for a template that already exists."},"TemplateVersionRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"version":{"type":"integer","title":"Version"},"content":{"type":"string","title":"Content"},"status":{"$ref":"#/components/schemas/TemplateStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","version","content","status","created_at"],"title":"TemplateVersionRead","description":"One version, as written."},"TemplateWithVersionsRead":{"properties":{"template":{"$ref":"#/components/schemas/TemplateRead"},"versions":{"items":{"$ref":"#/components/schemas/TemplateVersionRead"},"type":"array","title":"Versions"}},"type":"object","required":["template","versions"],"title":"TemplateWithVersionsRead","description":"A template and its versions, oldest first."},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"}},"type":"object","required":["access_token","expires_in"],"title":"TokenResponse"},"UploadResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"uploaded_by":{"type":"string","format":"uuid","title":"Uploaded By"},"filename":{"type":"string","title":"Filename"},"original_filename":{"type":"string","title":"Original Filename"},"content_type":{"type":"string","title":"Content Type"},"file_size":{"type":"integer","title":"File Size"},"checksum_sha256":{"type":"string","title":"Checksum Sha256"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","uploaded_by","filename","original_filename","content_type","file_size","checksum_sha256","status","is_active","created_at","updated_at"],"title":"UploadResponse","description":"The result of `POST /documents` — the document that was just stored."},"UserCreate":{"properties":{"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"email":{"type":"string","maxLength":320,"minLength":3,"pattern":"^[^@\\s]+@[^@\\s.]+(?:\\.[^@\\s.]+)+$","title":"Email"},"display_name":{"type":"string","maxLength":255,"minLength":1,"title":"Display Name"},"password":{"type":"string","maxLength":128,"minLength":12,"title":"Password"},"status":{"$ref":"#/components/schemas/UserStatus","default":"active"},"role":{"$ref":"#/components/schemas/UserRole","default":"viewer"}},"type":"object","required":["organization_id","email","display_name","password"],"title":"UserCreate"},"UserProfileResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"email":{"type":"string","title":"Email"},"display_name":{"type":"string","title":"Display Name"},"status":{"$ref":"#/components/schemas/UserStatus"},"role":{"$ref":"#/components/schemas/UserRole"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","email","display_name","status","role","created_at","updated_at"],"title":"UserProfileResponse","description":"The authenticated user's own profile (`GET /auth/me`)."},"UserResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"email":{"type":"string","title":"Email"},"display_name":{"type":"string","title":"Display Name"},"status":{"$ref":"#/components/schemas/UserStatus"},"role":{"$ref":"#/components/schemas/UserRole"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","email","display_name","status","role","created_at","updated_at"],"title":"UserResponse"},"UserRole":{"type":"string","enum":["owner","admin","viewer"],"title":"UserRole","description":"What an authenticated API caller may do inside their own organization.\n\nA strict hierarchy — ``owner`` outranks ``admin`` outranks ``viewer`` — and\n:func:`outranks` is the only place that ordering is written down. Two rules\nfall out of it and are enforced in the service rather than per route: nobody\ngrants a role above their own, and nobody raises their own.\n\n**This is not the WhatsApp owner.** That is a phone number matched against\n``business_profiles.owner_phone_number`` and is evaluated for a *customer*,\nwho has no user account at all. The two systems authorize different people\nover different channels and are deliberately kept apart."},"UserStatus":{"type":"string","enum":["active","inactive","suspended"],"title":"UserStatus"},"UserUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Display Name"},"role":{"anyOf":[{"$ref":"#/components/schemas/UserRole"},{"type":"null"}]},"password":{"anyOf":[{"type":"string","maxLength":128,"minLength":12},{"type":"null"}],"title":"Password"},"status":{"anyOf":[{"$ref":"#/components/schemas/UserStatus"},{"type":"null"}]},"current_password":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Current Password"}},"type":"object","title":"UserUpdate"},"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"},"WebhookAck":{"properties":{"status":{"type":"string","const":"received","title":"Status","default":"received"},"messages":{"type":"integer","title":"Messages","default":0},"statuses":{"type":"integer","title":"Statuses","default":0}},"type":"object","title":"WebhookAck","description":"The webhook's response body.\n\nCounts only. The provider needs a prompt acknowledgement, not a report, and\nanything richer would leak how a tenant is configured to an endpoint that is\nauthenticated by signature alone."},"WeekHoursRead":{"properties":{"days":{"items":{"$ref":"#/components/schemas/DayHoursRead"},"type":"array","title":"Days"}},"type":"object","required":["days"],"title":"WeekHoursRead","description":"The whole week, Monday first.\n\nAlways seven days. This is a fixed-size statement rather than a collection,\nso there is nothing here to paginate and nothing a page could omit."},"sabimee_api__analytics__schemas__WindowRead":{"properties":{"period":{"$ref":"#/components/schemas/ReportPeriod"},"starts_at":{"type":"string","format":"date-time","title":"Starts At"},"ends_at":{"type":"string","format":"date-time","title":"Ends At"}},"type":"object","required":["period","starts_at","ends_at"],"title":"WindowRead","description":"One period, and the instants it resolved to."},"sabimee_api__balances__schemas__CurrencyTotalRead":{"properties":{"currency":{"type":"string","title":"Currency"},"amount_minor":{"type":"integer","title":"Amount Minor"},"customers":{"type":"integer","title":"Customers"}},"type":"object","required":["currency","amount_minor","customers"],"title":"CurrencyTotalRead","description":"Everything owed in one currency. Never a sum across currencies."},"sabimee_api__reporting__schemas__CurrencyTotalRead":{"properties":{"currency":{"type":"string","title":"Currency"},"count":{"type":"integer","title":"Count"},"amount_minor":{"type":"integer","title":"Amount Minor"}},"type":"object","required":["currency","count","amount_minor"],"title":"CurrencyTotalRead","description":"How much, in one currency. Never a sum across currencies."},"sabimee_api__reporting__schemas__WindowRead":{"properties":{"period":{"$ref":"#/components/schemas/ReportPeriod"},"starts_at":{"type":"string","format":"date-time","title":"Starts At"},"ends_at":{"type":"string","format":"date-time","title":"Ends At"}},"type":"object","required":["period","starts_at","ends_at"],"title":"WindowRead","description":"The period a report covers, and the instants it resolved to.\n\nThe instants are published as well as the period's name because a\nreconciliation has to be able to say which boundary it used — \"this month\"\nresolves against the business's own timezone, and a client comparing two\nreports needs to see that rather than infer it."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"health","description":"Liveness, readiness, and health checks."},{"name":"organizations","description":"Organization management."},{"name":"users","description":"User management."},{"name":"auth","description":"Login, current user, token refresh, logout."},{"name":"documents","description":"Document upload and metadata."},{"name":"processing","description":"Document text extraction and normalization."},{"name":"chunking","description":"Retrieval-ready document chunks."},{"name":"embeddings","description":"Chunk embedding generation."},{"name":"vector-store","description":"Embedding indexing and similarity search."},{"name":"retrieval","description":"Query context retrieval (no LLM)."},{"name":"chat","description":"Grounded AI answers from retrieved context."},{"name":"conversations","description":"Persistent chat threads."},{"name":"customers","description":"The people and businesses an organization does business with."},{"name":"balances","description":"Read-only reconciliation: what the caller's own customers still owe. Authenticated and scoped to the caller's organization — there is no cross-tenant access."},{"name":"inventory","description":"Read-only stock levels for the caller's own catalogue. Authenticated and scoped to the caller's organization — there is no cross-tenant access."},{"name":"business-hours","description":"Read-only opening hours for the caller's own business — the whole week, unconfigured days included. Authenticated and scoped to the caller's organization."},{"name":"reporting","description":"Read-only reports over a named calendar period, for the caller's own business. Authenticated and scoped to the caller's organization."},{"name":"analytics","description":"Read-only analyses over a named calendar period, for the caller's own business. Authenticated and scoped to the caller's organization."},{"name":"pricing","description":"Read-only price list for the caller's own catalogue. Authenticated and scoped to the caller's organization; no free-text lookup, so products are matched by identifier."},{"name":"orders","description":"Read-only lookup of one of the caller's own orders by its reference. Authenticated and scoped to the caller's organization; there is no order list."},{"name":"payments","description":"Read-only lookup of one of the caller's own payments by its reference. Authenticated and scoped to the caller's organization; there is no payment list."},{"name":"appointments","description":"Read-only lookup of one of the caller's own appointments by its reference. Authenticated and scoped to the caller's organization; there is no appointment list."},{"name":"channels","description":"WhatsApp Business Cloud API webhook — the customer-facing entry point."}]}