{"openapi":"3.1.0","info":{"title":"KONAN Platform","description":"KONAN Platform — API Reference\n\nMulti-channel AI chatbot platform for businesses. Build, deploy, and manage intelligent chatbots with live agent support, webhooks, analytics, and more.\n\n**Base URL:** `https://konan.ma/api/v1`\n\n**Authentication:** Bearer token (JWT) via `Authorization: Bearer <token>` header, or API key via `X-API-Key` header.","version":"0.50.0"},"paths":{"/api/v1/chat/":{"post":{"tags":["Chat"],"summary":"Send Message","description":"Envoie un message à un bot et reçoit la réponse.\nPublic bots (status=active) allow unauthenticated access (widget embed).\nPrivate bots require auth.\nMessage quota is enforced per bot owner's plan.","operationId":"send_message_api_v1_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"}}}}}}},"/api/v1/chat/stream":{"post":{"tags":["Chat"],"summary":"Stream Message","description":"Streaming SSE version of chat — tokens arrive in real-time.","operationId":"stream_message_api_v1_chat_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/with-document":{"post":{"tags":["Chat"],"summary":"Chat With Document","description":"Send a document (PDF/Word/Excel/TXT) to the bot for analysis.\nThe bot reads, extracts text, and responds contextually.\nMax 10MB per file. Supported: PDF, DOCX, DOC, XLSX, XLS, TXT, MD, CSV.","operationId":"chat_with_document_api_v1_chat_with_document_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_chat_with_document_api_v1_chat_with_document_post"}}},"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"}}}}}}},"/api/v1/chat/upload-file":{"post":{"tags":["Chat"],"summary":"Upload File In Chat","description":"Upload a file (image/doc) in chat. Stores in Supabase Storage and returns URL.\nImages are displayed inline. Documents are sent for AI analysis.\nSupported: JPEG, PNG, GIF, WebP, PDF, DOCX, XLSX, TXT, MD, CSV.","operationId":"upload_file_in_chat_api_v1_chat_upload_file_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_in_chat_api_v1_chat_upload_file_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/sessions/{session_id}":{"get":{"tags":["Chat"],"summary":"Get Session","description":"Récupère l'historique d'une session (auth required, DB fallback for serverless)","operationId":"get_session_api_v1_chat_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Chat"],"summary":"Delete Session","description":"Supprime une session (auth required, clears DB + memory)","operationId":"delete_session_api_v1_chat_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/conversations/{bot_id}":{"get":{"tags":["Chat"],"summary":"List Conversations","description":"List all conversation sessions for a bot with message counts.\nOwner only. Returns sessions sorted by last activity.","operationId":"list_conversations_api_v1_chat_conversations__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/feedback":{"post":{"tags":["Chat"],"summary":"Submit Message Feedback","description":"Submit thumbs up/down feedback on an AI message. Public (widget-accessible).","operationId":"submit_message_feedback_api_v1_chat_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageFeedback"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/feedback/{bot_id}/summary":{"get":{"tags":["Chat"],"summary":"Get Feedback Summary","description":"Get aggregated feedback for a bot (owner only).","operationId":"get_feedback_summary_api_v1_chat_feedback__bot_id__summary_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/export/{bot_id}":{"get":{"tags":["Chat"],"summary":"Export Conversations","description":"Export all conversations for a bot as CSV or JSON.\nOwner only. For compliance and reporting.","operationId":"export_conversations_api_v1_chat_export__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"csv","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/search/{bot_id}":{"get":{"tags":["Chat"],"summary":"Search Conversations","description":"Search across chat messages by keyword for a bot.\nOwner only. Uses Supabase full-text / ilike search.","operationId":"search_conversations_api_v1_chat_search__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/export-pdf":{"post":{"tags":["Chat"],"summary":"Export Pdf","description":"Generate a simple HTML-to-PDF of a chat conversation.\nUsed by the embeddable widget (no auth). Returns a downloadable HTML file\nstyled to look like a PDF (actual PDF generation requires wkhtmltopdf/weasyprint\nwhich is not available on Vercel).","operationId":"export_pdf_api_v1_chat_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/lead":{"post":{"tags":["Chat"],"summary":"Save Lead","description":"Store lead capture data from the widget pre-chat form.\nNo auth required (public widget). Links lead to session.\nPer-bot rate limited to prevent abuse.","operationId":"save_lead_api_v1_chat_lead_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/leads/{bot_id}":{"get":{"tags":["Chat"],"summary":"List Leads","description":"List all captured leads for a bot. Owner only.","operationId":"list_leads_api_v1_chat_leads__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/leads/{lead_id}":{"delete":{"tags":["Chat"],"summary":"Delete Lead","description":"Delete a single lead. Owner verification via bot.","operationId":"delete_lead_api_v1_chat_leads__lead_id__delete","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/feedback/correction":{"post":{"tags":["Chat"],"summary":"Submit Correction","description":"Submit a corrected response for an AI message (for training/improvement).","operationId":"submit_correction_api_v1_chat_feedback_correction_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackCorrection"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/feedback/{bot_id}/stats":{"get":{"tags":["Chat"],"summary":"Feedback Stats","description":"Get feedback statistics for a bot.","operationId":"feedback_stats_api_v1_chat_feedback__bot_id__stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/feedback/{bot_id}/messages":{"get":{"tags":["Chat"],"summary":"Feedback Messages","description":"List messages with feedback for quality review.","operationId":"feedback_messages_api_v1_chat_feedback__bot_id__messages_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"rating","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(thumbs_up|thumbs_down)$"},{"type":"null"}],"title":"Rating"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/leads/{bot_id}/export":{"get":{"tags":["Chat"],"summary":"Export Leads","description":"Export all leads for a bot as CSV or JSON. Owner only.","operationId":"export_leads_api_v1_chat_leads__bot_id__export_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"csv","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/models/available":{"get":{"tags":["Bots"],"summary":"List Available Models","description":"Liste les modèles AI disponibles pour les bots.","operationId":"list_available_models_api_v1_bots_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/models/byok-providers":{"get":{"tags":["Bots"],"summary":"List Byok Providers","description":"Liste les providers API supportés pour BYOK (Bring Your Own Key).","operationId":"list_byok_providers_api_v1_bots_models_byok_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/models/validate-key":{"post":{"tags":["Bots"],"summary":"Validate Api Key","description":"Valide une clé API client (BYOK) en testant un appel léger.\nNécessite plan Pro+.","operationId":"validate_api_key_api_v1_bots_models_validate_key_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/stats/overview":{"get":{"tags":["Bots"],"summary":"Stats Overview","description":"Dashboard stats for current user's bots (admin sees all). Auth required.","operationId":"stats_overview_api_v1_bots_stats_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/stats/public":{"get":{"tags":["Bots"],"summary":"Stats Public","description":"Public stats for landing page (no auth required). Cached 5 min.","operationId":"stats_public_api_v1_bots_stats_public_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/domains":{"get":{"tags":["Bots"],"summary":"List Domains","description":"Liste les domaines disponibles avec templates","operationId":"list_domains_api_v1_bots_domains_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/templates":{"get":{"tags":["Bots"],"summary":"List Bot Templates","description":"List available bot templates (pre-built configurations). No auth required.","operationId":"list_bot_templates_api_v1_bots_templates_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/templates/{template_id}":{"get":{"tags":["Bots"],"summary":"Get Bot Template","description":"Get a specific bot template with full config details.","operationId":"get_bot_template_api_v1_bots_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/from-template":{"post":{"tags":["Bots"],"summary":"Create Bot From Template","description":"Create a new bot from a pre-built template. Quota-enforced.","operationId":"create_bot_from_template_api_v1_bots_from_template_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__bots__TemplateCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/":{"get":{"tags":["Bots"],"summary":"List Bots","description":"Liste les bots. Si auth header → user's bots only (admins see all). Sinon → active only (demo).\nSupports pagination via limit/offset. Max limit: 100.","operationId":"list_bots_api_v1_bots__get","parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Bots"],"summary":"Create Bot","description":"Crée un nouveau bot (quota-enforced, linked to user)","operationId":"create_bot_api_v1_bots__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Bot Api V1 Bots  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}":{"get":{"tags":["Bots"],"summary":"Get Bot","description":"Détails d'un bot. Public info for active bots (chat widget), full info for owner.","operationId":"get_bot_api_v1_bots__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bots"],"summary":"Update Bot","description":"Met à jour un bot (ownership check, auth required)","operationId":"update_bot_api_v1_bots__bot_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Delete Bot","description":"Supprime un bot et sa KB (auth required, ownership check — admins can delete any bot)","operationId":"delete_bot_api_v1_bots__bot_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/avatar":{"post":{"tags":["Bots"],"summary":"Upload Bot Avatar","description":"Upload un avatar/logo pour le bot. Stocke dans Supabase Storage.\nMax 2MB, formats: PNG, JPG, WEBP, GIF, SVG.","operationId":"upload_bot_avatar_api_v1_bots__bot_id__avatar_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_bot_avatar_api_v1_bots__bot_id__avatar_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Delete Bot Avatar","description":"Supprime l'avatar du bot.","operationId":"delete_bot_avatar_api_v1_bots__bot_id__avatar_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/activate":{"post":{"tags":["Bots"],"summary":"Activate Bot","description":"Active un bot (auth required, ownership check)","operationId":"activate_bot_api_v1_bots__bot_id__activate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/deactivate":{"post":{"tags":["Bots"],"summary":"Deactivate Bot","description":"Désactive un bot (auth required, ownership check)","operationId":"deactivate_bot_api_v1_bots__bot_id__deactivate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/clone":{"post":{"tags":["Bots"],"summary":"Clone Bot","description":"Clone an existing bot with a new ID. Copies config but not KB.\nOwner only, quota-enforced.","operationId":"clone_bot_api_v1_bots__bot_id__clone_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/knowledge":{"post":{"tags":["Bots"],"summary":"Upload Knowledge","description":"Upload un document dans la KB du bot (quota-enforced, size-validated)","operationId":"upload_knowledge_api_v1_bots__bot_id__knowledge_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_knowledge_api_v1_bots__bot_id__knowledge_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Bots"],"summary":"Get Knowledge Stats","description":"Stats de la knowledge base d'un bot — from Supabase (auth required)","operationId":"get_knowledge_stats_api_v1_bots__bot_id__knowledge_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Clear Knowledge","description":"Supprime toute la knowledge base d'un bot (auth required)","operationId":"clear_knowledge_api_v1_bots__bot_id__knowledge_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/knowledge/search":{"post":{"tags":["Bots"],"summary":"Search Knowledge","description":"Recherche dans la knowledge base (auth required)","operationId":"search_knowledge_api_v1_bots__bot_id__knowledge_search_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":500,"title":"Query"}},{"name":"top_k","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":5,"title":"Top K"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/kb/train-url":{"post":{"tags":["Bots"],"summary":"Train From Url","description":"Scrape a web page and add its content to the bot's knowledge base.\n\nBody: {\"url\": \"https://example.com\", \"depth\": 1}\ndepth=0: only the given URL, depth=1: follow links on the same domain (max 10 pages).","operationId":"train_from_url_api_v1_bots__bot_id__kb_train_url_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/tools/available":{"get":{"tags":["Bots"],"summary":"List Available Tools","description":"Liste tous les outils/calculateurs disponibles.","operationId":"list_available_tools_api_v1_bots_tools_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/tools/execute":{"post":{"tags":["Bots"],"summary":"Execute Tool","description":"Exécute un outil de calcul directement (pour tests).","operationId":"execute_tool_api_v1_bots_tools_execute_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/ab-tests":{"post":{"tags":["Bots"],"summary":"Create Ab Test","description":"Create an A/B test for a bot. Split traffic across config variants.","operationId":"create_ab_test_api_v1_bots__bot_id__ab_tests_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ABTestCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Bots"],"summary":"List Ab Tests","description":"List all A/B tests for a bot.","operationId":"list_ab_tests_api_v1_bots__bot_id__ab_tests_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/ab-tests/{test_id}":{"get":{"tags":["Bots"],"summary":"Get Ab Test","description":"Get A/B test details with per-variant stats.","operationId":"get_ab_test_api_v1_bots__bot_id__ab_tests__test_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bots"],"summary":"Update Ab Test","description":"Update A/B test (name, status, traffic).","operationId":"update_ab_test_api_v1_bots__bot_id__ab_tests__test_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ABTestUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Delete Ab Test","description":"Delete an A/B test.","operationId":"delete_ab_test_api_v1_bots__bot_id__ab_tests__test_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/ab-tests/{test_id}/stop":{"post":{"tags":["Bots"],"summary":"Stop Ab Test","description":"Stop an A/B test and optionally declare a winner.","operationId":"stop_ab_test_api_v1_bots__bot_id__ab_tests__test_id__stop_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}},{"name":"winner_variant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Winner Variant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/ab-tests/{test_id}/record":{"post":{"tags":["Bots"],"summary":"Record Ab Impression","description":"Record an impression or conversion for an A/B test variant (called from chat).","operationId":"record_ab_impression_api_v1_bots__bot_id__ab_tests__test_id__record_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/{bot_id}/export":{"get":{"tags":["Bots"],"summary":"Export Bot","description":"Export full bot configuration as JSON (profile, skills, automations, canned responses, KB metadata).","operationId":"export_bot_api_v1_bots__bot_id__export_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/import":{"post":{"tags":["Bots"],"summary":"Import Bot","description":"Import a bot from exported JSON. Creates a new bot with the config.","operationId":"import_bot_api_v1_bots_import_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotImportPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bots/languages/available":{"get":{"tags":["Bots"],"summary":"List Available Languages","description":"List all supported languages for bot configuration.","operationId":"list_available_languages_api_v1_bots_languages_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/bots/{bot_id}/languages":{"get":{"tags":["Bots"],"summary":"Get Bot Languages","description":"Get language configuration for a bot.","operationId":"get_bot_languages_api_v1_bots__bot_id__languages_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bots"],"summary":"Update Bot Languages","description":"Update language configuration for a bot.","operationId":"update_bot_languages_api_v1_bots__bot_id__languages_put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguageConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/generate":{"post":{"tags":["Documents"],"summary":"Generate Document","description":"Génère un document (PDF, Word, Excel) — auth required.","operationId":"generate_document_api_v1_documents_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/download/{filename}":{"get":{"tags":["Documents"],"summary":"Download Document","description":"Télécharge un document généré (local ou Supabase Storage). Public — links shared via WhatsApp.","operationId":"download_document_api_v1_documents_download__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Register","description":"Create a new account.","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"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"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Login","description":"Login with email/password.","operationId":"login_api_v1_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"}}}}}}},"/api/v1/auth/refresh":{"post":{"tags":["Auth"],"summary":"Refresh Token Endpoint","description":"Exchange a valid refresh token for a new access token + refresh token.","operationId":"refresh_token_endpoint_api_v1_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"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["Auth"],"summary":"Me","description":"Get current user profile.","operationId":"me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Logout","description":"Logout (clear cookie + revoke all refresh tokens).\nAccepts optional refresh_token in body to identify user if access token is expired.","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/api-keys":{"get":{"tags":["Auth"],"summary":"List Keys","description":"List API keys (without the actual key values).","operationId":"list_keys_api_v1_auth_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Auth"],"summary":"Create Key","description":"Generate a new API key. The raw key is shown only once. Requires Pro+ plan.","operationId":"create_key_api_v1_auth_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/api-keys/{key_id}":{"delete":{"tags":["Auth"],"summary":"Delete Key","description":"Revoke an API key. Only the owner can delete.","operationId":"delete_key_api_v1_auth_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/api-keys/{key_id}/rotate":{"post":{"tags":["Auth"],"summary":"Rotate Key","description":"Rotate an API key: deactivate old one and generate a new one atomically.","operationId":"rotate_key_api_v1_auth_api_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/oauth-config":{"get":{"tags":["Auth"],"summary":"Oauth Config","description":"Return public OAuth config (client IDs only, no secrets).","operationId":"oauth_config_api_v1_auth_oauth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/google":{"post":{"tags":["Auth"],"summary":"Google Auth","description":"Login/Register with Google.\nExpects: { \"credential\": \"<Google ID token>\" }\nVerifies the ID token with Google's API.","operationId":"google_auth_api_v1_auth_google_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/google/authorize":{"get":{"tags":["Auth"],"summary":"Google Authorize","description":"Redirect user to Google OAuth consent page with signed CSRF state.","operationId":"google_authorize_api_v1_auth_google_authorize_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/google/redirect":{"get":{"tags":["Auth"],"summary":"Google Redirect","description":"Google OAuth redirect flow.","operationId":"google_redirect_api_v1_auth_google_redirect_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/github":{"get":{"tags":["Auth"],"summary":"Github Redirect","description":"Redirect user to GitHub OAuth page with signed CSRF state.","operationId":"github_redirect_api_v1_auth_github_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/github/callback":{"get":{"tags":["Auth"],"summary":"Github Callback","description":"GitHub OAuth callback — exchange code for token, then login/register.","operationId":"github_callback_api_v1_auth_github_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error Description"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/update-profile":{"put":{"tags":["Auth"],"summary":"Update Profile","description":"Update user display name.","operationId":"update_profile_api_v1_auth_update_profile_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/change-password":{"put":{"tags":["Auth"],"summary":"Change Password","description":"Change user password.","operationId":"change_password_api_v1_auth_change_password_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/delete-account":{"delete":{"tags":["Auth"],"summary":"Delete Account","description":"Delete user account and all associated data.","operationId":"delete_account_api_v1_auth_delete_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/verify-email":{"post":{"tags":["Auth"],"summary":"Verify Email","description":"Verify email with 6-digit code.","operationId":"verify_email_api_v1_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/resend-verification":{"post":{"tags":["Auth"],"summary":"Resend Verification","description":"Resend email verification code.","operationId":"resend_verification_api_v1_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/forgot-password":{"post":{"tags":["Auth"],"summary":"Forgot Password","description":"Send a password reset code by email.","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Reset Password","description":"Reset password with verification code.","operationId":"reset_password_api_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/2fa/login":{"post":{"tags":["Auth"],"summary":"Login 2Fa","description":"Complete login with 2FA code after password verification.","operationId":"login_2fa_api_v1_auth_2fa_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verify2FALogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/2fa/setup":{"post":{"tags":["Auth"],"summary":"Setup 2Fa","description":"Generate TOTP secret and QR code for 2FA setup.","operationId":"setup_2fa_api_v1_auth_2fa_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/2fa/verify":{"post":{"tags":["Auth"],"summary":"Verify 2Fa Setup","description":"Verify TOTP code and enable 2FA.","operationId":"verify_2fa_setup_api_v1_auth_2fa_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verify2FACode"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/2fa/disable":{"post":{"tags":["Auth"],"summary":"Disable 2Fa","description":"Disable 2FA with a valid TOTP code or backup code.","operationId":"disable_2fa_api_v1_auth_2fa_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verify2FACode"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plans/":{"get":{"tags":["Plans"],"summary":"Get Plans","description":"List all available plans with features and pricing.","operationId":"get_plans_api_v1_plans__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/plans/current":{"get":{"tags":["Plans"],"summary":"Get Current Plan","description":"Get the current user's plan details, usage, and subscription status.","operationId":"get_current_plan_api_v1_plans_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/plans/upgrade":{"post":{"tags":["Plans"],"summary":"Upgrade Plan","description":"Request a plan upgrade. Admin only — normal users must go through Stripe billing.","operationId":"upgrade_plan_api_v1_plans_upgrade_post","parameters":[{"name":"plan_id","in":"query","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plans/downgrade":{"post":{"tags":["Plans"],"summary":"Downgrade Plan","description":"Downgrade to a lower plan. Any user can downgrade.\nClears payment/subscription fields.","operationId":"downgrade_plan_api_v1_plans_downgrade_post","parameters":[{"name":"plan_id","in":"query","required":false,"schema":{"type":"string","default":"free","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plans/usage":{"get":{"tags":["Plans"],"summary":"Get Usage","description":"Get detailed usage stats for the current month.","operationId":"get_usage_api_v1_plans_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/analytics/chart/messages":{"get":{"tags":["Analytics"],"summary":"Chart Messages","description":"Get daily message counts for the last N days. Optionally filter by bot_id.","operationId":"chart_messages_api_v1_analytics_chart_messages_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/chart/sessions":{"get":{"tags":["Analytics"],"summary":"Chart Sessions","description":"Get daily session counts for the last N days. Optionally filter by bot_id.","operationId":"chart_sessions_api_v1_analytics_chart_sessions_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/chart/bots":{"get":{"tags":["Analytics"],"summary":"Chart Bots Usage","description":"Get message count per bot (for pie/bar chart). Scoped to user's bots.","operationId":"chart_bots_usage_api_v1_analytics_chart_bots_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/analytics/top-bots":{"get":{"tags":["Analytics"],"summary":"Top Bots","description":"Get top bots by message count. Scoped to user's bots.","operationId":"top_bots_api_v1_analytics_top_bots_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/recent-activity":{"get":{"tags":["Analytics"],"summary":"Recent Activity","description":"Get recent chat sessions with details. Scoped to user's bots.","operationId":"recent_activity_api_v1_analytics_recent_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/channels":{"get":{"tags":["Analytics"],"summary":"Channel Breakdown","description":"Get message/session breakdown by channel. Scoped to user's bots.","operationId":"channel_breakdown_api_v1_analytics_channels_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/hourly":{"get":{"tags":["Analytics"],"summary":"Hourly Distribution","description":"Get message distribution by hour of day. Scoped to user's bots.","operationId":"hourly_distribution_api_v1_analytics_hourly_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/response-time":{"get":{"tags":["Analytics"],"summary":"Avg Response Time","description":"Get average bot response time stats. Scoped to user's bots.","operationId":"avg_response_time_api_v1_analytics_response_time_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/export":{"get":{"tags":["Analytics"],"summary":"Export Analytics","description":"Export analytics data as JSON (for PDF/CSV generation on frontend).","operationId":"export_analytics_api_v1_analytics_export_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/export/csv":{"get":{"tags":["Analytics"],"summary":"Export Analytics Csv","description":"Export analytics as CSV file.","operationId":"export_analytics_csv_api_v1_analytics_export_csv_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/summary":{"get":{"tags":["Analytics"],"summary":"Analytics Summary","description":"Quick summary stats for the analytics dashboard header. Scoped to user's bots.","operationId":"analytics_summary_api_v1_analytics_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/analytics/bot/{bot_id}":{"get":{"tags":["Analytics"],"summary":"Bot Analytics","description":"Get detailed analytics for a specific bot.\nReturns messages chart, response times, channel breakdown, hourly, and totals.","operationId":"bot_analytics_api_v1_analytics_bot__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/overview":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Overview","description":"Conversation intelligence overview.\nReturns: CSAT avg, containment rate, escalation rate, quality score,\navg messages per session, resolution rate, and period comparisons.","operationId":"analytics_v2_overview_api_v1_analytics_v2_overview_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/funnel":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Funnel","description":"Conversion funnel: Visitors → Widget Opens → Chats Started → Leads Captured.\nUses visitor_events + sessions + contacts tables.","operationId":"analytics_v2_funnel_api_v1_analytics_v2_funnel_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/csat-trend":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Csat Trend","description":"Daily CSAT trend for chart — avg rating per day.","operationId":"analytics_v2_csat_trend_api_v1_analytics_v2_csat_trend_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/quality":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Quality","description":"AI quality scorecard per bot.\nReturns per-bot breakdown: CSAT, containment, resolution, response time, message volume.","operationId":"analytics_v2_quality_api_v1_analytics_v2_quality_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/agents":{"get":{"tags":["Analytics"],"summary":"Agent Performance","description":"Per-agent performance metrics: conversations, response time, CSAT, resolution.","operationId":"agent_performance_api_v1_analytics_v2_agents_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/agents/{agent_id}":{"get":{"tags":["Analytics"],"summary":"Agent Detail","description":"Detailed metrics for a single agent.","operationId":"agent_detail_api_v1_analytics_v2_agents__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/v2/feedback/{bot_id}":{"get":{"tags":["Analytics"],"summary":"Feedback Analytics","description":"Comprehensive feedback analytics: satisfaction trends, problem areas, improvement tracking.","operationId":"feedback_analytics_api_v1_analytics_v2_feedback__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/rate-limits/status":{"get":{"tags":["Analytics"],"summary":"Rate Limit Status","description":"Show current rate limit usage and quotas for the authenticated user.","operationId":"rate_limit_status_api_v1_analytics_rate_limits_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/analytics/roi":{"get":{"tags":["Analytics"],"summary":"Get Roi Dashboard","description":"Calculate ROI metrics — hours saved, money saved, efficiency gain.","operationId":"get_roi_dashboard_api_v1_analytics_roi_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/dashboard":{"get":{"tags":["Admin"],"summary":"Admin Dashboard","description":"Comprehensive admin dashboard stats.","operationId":"admin_dashboard_api_v1_admin_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/users":{"get":{"tags":["Admin"],"summary":"List Users","description":"List all registered users with filters and search.","operationId":"list_users_api_v1_admin_users_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}":{"get":{"tags":["Admin"],"summary":"Get User Detail","description":"Get detailed user info.","operationId":"get_user_detail_api_v1_admin_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin"],"summary":"Delete User","description":"Delete a user and all their data.","operationId":"delete_user_api_v1_admin_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/toggle":{"post":{"tags":["Admin"],"summary":"Toggle User","description":"Activate or deactivate a user.","operationId":"toggle_user_api_v1_admin_users__user_id__toggle_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/plan":{"post":{"tags":["Admin"],"summary":"Change User Plan","description":"Change a user's plan (admin override). Resets payment fields.","operationId":"change_user_plan_api_v1_admin_users__user_id__plan_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlanChangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/admin":{"post":{"tags":["Admin"],"summary":"Toggle Admin","description":"Toggle admin status for a user.","operationId":"toggle_admin_api_v1_admin_users__user_id__admin_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/bots":{"get":{"tags":["Admin"],"summary":"Admin List Bots","description":"List all bots across all users.","operationId":"admin_list_bots_api_v1_admin_bots_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/bots/{bot_id}":{"put":{"tags":["Admin"],"summary":"Admin Update Bot","description":"Admin update: toggle is_public, set custom_domain, change status.","operationId":"admin_update_bot_api_v1_admin_bots__bot_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/reset-stats":{"post":{"tags":["Admin"],"summary":"Reset Stats","description":"Reset usage stats (messages, sessions). Requires confirm=RESET to proceed.","operationId":"reset_stats_api_v1_admin_reset_stats_post","parameters":[{"name":"confirm","in":"query","required":false,"schema":{"type":"string","default":"","title":"Confirm"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/reseed":{"post":{"tags":["Admin"],"summary":"Reseed Bots","description":"Re-seed demo bots.","operationId":"reseed_bots_api_v1_admin_reseed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/system-health":{"get":{"tags":["Admin"],"summary":"System Health","description":"Get system health information.","operationId":"system_health_api_v1_admin_system_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/export/users":{"get":{"tags":["Admin"],"summary":"Export Users","description":"Export all users as JSON (for CSV conversion on frontend).","operationId":"export_users_api_v1_admin_export_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/audit-log":{"get":{"tags":["Admin"],"summary":"Get Audit Log","description":"View audit log entries. Admin only.","operationId":"get_audit_log_api_v1_admin_audit_log_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"user_id_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/cleanup":{"post":{"tags":["Admin"],"summary":"Db Cleanup","description":"Purge stale data: rate_limits >1h, oauth_states >15m, stripe_events >90d, audit_log >180d.","operationId":"db_cleanup_api_v1_admin_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/users/merge":{"post":{"tags":["Admin"],"summary":"Merge Users","description":"Merge source user into target user. Transfers bots, sessions, messages, API keys.\nSource user is deactivated after merge.","operationId":"merge_users_api_v1_admin_users_merge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MergeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/webhook":{"get":{"tags":["WhatsApp"],"summary":"Verify Webhook","description":"WhatsApp webhook verification (GET).","operationId":"verify_webhook_api_v1_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":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["WhatsApp"],"summary":"Receive Message","description":"Receive incoming WhatsApp messages (Meta Cloud API).\nMulti-tenant: routes by phone_number_id → finds bot with that phone_id → uses bot's token.","operationId":"receive_message_api_v1_whatsapp_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/whatsapp/gateway-webhook":{"post":{"tags":["WhatsApp"],"summary":"Gateway Webhook","description":"Receive messages from the self-hosted Baileys WhatsApp gateway.\nThis is the alternative to the official Meta webhook.","operationId":"gateway_webhook_api_v1_whatsapp_gateway_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/whatsapp/wizard/status/{bot_id}":{"get":{"tags":["WhatsApp"],"summary":"Wizard Status","description":"Get wizard completion status for a bot.","operationId":"wizard_status_api_v1_whatsapp_wizard_status__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/wizard/validate-token":{"post":{"tags":["WhatsApp"],"summary":"Wizard Validate Token","description":"Step 1: Validate a Meta Cloud API token.\nCalls the Meta Graph API to verify the token is valid and returns account info.","operationId":"wizard_validate_token_api_v1_whatsapp_wizard_validate_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardValidateToken"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/wizard/verify-phone":{"post":{"tags":["WhatsApp"],"summary":"Wizard Verify Phone","description":"Step 2: Verify phone number ID.\nCalls Meta API to confirm the phone_number_id exists and returns the display phone number.","operationId":"wizard_verify_phone_api_v1_whatsapp_wizard_verify_phone_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardVerifyPhone"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/wizard/setup-webhook":{"post":{"tags":["WhatsApp"],"summary":"Wizard Setup Webhook","description":"Step 3: Return webhook configuration details.\nThe webhook URL is the same for all bots (multi-tenant routing).\nThe user needs to configure it in Meta Developer Console.","operationId":"wizard_setup_webhook_api_v1_whatsapp_wizard_setup_webhook_post","parameters":[{"name":"bot_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/wizard/test-message":{"post":{"tags":["WhatsApp"],"summary":"Wizard Test Message","description":"Step 4: Send a test message to verify the full pipeline works.","operationId":"wizard_test_message_api_v1_whatsapp_wizard_test_message_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardTestMessage"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/templates/seeds":{"get":{"tags":["WhatsApp"],"summary":"Get Seed Templates","description":"Get pre-built template seeds optimized for Moroccan businesses.","operationId":"get_seed_templates_api_v1_whatsapp_templates_seeds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates/local":{"get":{"tags":["WhatsApp"],"summary":"List Local Templates","description":"List locally created template drafts for a bot.","operationId":"list_local_templates_api_v1_whatsapp_bots__bot_id__templates_local_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates/create":{"post":{"tags":["WhatsApp"],"summary":"Create Template Draft","description":"Create a local template draft. Can later be submitted to Meta for approval.\nValidates structure: name format, body length, variable count.","operationId":"create_template_draft_api_v1_whatsapp_bots__bot_id__templates_create_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__whatsapp__TemplateCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates/from-seed":{"post":{"tags":["WhatsApp"],"summary":"Create From Seed","description":"Create a template draft from a seed template.","operationId":"create_from_seed_api_v1_whatsapp_bots__bot_id__templates_from_seed_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateFromSeedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates/local/{template_id}":{"delete":{"tags":["WhatsApp"],"summary":"Delete Template Draft","description":"Delete a local template draft.","operationId":"delete_template_draft_api_v1_whatsapp_bots__bot_id__templates_local__template_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates/submit/{template_id}":{"post":{"tags":["WhatsApp"],"summary":"Submit Template To Meta","description":"Submit a template draft to Meta for approval.\nRequires WABA ID configured on the bot.","operationId":"submit_template_to_meta_api_v1_whatsapp_bots__bot_id__templates_submit__template_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/config":{"post":{"tags":["WhatsApp"],"summary":"Configure Bot Whatsapp","description":"Configure WhatsApp credentials for a specific bot.\nEach client enters their own Token + Phone ID here.\nRequires Enterprise plan (whatsapp_integration feature).","operationId":"configure_bot_whatsapp_api_v1_whatsapp_bots__bot_id__config_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["WhatsApp"],"summary":"Get Bot Whatsapp Config","description":"Get WhatsApp configuration for a specific bot.","operationId":"get_bot_whatsapp_config_api_v1_whatsapp_bots__bot_id__config_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["WhatsApp"],"summary":"Remove Bot Whatsapp Config","description":"Remove WhatsApp configuration from a bot.","operationId":"remove_bot_whatsapp_config_api_v1_whatsapp_bots__bot_id__config_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/test-send":{"post":{"tags":["WhatsApp"],"summary":"Test Send From Bot","description":"Send a test WhatsApp message using a specific bot's credentials.","operationId":"test_send_from_bot_api_v1_whatsapp_bots__bot_id__test_send_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/status":{"get":{"tags":["WhatsApp"],"summary":"Whatsapp Status","description":"Check overall WhatsApp integration status (scoped to user's bots). Auth required.","operationId":"whatsapp_status_api_v1_whatsapp_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/whatsapp/contacts":{"get":{"tags":["WhatsApp"],"summary":"List Wa Contacts","description":"List WhatsApp contacts (scoped to user's bots).","operationId":"list_wa_contacts_api_v1_whatsapp_contacts_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/conversations":{"get":{"tags":["WhatsApp"],"summary":"List Wa Conversations","description":"List WhatsApp conversations (scoped to user's bots).","operationId":"list_wa_conversations_api_v1_whatsapp_conversations_get","parameters":[{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/send":{"post":{"tags":["WhatsApp"],"summary":"Send Manual Message","description":"Send a WhatsApp message manually from the dashboard.\nIf bot_id is specified, uses that bot's credentials.","operationId":"send_manual_message_api_v1_whatsapp_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppSendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/analytics":{"get":{"tags":["WhatsApp"],"summary":"Whatsapp Analytics","description":"Get WhatsApp-specific analytics (scoped to user's bots).","operationId":"whatsapp_analytics_api_v1_whatsapp_analytics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates":{"get":{"tags":["WhatsApp"],"summary":"List Templates","description":"List WhatsApp message templates from Meta Business API.","operationId":"list_templates_api_v1_whatsapp_bots__bot_id__templates_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/bots/{bot_id}/templates/sync":{"post":{"tags":["WhatsApp"],"summary":"Sync Templates","description":"Sync templates from Meta and cache them locally in Supabase.","operationId":"sync_templates_api_v1_whatsapp_bots__bot_id__templates_sync_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/send-template":{"post":{"tags":["WhatsApp"],"summary":"Send Template Message","description":"Send a WhatsApp template message (required for initiating conversations after 24h).","operationId":"send_template_message_api_v1_whatsapp_send_template_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateSend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/send-interactive":{"post":{"tags":["WhatsApp"],"summary":"Send Interactive Message","description":"Send an interactive WhatsApp message with buttons or lists.\n\nButton type: Up to 3 reply buttons with id + title.\nList type: Sections with rows — menu-style selection.","operationId":"send_interactive_message_api_v1_whatsapp_send_interactive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppInteractiveSend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/send-media":{"post":{"tags":["WhatsApp"],"summary":"Send Media Message","description":"Send a media message (image, document, video, audio) via WhatsApp.","operationId":"send_media_message_api_v1_whatsapp_send_media_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppMediaSend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/whatsapp/broadcast":{"post":{"tags":["WhatsApp"],"summary":"Broadcast Message","description":"Broadcast a message or template to multiple WhatsApp recipients.\nNote: For non-template messages, recipients must have an active 24h conversation window.\nTemplates can be sent anytime (if approved on Meta).\nMax 100 recipients per request.","operationId":"broadcast_message_api_v1_whatsapp_broadcast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppBroadcast"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/status":{"get":{"tags":["Billing"],"summary":"Billing Status","description":"Check if Stripe billing is available.","operationId":"billing_status_api_v1_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/checkout":{"post":{"tags":["Billing"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout Session for plan upgrade.\nReturns the checkout URL — frontend redirects the user there.","operationId":"create_checkout_session_api_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/portal":{"post":{"tags":["Billing"],"summary":"Create Portal Session","description":"Create a Stripe Customer Portal session.\nAllows users to manage their subscription, update payment method, view invoices.","operationId":"create_portal_session_api_v1_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events.\n- checkout.session.completed → upgrade user plan\n- customer.subscription.deleted → downgrade to free\n- customer.subscription.updated → update plan if changed\n- invoice.payment_failed → notify user, mark at-risk","operationId":"stripe_webhook_api_v1_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/invoices":{"get":{"tags":["Billing"],"summary":"List Invoices","description":"List recent invoices for the current user from Stripe.","operationId":"list_invoices_api_v1_billing_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/":{"get":{"tags":["Templates"],"summary":"List Templates","description":"List all bot templates, optionally filtered by category.","operationId":"list_templates_api_v1_templates__get","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/popular":{"get":{"tags":["Templates"],"summary":"Popular Templates","description":"Get popular templates.","operationId":"popular_templates_api_v1_templates_popular_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/templates/{template_id}":{"get":{"tags":["Templates"],"summary":"Get Template","description":"Get a specific template by ID.","operationId":"get_template_api_v1_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}/create":{"post":{"tags":["Templates"],"summary":"Create Bot From Template","description":"Create a new bot from a template.","operationId":"create_bot_from_template_api_v1_templates__template_id__create_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/":{"get":{"tags":["Teams"],"summary":"List My Teams","description":"List teams the user belongs to (as owner or member).","operationId":"list_my_teams_api_v1_teams__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Teams"],"summary":"Create Team","description":"Create a new team.","operationId":"create_team_api_v1_teams__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/my-invites":{"get":{"tags":["Teams"],"summary":"List My Invites","description":"List pending invitations for the current user (by email).","operationId":"list_my_invites_api_v1_teams_my_invites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/teams/invites/{invite_id}/decline":{"post":{"tags":["Teams"],"summary":"Decline Invite","description":"Decline a team invitation.","operationId":"decline_invite_api_v1_teams_invites__invite_id__decline_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/join/{invite_token}":{"get":{"tags":["Teams"],"summary":"Join Team Page","description":"GET handler for email invite links. Redirects to dashboard with invite token.","operationId":"join_team_page_api_v1_teams_join__invite_token__get","parameters":[{"name":"invite_token","in":"path","required":true,"schema":{"type":"string","title":"Invite Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Teams"],"summary":"Accept Invite","description":"Accept a team invitation.","operationId":"accept_invite_api_v1_teams_join__invite_token__post","parameters":[{"name":"invite_token","in":"path","required":true,"schema":{"type":"string","title":"Invite Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/{team_id}":{"get":{"tags":["Teams"],"summary":"Get Team","description":"Get team details with members.","operationId":"get_team_api_v1_teams__team_id__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Teams"],"summary":"Update Team","description":"Update team name.","operationId":"update_team_api_v1_teams__team_id__put","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Delete Team","description":"Delete a team.","operationId":"delete_team_api_v1_teams__team_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/{team_id}/invite":{"post":{"tags":["Teams"],"summary":"Invite Member","description":"Invite a user to the team by email.","operationId":"invite_member_api_v1_teams__team_id__invite_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInvite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/{team_id}/members/{member_user_id}":{"delete":{"tags":["Teams"],"summary":"Remove Member","description":"Remove a member from the team.","operationId":"remove_member_api_v1_teams__team_id__members__member_user_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","title":"Member User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/{team_id}/members/{member_user_id}/role":{"put":{"tags":["Teams"],"summary":"Change Member Role","description":"Change a member's role.","operationId":"change_member_role_api_v1_teams__team_id__members__member_user_id__role_put","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","title":"Member User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/teams/{team_id}/bots/{bot_id}":{"post":{"tags":["Teams"],"summary":"Assign Bot To Team","description":"Assign a bot to a team (shared access).","operationId":"assign_bot_to_team_api_v1_teams__team_id__bots__bot_id__post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Unassign Bot From Team","description":"Remove a bot from a team.","operationId":"unassign_bot_from_team_api_v1_teams__team_id__bots__bot_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/":{"post":{"tags":["Webhooks"],"summary":"Create Webhook","description":"Register a webhook endpoint for a bot. Owner only.","operationId":"create_webhook_api_v1_webhooks__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{bot_id}":{"get":{"tags":["Webhooks"],"summary":"List Webhooks","description":"List all webhooks for a bot. Owner only.","operationId":"list_webhooks_api_v1_webhooks__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{webhook_id}":{"put":{"tags":["Webhooks"],"summary":"Update Webhook","description":"Update a webhook. Owner only.","operationId":"update_webhook_api_v1_webhooks__webhook_id__put","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete Webhook","description":"Delete a webhook. Owner only.","operationId":"delete_webhook_api_v1_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{webhook_id}/test":{"post":{"tags":["Webhooks"],"summary":"Test Webhook","description":"Send a test ping to a webhook endpoint.","operationId":"test_webhook_api_v1_webhooks__webhook_id__test_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{bot_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Get Deliveries","description":"Get recent webhook delivery logs for a bot.","operationId":"get_deliveries_api_v1_webhooks__bot_id__deliveries_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/memory":{"post":{"tags":["data"],"summary":"Save Memory","description":"Sauvegarder une info sur un contact.","operationId":"save_memory_api_v1_data_bots__bot_id__memory_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"Search Memory","description":"Rechercher dans la mémoire du bot.","operationId":"search_memory_api_v1_data_bots__bot_id__memory_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/memory/{contact_id}":{"get":{"tags":["data"],"summary":"Get Contact Memory","description":"Récupérer toute la mémoire d'un contact.","operationId":"get_contact_memory_api_v1_data_bots__bot_id__memory__contact_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/memory/{memory_id}":{"delete":{"tags":["data"],"summary":"Delete Memory","description":"Supprimer une entrée mémoire.","operationId":"delete_memory_api_v1_data_bots__bot_id__memory__memory_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/memory-stats":{"get":{"tags":["data"],"summary":"Memory Stats","description":"Statistiques mémoire du bot.","operationId":"memory_stats_api_v1_data_bots__bot_id__memory_stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections":{"post":{"tags":["data"],"summary":"Create Collection","description":"Créer une collection de données.","operationId":"create_collection_api_v1_data_bots__bot_id__collections_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"List Collections","description":"Lister les collections d'un bot.","operationId":"list_collections_api_v1_data_bots__bot_id__collections_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}":{"delete":{"tags":["data"],"summary":"Delete Collection","description":"Supprimer une collection et ses données.","operationId":"delete_collection_api_v1_data_bots__bot_id__collections__collection_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}/validate":{"post":{"tags":["data"],"summary":"Validate Record","description":"Validate record data against collection schema without saving.","operationId":"validate_record_api_v1_data_bots__bot_id__collections__collection_id__validate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}/records":{"post":{"tags":["data"],"summary":"Add Record","description":"Ajouter un enregistrement (schema-validated if collection has validation enabled).","operationId":"add_record_api_v1_data_bots__bot_id__collections__collection_id__records_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"List Records","description":"Lister/rechercher les enregistrements.","operationId":"list_records_api_v1_data_bots__bot_id__collections__collection_id__records_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}/records/{record_id}":{"put":{"tags":["data"],"summary":"Update Record","description":"Modifier un enregistrement.","operationId":"update_record_api_v1_data_bots__bot_id__collections__collection_id__records__record_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordUpdateInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["data"],"summary":"Delete Record","description":"Supprimer un enregistrement.","operationId":"delete_record_api_v1_data_bots__bot_id__collections__collection_id__records__record_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}/records/bulk":{"post":{"tags":["data"],"summary":"Bulk Add Records","description":"Bulk insert up to 500 records into a collection. Schema-validated if enabled.","operationId":"bulk_add_records_api_v1_data_bots__bot_id__collections__collection_id__records_bulk_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRecordInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["data"],"summary":"Bulk Update Records","description":"Bulk update records. Each item must have 'id' + fields to update.","operationId":"bulk_update_records_api_v1_data_bots__bot_id__collections__collection_id__records_bulk_put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["data"],"summary":"Bulk Delete Records","description":"Bulk delete up to 500 records by ID.","operationId":"bulk_delete_records_api_v1_data_bots__bot_id__collections__collection_id__records_bulk_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}/export":{"get":{"tags":["data"],"summary":"Export Collection","description":"Export all records from a collection as JSON or CSV download.","operationId":"export_collection_api_v1_data_bots__bot_id__collections__collection_id__export_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/collections/{collection_id}/import":{"post":{"tags":["data"],"summary":"Import Collection Records","description":"Import records into a collection (JSON body with records array).\n\nEach record should be a dict of field values (no 'data' wrapper needed).","operationId":"import_collection_records_api_v1_data_bots__bot_id__collections__collection_id__import_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRecordsInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/tasks":{"post":{"tags":["data"],"summary":"Create Task","description":"Créer une tâche ou rendez-vous.","operationId":"create_task_api_v1_data_bots__bot_id__tasks_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"List Tasks","description":"Lister les tâches d'un bot.","operationId":"list_tasks_api_v1_data_bots__bot_id__tasks_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"task_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Task Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/tasks/{task_id}":{"put":{"tags":["data"],"summary":"Update Task","description":"Modifier une tâche.","operationId":"update_task_api_v1_data_bots__bot_id__tasks__task_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdateInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["data"],"summary":"Delete Task","description":"Supprimer une tâche.","operationId":"delete_task_api_v1_data_bots__bot_id__tasks__task_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data/bots/{bot_id}/task-stats":{"get":{"tags":["data"],"summary":"Task Stats","description":"Statistiques des tâches.","operationId":"task_stats_api_v1_data_bots__bot_id__task_stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/types":{"get":{"tags":["channels"],"summary":"List Channel Types","description":"List available channel types with setup instructions.","operationId":"list_channel_types_api_v1_channels_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/channels/bot/{bot_id}":{"get":{"tags":["channels"],"summary":"List Bot Channels","description":"List all channels connected to a bot.","operationId":"list_bot_channels_api_v1_channels_bot__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/bot/{bot_id}/connect":{"post":{"tags":["channels"],"summary":"Connect Channel","description":"Connect a new channel to a bot.","operationId":"connect_channel_api_v1_channels_bot__bot_id__connect_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/bot/{bot_id}/{channel_id}":{"delete":{"tags":["channels"],"summary":"Disconnect Channel","description":"Disconnect and remove a channel from a bot.","operationId":"disconnect_channel_api_v1_channels_bot__bot_id___channel_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/{channel_id}/status":{"get":{"tags":["channels"],"summary":"Get Channel Status","description":"Get detailed status for a specific channel.","operationId":"get_channel_status_api_v1_channels__channel_id__status_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/telegram/webhook/{channel_id}":{"post":{"tags":["channels"],"summary":"Telegram Webhook","description":"Receive Telegram updates for a specific bot channel.","operationId":"telegram_webhook_api_v1_channels_telegram_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/meta/webhook/{channel_id}":{"get":{"tags":["channels"],"summary":"Meta Webhook Verify","description":"Verify webhook for Instagram/Messenger (Meta platform).","operationId":"meta_webhook_verify_api_v1_channels_meta_webhook__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Meta Webhook Receive","description":"Receive Instagram DM or Messenger messages.","operationId":"meta_webhook_receive_api_v1_channels_meta_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/tiktok/webhook/{channel_id}":{"post":{"tags":["channels"],"summary":"Tiktok Webhook","description":"Receive TikTok Business Messaging events.","operationId":"tiktok_webhook_api_v1_channels_tiktok_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/routing-rules/{bot_id}":{"get":{"tags":["channels"],"summary":"List Routing Rules","description":"List all routing rules for a bot.","operationId":"list_routing_rules_api_v1_channels_routing_rules__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Create Routing Rule","description":"Create a channel routing rule.","operationId":"create_routing_rule_api_v1_channels_routing_rules__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__channels__RoutingRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/routing-rules/{bot_id}/{rule_id}":{"put":{"tags":["channels"],"summary":"Update Routing Rule","description":"Update a routing rule.","operationId":"update_routing_rule_api_v1_channels_routing_rules__bot_id___rule_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__channels__RoutingRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channels"],"summary":"Delete Routing Rule","description":"Delete a routing rule.","operationId":"delete_routing_rule_api_v1_channels_routing_rules__bot_id___rule_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/{channel_id}/health":{"post":{"tags":["channels"],"summary":"Check Channel Health","description":"Check if a channel's credentials are valid and connection is alive.","operationId":"check_channel_health_api_v1_channels__channel_id__health_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/bot/{bot_id}/health-check-all":{"post":{"tags":["channels"],"summary":"Check All Channels Health","description":"Batch health check all channels for a bot.","operationId":"check_all_channels_health_api_v1_channels_bot__bot_id__health_check_all_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/{channel_id}/test":{"post":{"tags":["channels"],"summary":"Send Test Message","description":"Send a test message through a channel to verify it works end-to-end.","operationId":"send_test_message_api_v1_channels__channel_id__test_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/canned/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Canned Responses","description":"List canned responses for a bot. Owner only.","operationId":"list_canned_responses_api_v1_inbox_canned__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/canned":{"post":{"tags":["Inbox"],"summary":"Create Canned Response","description":"Create a canned response template.","operationId":"create_canned_response_api_v1_inbox_canned_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/canned/{response_id}":{"put":{"tags":["Inbox"],"summary":"Update Canned Response","description":"Update a canned response.","operationId":"update_canned_response_api_v1_inbox_canned__response_id__put","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete Canned Response","description":"Delete a canned response.","operationId":"delete_canned_response_api_v1_inbox_canned__response_id__delete","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/canned/{response_id}/use":{"post":{"tags":["Inbox"],"summary":"Use Canned Response","description":"Increment usage count of a canned response (for analytics/sorting).","operationId":"use_canned_response_api_v1_inbox_canned__response_id__use_post","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/sessions/{session_id}/tags":{"put":{"tags":["Inbox"],"summary":"Update Session Tags","description":"Set tags on a conversation session. Owner of the bot only.","operationId":"update_session_tags_api_v1_inbox_sessions__session_id__tags_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTagsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/tags/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Bot Tags","description":"List all unique tags used across sessions of a bot.","operationId":"list_bot_tags_api_v1_inbox_tags__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/sessions/{session_id}/assign":{"put":{"tags":["Inbox"],"summary":"Assign Session","description":"Assign a conversation to a team member (or unassign).","operationId":"assign_session_api_v1_inbox_sessions__session_id__assign_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionAssign"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/auto-assign/{bot_id}":{"post":{"tags":["Inbox"],"summary":"Auto Assign","description":"Auto-assign unassigned conversations using round-robin.\nIf session_id is given, assign just that one. Otherwise assign all unassigned.","operationId":"auto_assign_api_v1_inbox_auto_assign__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/views":{"get":{"tags":["Inbox"],"summary":"List Views","description":"List saved inbox views for the current user.","operationId":"list_views_api_v1_inbox_views_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Inbox"],"summary":"Create View","description":"Create a saved inbox view with filters.","operationId":"create_view_api_v1_inbox_views_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedViewCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/views/{view_id}":{"delete":{"tags":["Inbox"],"summary":"Delete View","description":"Delete a saved view.","operationId":"delete_view_api_v1_inbox_views__view_id__delete","parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/sessions/{session_id}/status":{"put":{"tags":["Inbox"],"summary":"Update Session Status","description":"Update conversation status (active/waiting/resolved/closed).","operationId":"update_session_status_api_v1_inbox_sessions__session_id__status_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/conversations/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Inbox Conversations","description":"List conversations with filtering by status, assignment, and tags.\nReturns enriched data including tags, status, and assignment info.","operationId":"list_inbox_conversations_api_v1_inbox_conversations__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(active|waiting|resolved|closed)$"},{"type":"null"}],"title":"Status"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/stats/{bot_id}":{"get":{"tags":["Inbox"],"summary":"Inbox Stats","description":"Get inbox statistics: counts by status, unassigned count.","operationId":"inbox_stats_api_v1_inbox_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/notes/{session_id}":{"get":{"tags":["Inbox"],"summary":"List Notes","description":"List internal notes on a conversation.","operationId":"list_notes_api_v1_inbox_notes__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Inbox"],"summary":"Create Note","description":"Add an internal note to a conversation (not visible to end-user).\nSupports @mentions: include @email in the note content to notify that agent.","operationId":"create_note_api_v1_inbox_notes__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalNoteCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/notes/{note_id}":{"delete":{"tags":["Inbox"],"summary":"Delete Note","description":"Delete an internal note.","operationId":"delete_note_api_v1_inbox_notes__note_id__delete","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/summary/{session_id}":{"get":{"tags":["Inbox"],"summary":"Ai Summary","description":"Generate an AI summary of a conversation for agent handoff.","operationId":"ai_summary_api_v1_inbox_summary__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/export/{bot_id}":{"get":{"tags":["Inbox"],"summary":"Export Conversations","description":"Export conversations with messages as CSV or JSON.\n- CSV: flat format (one row per message) for spreadsheet analysis\n- JSON: nested format (sessions → messages) for programmatic use","operationId":"export_conversations_api_v1_inbox_export__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json)$","default":"json","title":"Format"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"include_messages","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Messages"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/export-session/{session_id}":{"get":{"tags":["Inbox"],"summary":"Export Single Conversation","description":"Export a single conversation with all messages.","operationId":"export_single_conversation_api_v1_inbox_export_session__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json|text)$","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/assignment-rules":{"post":{"tags":["Inbox"],"summary":"Create Assignment Rule","description":"Create an auto-assignment rule for a bot.","operationId":"create_assignment_rule_api_v1_inbox_assignment_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRuleCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/assignment-rules/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Assignment Rules","description":"List assignment rules for a bot.","operationId":"list_assignment_rules_api_v1_inbox_assignment_rules__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/assignment-rules/{rule_id}":{"put":{"tags":["Inbox"],"summary":"Update Assignment Rule","description":"Update an assignment rule.","operationId":"update_assignment_rule_api_v1_inbox_assignment_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete Assignment Rule","description":"Delete an assignment rule.","operationId":"delete_assignment_rule_api_v1_inbox_assignment_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/assignment-rules/{bot_id}/evaluate":{"post":{"tags":["Inbox"],"summary":"Evaluate Assignment Rules","description":"Evaluate assignment rules for a session and return the best agent match.\npayload: {session_id, channel, tags, language}","operationId":"evaluate_assignment_rules_api_v1_inbox_assignment_rules__bot_id__evaluate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/custom-fields":{"post":{"tags":["Inbox"],"summary":"Create Custom Field","description":"Define a custom field for conversations of a bot.","operationId":"create_custom_field_api_v1_inbox_custom_fields_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldDefinition"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/custom-fields/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Custom Fields","description":"List custom field definitions for a bot.","operationId":"list_custom_fields_api_v1_inbox_custom_fields__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/custom-fields/{field_id}":{"put":{"tags":["Inbox"],"summary":"Update Custom Field","description":"Update a custom field definition.","operationId":"update_custom_field_api_v1_inbox_custom_fields__field_id__put","parameters":[{"name":"field_id","in":"path","required":true,"schema":{"type":"string","title":"Field Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete Custom Field","description":"Delete a custom field definition.","operationId":"delete_custom_field_api_v1_inbox_custom_fields__field_id__delete","parameters":[{"name":"field_id","in":"path","required":true,"schema":{"type":"string","title":"Field Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/inbox/sessions/{session_id}/custom-fields":{"put":{"tags":["Inbox"],"summary":"Set Session Custom Fields","description":"Set custom field values on a session.","operationId":"set_session_custom_fields_api_v1_inbox_sessions__session_id__custom_fields_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldValueSet"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Inbox"],"summary":"Get Session Custom Fields","description":"Get custom field values for a session.","operationId":"get_session_custom_fields_api_v1_inbox_sessions__session_id__custom_fields_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/takeover/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Takeover Conversation","description":"Agent takes over a conversation — marks it as handoff and assigns to the agent.","operationId":"takeover_conversation_api_v1_live_agent_takeover__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/release/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Release Conversation","description":"Release conversation back to bot (end handoff).","operationId":"release_conversation_api_v1_live_agent_release__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffReleaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/reply/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Agent Reply","description":"Agent sends a message in a conversation (human reply instead of bot).","operationId":"agent_reply_api_v1_live_agent_reply__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/messages/{session_id}":{"get":{"tags":["Live Agent"],"summary":"Get Agent Messages","description":"Get all agent messages for a session (for agent dashboard).","operationId":"get_agent_messages_api_v1_live_agent_messages__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/handoff-queue/{bot_id}":{"get":{"tags":["Live Agent"],"summary":"Get Handoff Queue","description":"Get all conversations waiting for human handoff.","operationId":"get_handoff_queue_api_v1_live_agent_handoff_queue__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/transfer/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Transfer Conversation","description":"Transfer a conversation from one agent to another with optional context note.","operationId":"transfer_conversation_api_v1_live_agent_transfer__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/whisper/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Send Whisper","description":"Send a private whisper message to the agent handling a session.\nWhispers are internal-only — the customer NEVER sees them.\nUseful for supervisors coaching agents in real-time.","operationId":"send_whisper_api_v1_live_agent_whisper__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhisperRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/whispers/{session_id}":{"get":{"tags":["Live Agent"],"summary":"Get Whispers","description":"Get all whisper messages for a session (agent-only view).","operationId":"get_whispers_api_v1_live_agent_whispers__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/canned-responses/{bot_id}":{"post":{"tags":["Live Agent"],"summary":"Create Canned Response","description":"Create a canned (pre-written) response for agents to quickly insert.","operationId":"create_canned_response_api_v1_live_agent_canned_responses__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Live Agent"],"summary":"List Canned Responses","description":"List all canned responses for a bot (optionally filter by category or search).","operationId":"list_canned_responses_api_v1_live_agent_canned_responses__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/canned-responses/{bot_id}/{response_id}":{"put":{"tags":["Live Agent"],"summary":"Update Canned Response","description":"Update a canned response.","operationId":"update_canned_response_api_v1_live_agent_canned_responses__bot_id___response_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Live Agent"],"summary":"Delete Canned Response","description":"Delete a canned response.","operationId":"delete_canned_response_api_v1_live_agent_canned_responses__bot_id___response_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/live-agent/metrics/{bot_id}":{"get":{"tags":["Live Agent"],"summary":"Get Agent Metrics","description":"Get agent performance metrics: response time, handle time, resolution rate, volume.\nOptionally filter by specific agent_id. Defaults to last 30 days.","operationId":"get_agent_metrics_api_v1_live_agent_metrics__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/{bot_id}":{"get":{"tags":["Tickets"],"summary":"List Tickets","description":"List tickets for a bot with optional filters.","operationId":"list_tickets_api_v1_tickets__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":30,"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/":{"post":{"tags":["Tickets"],"summary":"Create Ticket","description":"Create a new ticket (optionally linked to a conversation).","operationId":"create_ticket_api_v1_tickets__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/detail/{ticket_id}":{"get":{"tags":["Tickets"],"summary":"Get Ticket","description":"Get ticket details with comments.","operationId":"get_ticket_api_v1_tickets_detail__ticket_id__get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Tickets"],"summary":"Update Ticket","description":"Update ticket fields.","operationId":"update_ticket_api_v1_tickets_detail__ticket_id__put","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Tickets"],"summary":"Delete Ticket","description":"Delete a ticket (owner only).","operationId":"delete_ticket_api_v1_tickets_detail__ticket_id__delete","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/detail/{ticket_id}/comments":{"post":{"tags":["Tickets"],"summary":"Add Comment","description":"Add a comment to a ticket.","operationId":"add_comment_api_v1_tickets_detail__ticket_id__comments_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCommentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/from-conversation/{session_id}":{"post":{"tags":["Tickets"],"summary":"Create Ticket From Conversation","description":"Convert a conversation into a ticket with auto-populated fields.","operationId":"create_ticket_from_conversation_api_v1_tickets_from_conversation__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","pattern":"^(low|medium|high|urgent)$","default":"medium","title":"Priority"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/stats/{bot_id}":{"get":{"tags":["Tickets"],"summary":"Ticket Stats","description":"Ticket statistics for a bot.","operationId":"ticket_stats_api_v1_tickets_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/sla-rules":{"post":{"tags":["Tickets"],"summary":"Create Sla Rule","description":"Create a custom SLA rule for a bot (e.g. urgent tickets must be resolved in 2h).","operationId":"create_sla_rule_api_v1_tickets_sla_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SLARuleCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/sla-rules/{bot_id}":{"get":{"tags":["Tickets"],"summary":"List Sla Rules","description":"List all SLA rules for a bot.","operationId":"list_sla_rules_api_v1_tickets_sla_rules__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/sla-rules/{rule_id}":{"delete":{"tags":["Tickets"],"summary":"Delete Sla Rule","description":"Delete an SLA rule.","operationId":"delete_sla_rule_api_v1_tickets_sla_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tickets/sla-check/{bot_id}":{"get":{"tags":["Tickets"],"summary":"Check Sla Breaches","description":"Check all open tickets for SLA breaches — returns breached + at-risk tickets.\n- breached: past deadline\n- at_risk: within 1 hour of deadline\nAlso sends notifications for newly breached tickets.","operationId":"check_sla_breaches_api_v1_tickets_sla_check__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/csat/submit":{"post":{"tags":["CSAT & Visitors"],"summary":"Submit Csat","description":"Submit a CSAT rating. Public endpoint (no auth) — called from chat widget.","operationId":"submit_csat_api_v1_csat_submit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSATSubmitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/csat/results/{bot_id}":{"get":{"tags":["CSAT & Visitors"],"summary":"Get Csat Results","description":"Get CSAT results and analytics for a bot.","operationId":"get_csat_results_api_v1_csat_results__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/csat/config/{bot_id}":{"put":{"tags":["CSAT & Visitors"],"summary":"Update Csat Config","description":"Update CSAT configuration on a bot.","operationId":"update_csat_config_api_v1_csat_config__bot_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSATConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/csat/visitor-event":{"post":{"tags":["CSAT & Visitors"],"summary":"Track Visitor Event","description":"Track a visitor event. Public endpoint (no auth) — called from widget JS.","operationId":"track_visitor_event_api_v1_csat_visitor_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorEventRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/csat/visitors/{bot_id}":{"get":{"tags":["CSAT & Visitors"],"summary":"Get Visitor Analytics","description":"Get visitor analytics for a bot (requires auth).","operationId":"get_visitor_analytics_api_v1_csat_visitors__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/":{"get":{"tags":["Notifications"],"summary":"List Notifications","description":"List user's notifications (newest first).","operationId":"list_notifications_api_v1_notifications__get","parameters":[{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}},{"name":"notif_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notif Type"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/unread-count":{"get":{"tags":["Notifications"],"summary":"Unread Count","description":"Quick unread count for badge display.","operationId":"unread_count_api_v1_notifications_unread_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/notifications/read/{notification_id}":{"put":{"tags":["Notifications"],"summary":"Mark As Read","description":"Mark a notification as read.","operationId":"mark_as_read_api_v1_notifications_read__notification_id__put","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/read-all":{"put":{"tags":["Notifications"],"summary":"Mark All Read","description":"Mark all notifications as read.","operationId":"mark_all_read_api_v1_notifications_read_all_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/notifications/clear-all":{"delete":{"tags":["Notifications"],"summary":"Clear All","description":"Delete all read notifications (keep unread).","operationId":"clear_all_api_v1_notifications_clear_all_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/notifications/{notification_id}":{"delete":{"tags":["Notifications"],"summary":"Delete Notification","description":"Delete a notification.","operationId":"delete_notification_api_v1_notifications__notification_id__delete","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/preferences":{"get":{"tags":["Notifications"],"summary":"Get Preferences","description":"Get notification preferences.","operationId":"get_preferences_api_v1_notifications_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["Notifications"],"summary":"Update Preferences","description":"Update notification preferences.","operationId":"update_preferences_api_v1_notifications_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefsUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"List Flows","description":"List all automation flows for a bot.","operationId":"list_flows_api_v1_automations_flows__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows":{"post":{"tags":["Automations & Flows"],"summary":"Create Flow","description":"Create an automation flow.","operationId":"create_flow_api_v1_automations_flows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/detail/{flow_id}":{"get":{"tags":["Automations & Flows"],"summary":"Get Flow","description":"Get a single flow.","operationId":"get_flow_api_v1_automations_flows_detail__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Automations & Flows"],"summary":"Update Flow","description":"Update a flow.","operationId":"update_flow_api_v1_automations_flows_detail__flow_id__put","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFlowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Automations & Flows"],"summary":"Delete Flow","description":"Delete a flow.","operationId":"delete_flow_api_v1_automations_flows_detail__flow_id__delete","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/toggle/{flow_id}":{"put":{"tags":["Automations & Flows"],"summary":"Toggle Flow","description":"Toggle a flow's active status.","operationId":"toggle_flow_api_v1_automations_flows_toggle__flow_id__put","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/stats/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"Flow Stats","description":"Aggregated flow stats for a bot.","operationId":"flow_stats_api_v1_automations_flows_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/logs/{flow_id}":{"get":{"tags":["Automations & Flows"],"summary":"Flow Logs","description":"Get execution logs for a flow.","operationId":"flow_logs_api_v1_automations_flows_logs__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/proactive/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"List Proactive","description":"List proactive messages for a bot.","operationId":"list_proactive_api_v1_automations_proactive__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/proactive":{"post":{"tags":["Automations & Flows"],"summary":"Create Proactive","description":"Create a proactive message rule.","operationId":"create_proactive_api_v1_automations_proactive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/proactive/{msg_id}":{"put":{"tags":["Automations & Flows"],"summary":"Update Proactive","description":"Update a proactive message.","operationId":"update_proactive_api_v1_automations_proactive__msg_id__put","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Automations & Flows"],"summary":"Delete Proactive","description":"Delete a proactive message.","operationId":"delete_proactive_api_v1_automations_proactive__msg_id__delete","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/proactive/toggle/{msg_id}":{"put":{"tags":["Automations & Flows"],"summary":"Toggle Proactive","description":"Toggle a proactive message on/off.","operationId":"toggle_proactive_api_v1_automations_proactive_toggle__msg_id__put","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/proactive/widget/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"Get Active Proactive For Widget","description":"Widget calls this to get proactive messages to display.","operationId":"get_active_proactive_for_widget_api_v1_automations_proactive_widget__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"page_url","in":"query","required":false,"schema":{"type":"string","default":"","title":"Page Url"}},{"name":"visit_count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Visit Count"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/proactive/widget/{msg_id}/stat":{"post":{"tags":["Automations & Flows"],"summary":"Track Proactive Stat","description":"Track proactive message interaction (widget-facing, no auth).","operationId":"track_proactive_stat_api_v1_automations_proactive_widget__msg_id__stat_post","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}},{"name":"action","in":"query","required":true,"schema":{"type":"string","pattern":"^(sent|clicked|dismissed)$","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/{flow_id}/execute":{"post":{"tags":["Automations & Flows"],"summary":"Execute Flow","description":"Manually execute a flow with given context.\n\nContext example: {\"session_id\": \"...\", \"message\": \"hello\", \"channel\": \"widget\"}","operationId":"execute_flow_api_v1_automations_flows__flow_id__execute_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Context"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/evaluate/{bot_id}":{"post":{"tags":["Automations & Flows"],"summary":"Evaluate Flows","description":"Evaluate all active flows for a bot against the given context.\n\nReturns matched flows and optionally executes the first matching one.","operationId":"evaluate_flows_api_v1_automations_flows_evaluate__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Context"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/templates":{"get":{"tags":["Automations & Flows"],"summary":"List Flow Templates","description":"Get pre-built flow templates.","operationId":"list_flow_templates_api_v1_automations_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/automations/templates/{template_id}":{"get":{"tags":["Automations & Flows"],"summary":"Get Flow Template","description":"Get a specific flow template by ID.","operationId":"get_flow_template_api_v1_automations_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/from-template":{"post":{"tags":["Automations & Flows"],"summary":"Create Flow From Template","description":"Create a new flow from a pre-built template.","operationId":"create_flow_from_template_api_v1_automations_flows_from_template_post","parameters":[{"name":"template_id","in":"query","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/automations/flows/{flow_id}/clone":{"post":{"tags":["Automations & Flows"],"summary":"Clone Flow","description":"Clone an existing flow.","operationId":"clone_flow_api_v1_automations_flows__flow_id__clone_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/categories/{bot_id}":{"get":{"tags":["Help Center"],"summary":"List Categories","description":"List all categories for a bot's help center.","operationId":"list_categories_api_v1_helpcenter_categories__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/categories":{"post":{"tags":["Help Center"],"summary":"Create Category","description":"Create a help center category.","operationId":"create_category_api_v1_helpcenter_categories_post","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/categories/{category_id}":{"put":{"tags":["Help Center"],"summary":"Update Category","description":"Update a category.","operationId":"update_category_api_v1_helpcenter_categories__category_id__put","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Help Center"],"summary":"Delete Category","description":"Delete a category (articles become uncategorized).","operationId":"delete_category_api_v1_helpcenter_categories__category_id__delete","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/articles/{bot_id}":{"get":{"tags":["Help Center"],"summary":"List Articles","description":"List articles for admin management.","operationId":"list_articles_api_v1_helpcenter_articles__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/articles":{"post":{"tags":["Help Center"],"summary":"Create Article","description":"Create a help center article.","operationId":"create_article_api_v1_helpcenter_articles_post","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/articles/detail/{article_id}":{"get":{"tags":["Help Center"],"summary":"Get Article Admin","description":"Get article detail (admin).","operationId":"get_article_admin_api_v1_helpcenter_articles_detail__article_id__get","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Help Center"],"summary":"Update Article","description":"Update an article.","operationId":"update_article_api_v1_helpcenter_articles_detail__article_id__put","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Help Center"],"summary":"Delete Article","description":"Delete an article.","operationId":"delete_article_api_v1_helpcenter_articles_detail__article_id__delete","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/public/{bot_id}":{"get":{"tags":["Help Center"],"summary":"Public Helpcenter","description":"Public help center: categories + published article counts.","operationId":"public_helpcenter_api_v1_helpcenter_public__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","default":"fr","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/public/{bot_id}/search":{"get":{"tags":["Help Center"],"summary":"Public Search","description":"Public full-text search for articles.","operationId":"public_search_api_v1_helpcenter_public__bot_id__search_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/public/{bot_id}/article/{slug}":{"get":{"tags":["Help Center"],"summary":"Public Article","description":"Get a published article by slug (increments view count).","operationId":"public_article_api_v1_helpcenter_public__bot_id__article__slug__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/public/{bot_id}/article/{article_id}/feedback":{"post":{"tags":["Help Center"],"summary":"Article Feedback","description":"Submit feedback on an article (helpful/not helpful).","operationId":"article_feedback_api_v1_helpcenter_public__bot_id__article__article_id__feedback_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleFeedback"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/stats/{bot_id}":{"get":{"tags":["Help Center"],"summary":"Helpcenter Stats","description":"Help center analytics.","operationId":"helpcenter_stats_api_v1_helpcenter_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/suggest/{bot_id}":{"get":{"tags":["Help Center"],"summary":"Auto Suggest Articles","description":"Auto-suggest relevant Help Center articles based on user's live chat input.\nNo auth required (used from chat widget).\nReturns lightweight article suggestions with title, slug, and relevance score.","operationId":"auto_suggest_articles_api_v1_helpcenter_suggest__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/helpcenter/suggest/{bot_id}/by-session":{"get":{"tags":["Help Center"],"summary":"Suggest Articles For Session","description":"Suggest Help Center articles based on a conversation session's recent messages.\nAnalyzes the last few messages to find relevant KB articles.\nNo auth required (used from agent panel).","operationId":"suggest_articles_for_session_api_v1_helpcenter_suggest__bot_id__by_session_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"default":3,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"List Contacts","description":"List contacts with powerful filtering.","operationId":"list_contacts_api_v1_contacts__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"segment_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Segment Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","pattern":"^(last_seen_at|created_at|name|message_count)$","default":"last_seen_at","title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"desc","title":"Sort Dir"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/":{"post":{"tags":["Contacts CRM"],"summary":"Create Contact","description":"Create a contact manually.","operationId":"create_contact_api_v1_contacts__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/detail/{contact_id}":{"get":{"tags":["Contacts CRM"],"summary":"Get Contact","description":"Get contact profile with activity summary.","operationId":"get_contact_api_v1_contacts_detail__contact_id__get","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Contacts CRM"],"summary":"Update Contact","description":"Update a contact.","operationId":"update_contact_api_v1_contacts_detail__contact_id__put","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts CRM"],"summary":"Delete Contact","description":"Delete a contact.","operationId":"delete_contact_api_v1_contacts_detail__contact_id__delete","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/detail/{contact_id}/tag":{"post":{"tags":["Contacts CRM"],"summary":"Add Tag","description":"Add a tag to a contact.","operationId":"add_tag_api_v1_contacts_detail__contact_id__tag_post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"tag","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts CRM"],"summary":"Remove Tag","description":"Remove a tag from a contact.","operationId":"remove_tag_api_v1_contacts_detail__contact_id__tag_delete","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"tag","in":"query","required":true,"schema":{"type":"string","title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/detail/{contact_id}/notes":{"post":{"tags":["Contacts CRM"],"summary":"Add Note","description":"Add a note/activity to the contact's timeline.","operationId":"add_note_api_v1_contacts_detail__contact_id__notes_post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"content","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Content"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/merge":{"post":{"tags":["Contacts CRM"],"summary":"Merge Contacts","description":"Merge two contacts (secondary into primary).","operationId":"merge_contacts_api_v1_contacts_merge_post","parameters":[{"name":"primary_id","in":"query","required":true,"schema":{"type":"string","title":"Primary Id"}},{"name":"secondary_id","in":"query","required":true,"schema":{"type":"string","title":"Secondary Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/segments/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"List Segments","description":"List contact segments.","operationId":"list_segments_api_v1_contacts_segments__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/segments":{"post":{"tags":["Contacts CRM"],"summary":"Create Segment","description":"Create a contact segment.","operationId":"create_segment_api_v1_contacts_segments_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__contacts__SegmentCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/segments/{segment_id}":{"delete":{"tags":["Contacts CRM"],"summary":"Delete Segment","description":"Delete a segment.","operationId":"delete_segment_api_v1_contacts_segments__segment_id__delete","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/companies/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"List Companies","description":"List companies.","operationId":"list_companies_api_v1_contacts_companies__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/companies":{"post":{"tags":["Contacts CRM"],"summary":"Create Company","description":"Create a company.","operationId":"create_company_api_v1_contacts_companies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/companies/{company_id}":{"put":{"tags":["Contacts CRM"],"summary":"Update Company","description":"Update a company.","operationId":"update_company_api_v1_contacts_companies__company_id__put","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts CRM"],"summary":"Delete Company","description":"Delete a company.","operationId":"delete_company_api_v1_contacts_companies__company_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/leads/{lead_id}/stage":{"patch":{"tags":["Contacts CRM"],"summary":"Update Lead Stage","description":"Move a lead to a different pipeline stage.","operationId":"update_lead_stage_api_v1_contacts_leads__lead_id__stage_patch","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadStageUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/leads/pipeline/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"Get Lead Pipeline","description":"Get lead pipeline summary with counts per stage.","operationId":"get_lead_pipeline_api_v1_contacts_leads_pipeline__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/stats/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"Contact Stats","description":"Contact analytics for a bot.","operationId":"contact_stats_api_v1_contacts_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/export/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"Export Contacts","description":"Export all contacts for a bot as CSV or JSON download.","operationId":"export_contacts_api_v1_contacts_export__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json)$","default":"csv","title":"Format"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/import/{bot_id}":{"post":{"tags":["Contacts CRM"],"summary":"Import Contacts","description":"Import contacts from CSV-like data or JSON array.\n\nBody format:\n{\n  \"contacts\": [\n    {\"name\": \"...\", \"email\": \"...\", \"phone\": \"...\", \"company\": \"...\", \"channel\": \"web\", \"tags\": [\"vip\"], \"notes\": \"...\"},\n    ...\n  ],\n  \"update_existing\": true  // if contact with same email/phone exists, update it\n}","operationId":"import_contacts_api_v1_contacts_import__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/presence/heartbeat":{"post":{"tags":["Presence"],"summary":"Heartbeat","description":"Agent sends heartbeat to maintain online status. Called every 30s from dashboard.","operationId":"heartbeat_api_v1_presence_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PresenceUpdate"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/presence/team":{"get":{"tags":["Presence"],"summary":"Team Presence","description":"Get online status of team members the user can see (same team only).","operationId":"team_presence_api_v1_presence_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/presence/status":{"put":{"tags":["Presence"],"summary":"Update My Status","description":"Manually set your online status.","operationId":"update_my_status_api_v1_presence_status_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresenceUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/presence/available":{"get":{"tags":["Presence"],"summary":"Available Agents","description":"Get list of agents currently online and available for assignment.","operationId":"available_agents_api_v1_presence_available_get","parameters":[{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/presence/sessions/{session_id}/activity":{"post":{"tags":["Presence"],"summary":"Update Session Activity","description":"Report agent activity on a session (typing, viewing, replying).\nUsed to detect collisions — multiple agents on same session.\nDashboard polls every 3–5 seconds when a session is open.","operationId":"update_session_activity_api_v1_presence_sessions__session_id__activity_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SessionActivityUpdate"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Presence"],"summary":"Get Session Activity","description":"Check who is currently active on a session (collision check).\nReturns list of agents currently typing/viewing this session.","operationId":"get_session_activity_api_v1_presence_sessions__session_id__activity_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Presence"],"summary":"Leave Session","description":"Signal that agent left a session (stopped viewing/typing).","operationId":"leave_session_api_v1_presence_sessions__session_id__activity_delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/platform/status":{"get":{"tags":["Platform"],"summary":"Public Status","description":"Public status endpoint — no auth required. Shows system health.","operationId":"public_status_api_v1_platform_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/platform/changelog":{"get":{"tags":["Platform"],"summary":"Get Changelog","description":"Get recent changelog entries.","operationId":"get_changelog_api_v1_platform_changelog_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/platform/changelog/latest":{"get":{"tags":["Platform"],"summary":"Get Latest Changelog","description":"Get latest version info for 'What's New' banner.","operationId":"get_latest_changelog_api_v1_platform_changelog_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/platform/gdpr/export":{"get":{"tags":["Platform"],"summary":"Gdpr Data Export","description":"Export all personal data for GDPR compliance (Article 20 - Right to portability).","operationId":"gdpr_data_export_api_v1_platform_gdpr_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/platform/gdpr/delete":{"delete":{"tags":["Platform"],"summary":"Gdpr Delete Data","description":"Request complete data deletion (GDPR Article 17 - Right to erasure).\nThis queues the deletion — actual deletion is immediate for own data.","operationId":"gdpr_delete_data_api_v1_platform_gdpr_delete_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"List tasks for a bot.","operationId":"list_tasks_api_v1_tasks_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tasks"],"summary":"Create Task","description":"Create a new task or appointment.","operationId":"create_task_api_v1_tasks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/{task_id}":{"put":{"tags":["tasks"],"summary":"Update Task","description":"Update a task.","operationId":"update_task_api_v1_tasks__task_id__put","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","description":"Delete a task.","operationId":"delete_task_api_v1_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/stats":{"get":{"tags":["tasks"],"summary":"Task Stats","description":"Get task statistics for a bot.","operationId":"task_stats_api_v1_tasks_stats_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/due-soon":{"get":{"tags":["tasks"],"summary":"Get Due Soon Tasks","description":"Get tasks whose due date is within the next N hours (default: 24h).\nAlso includes overdue tasks (past deadline but not completed).","operationId":"get_due_soon_tasks_api_v1_tasks_due_soon_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/check-reminders/{bot_id}":{"post":{"tags":["tasks"],"summary":"Check And Send Reminders","description":"Check due tasks and send reminder notifications to assigned agents.\nCall this periodically (e.g. every hour via cron/webhook).","operationId":"check_and_send_reminders_api_v1_tasks_check_reminders__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/calendar":{"get":{"tags":["tasks"],"summary":"Get Tasks Calendar","description":"Get tasks/appointments within a date range (for calendar view).","operationId":"get_tasks_calendar_api_v1_tasks_calendar_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","description":"ISO format start date","title":"Start Date"},"description":"ISO format start date"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","description":"ISO format end date","title":"End Date"},"description":"ISO format end date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/process-recurring/{bot_id}":{"post":{"tags":["tasks"],"summary":"Process Recurring Tasks","description":"Process completed recurring tasks: clone them with the next due date.\nCall via cron or webhook periodically.","operationId":"process_recurring_tasks_api_v1_tasks_process_recurring__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tasks/bulk":{"post":{"tags":["tasks"],"summary":"Bulk Create Tasks","description":"Bulk create up to 100 tasks.","operationId":"bulk_create_tasks_api_v1_tasks_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTaskInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/realtime/config":{"get":{"tags":["Realtime"],"summary":"Realtime Config","description":"Return Supabase Realtime config for client-side subscription.\nThe anon key is safe to expose — RLS protects all data.\nWidget users get minimal config (no auth needed for public channels).","operationId":"realtime_config_api_v1_realtime_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/realtime/typing/{session_id}":{"post":{"tags":["Realtime"],"summary":"Send Typing Indicator","description":"Record a typing event — clients poll or use Realtime to display.\nWorks for both widget visitors (no auth) and agents (auth).","operationId":"send_typing_indicator_api_v1_realtime_typing__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/realtime/poll/{session_id}":{"get":{"tags":["Realtime"],"summary":"Poll Messages","description":"Poll for new messages since a given timestamp.\nFallback for clients that can't use Supabase Realtime.\nReturns messages newer than 'after' timestamp.\nRequires valid session_id (UUID format) — session acts as capability token.","operationId":"poll_messages_api_v1_realtime_poll__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"after","in":"query","required":false,"schema":{"type":"string","default":"","title":"After"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/email/webhook/{channel_id}":{"post":{"tags":["email-channel"],"summary":"Email Webhook","description":"Receive inbound emails.\n\nSupports multiple formats:\n1. Resend inbound webhook (JSON with from, to, subject, text, html, headers)\n2. Generic JSON (from, subject, text/body, message_id)\n3. Form-encoded (for SMTP pipe/forwarding services)","operationId":"email_webhook_api_v1_channels_email_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["email-channel"],"summary":"Email Webhook Verify","description":"Health check / verification endpoint for email webhook.\nSome email forwarding services ping the URL to verify it's active.","operationId":"email_webhook_verify_api_v1_channels_email_webhook__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/email/templates/{bot_id}":{"get":{"tags":["email-channel"],"summary":"List Email Templates","description":"List email templates for a bot.","operationId":"list_email_templates_api_v1_channels_email_templates__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["email-channel"],"summary":"Create Email Template","description":"Create an email HTML template for branded replies.","operationId":"create_email_template_api_v1_channels_email_templates__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/email/templates/{bot_id}/{template_id}":{"put":{"tags":["email-channel"],"summary":"Update Email Template","description":"Update an email template.","operationId":"update_email_template_api_v1_channels_email_templates__bot_id___template_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["email-channel"],"summary":"Delete Email Template","description":"Delete an email template.","operationId":"delete_email_template_api_v1_channels_email_templates__bot_id___template_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/channels/email/templates/{bot_id}/{template_id}/preview":{"post":{"tags":["email-channel"],"summary":"Preview Email Template","description":"Preview a rendered email template with sample data.","operationId":"preview_email_template_api_v1_channels_email_templates__bot_id___template_id__preview_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/bots/{bot_id}/memories":{"get":{"tags":["Memory"],"summary":"List Memories","description":"List memories for a bot, with optional filters.","operationId":"list_memories_api_v1_memory_bots__bot_id__memories_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"contact_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Contact Id"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Memory"],"summary":"Create Memory","description":"Manually add a memory entry.","operationId":"create_memory_api_v1_memory_bots__bot_id__memories_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/bots/{bot_id}/memories/stats":{"get":{"tags":["Memory"],"summary":"Memory Stats","description":"Get memory statistics for a bot.","operationId":"memory_stats_api_v1_memory_bots__bot_id__memories_stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/memories/{memory_id}":{"put":{"tags":["Memory"],"summary":"Update Memory","description":"Update a memory entry.","operationId":"update_memory_api_v1_memory_memories__memory_id__put","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Memory"],"summary":"Delete Memory","description":"Delete a memory entry.","operationId":"delete_memory_api_v1_memory_memories__memory_id__delete","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/bots/{bot_id}/memories/recall":{"post":{"tags":["Memory"],"summary":"Recall Memories","description":"Test memory recall — search for relevant memories semantically.","operationId":"recall_memories_api_v1_memory_bots__bot_id__memories_recall_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryRecallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/bots/{bot_id}/memories/import":{"post":{"tags":["Memory"],"summary":"Import Memories","description":"Bulk import memories.","operationId":"import_memories_api_v1_memory_bots__bot_id__memories_import_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryImportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/memory/bots/{bot_id}/memories/clear":{"delete":{"tags":["Memory"],"summary":"Clear Memories","description":"Clear all memories for a bot (or a specific contact).","operationId":"clear_memories_api_v1_memory_bots__bot_id__memories_clear_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"contact_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills":{"get":{"tags":["Skills Marketplace"],"summary":"Browse Skills","description":"Browse the skills marketplace.","operationId":"browse_skills_api_v1_skills_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"official_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Official Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Skills Marketplace"],"summary":"Create Skill","description":"Create a custom skill.","operationId":"create_skill_api_v1_skills_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/categories":{"get":{"tags":["Skills Marketplace"],"summary":"Get Categories","description":"Get skill categories.","operationId":"get_categories_api_v1_skills_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/skills/{skill_id}":{"get":{"tags":["Skills Marketplace"],"summary":"Get Skill","description":"Get full skill details.","operationId":"get_skill_api_v1_skills__skill_id__get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Skills Marketplace"],"summary":"Update Skill","description":"Update a custom skill.","operationId":"update_skill_api_v1_skills__skill_id__put","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/bots/{bot_id}/installed":{"get":{"tags":["Skills Marketplace"],"summary":"Get Bot Skills","description":"Get all skills installed on a bot.","operationId":"get_bot_skills_api_v1_skills_bots__bot_id__installed_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Enabled Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/bots/{bot_id}/install":{"post":{"tags":["Skills Marketplace"],"summary":"Install Skill","description":"Install a skill on a bot.","operationId":"install_skill_api_v1_skills_bots__bot_id__install_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/bots/{bot_id}/uninstall":{"post":{"tags":["Skills Marketplace"],"summary":"Uninstall Skill","description":"Uninstall a skill from a bot.","operationId":"uninstall_skill_api_v1_skills_bots__bot_id__uninstall_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/bots/{bot_id}/skills/{skill_id}/toggle":{"put":{"tags":["Skills Marketplace"],"summary":"Toggle Skill","operationId":"toggle_skill_api_v1_skills_bots__bot_id__skills__skill_id__toggle_put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillToggle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/{skill_id}/versions":{"get":{"tags":["Skills Marketplace"],"summary":"Get Skill Versions","description":"Get version history for a skill.","operationId":"get_skill_versions_api_v1_skills__skill_id__versions_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/{skill_id}/publish-version":{"post":{"tags":["Skills Marketplace"],"summary":"Publish Skill Version","description":"Publish a new version of a skill. Saves version snapshot to history.","operationId":"publish_skill_version_api_v1_skills__skill_id__publish_version_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/{skill_id}/analytics":{"get":{"tags":["Skills Marketplace"],"summary":"Get Skill Analytics","description":"Get analytics for a skill: install count, usage stats, ratings.","operationId":"get_skill_analytics_api_v1_skills__skill_id__analytics_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/{skill_id}/rate":{"post":{"tags":["Skills Marketplace"],"summary":"Rate Skill","description":"Rate and review a skill (1-5 stars).","operationId":"rate_skill_api_v1_skills__skill_id__rate_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRating"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/{skill_id}/clone":{"post":{"tags":["Skills Marketplace"],"summary":"Clone Skill","description":"Clone a skill for customization.","operationId":"clone_skill_api_v1_skills__skill_id__clone_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/{skill_id}/export":{"get":{"tags":["Skills Marketplace"],"summary":"Export Skill","description":"Export a skill definition as JSON (for import into another workspace).","operationId":"export_skill_api_v1_skills__skill_id__export_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/import":{"post":{"tags":["Skills Marketplace"],"summary":"Import Skill","description":"Import a skill from a JSON definition.","operationId":"import_skill_api_v1_skills_import_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillImportInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/skills/bots/{bot_id}/copy-from/{source_bot_id}":{"post":{"tags":["Skills Marketplace"],"summary":"Copy Skills From Bot","description":"Copy all installed skills from source_bot to target bot.","operationId":"copy_skills_from_bot_api_v1_skills_bots__bot_id__copy_from__source_bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_bot_id","in":"path","required":true,"schema":{"type":"string","title":"Source Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/templates/list":{"get":{"tags":["Flows"],"summary":"List Flow Templates","description":"List pre-built flow templates.","operationId":"list_flow_templates_api_v1_flows_templates_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/flows/":{"post":{"tags":["Flows"],"summary":"Create Flow","description":"Create a new conversation flow.","operationId":"create_flow_api_v1_flows__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{bot_id}":{"get":{"tags":["Flows"],"summary":"List Flows","description":"List conversation flows for a bot.","operationId":"list_flows_api_v1_flows__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/detail/{flow_id}":{"get":{"tags":["Flows"],"summary":"Get Flow","description":"Get flow details with full node/edge graph.","operationId":"get_flow_api_v1_flows_detail__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{flow_id}":{"put":{"tags":["Flows"],"summary":"Update Flow","description":"Update a flow graph and/or metadata.","operationId":"update_flow_api_v1_flows__flow_id__put","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Flows"],"summary":"Delete Flow","description":"Delete a flow.","operationId":"delete_flow_api_v1_flows__flow_id__delete","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{flow_id}/publish":{"post":{"tags":["Flows"],"summary":"Publish Flow","description":"Publish a flow as the active version for the bot.","operationId":"publish_flow_api_v1_flows__flow_id__publish_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{flow_id}/test":{"post":{"tags":["Flows"],"summary":"Test Flow","description":"Dry-run a flow with simulated input. Returns execution trace.","operationId":"test_flow_api_v1_flows__flow_id__test_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{flow_id}/versions":{"get":{"tags":["Flows"],"summary":"List Flow Versions","description":"Get version history of a flow.","operationId":"list_flow_versions_api_v1_flows__flow_id__versions_get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{flow_id}/clone":{"post":{"tags":["Flows"],"summary":"Clone Flow","description":"Clone a flow.","operationId":"clone_flow_api_v1_flows__flow_id__clone_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/flows/{bot_id}/from-template/{slug}":{"post":{"tags":["Flows"],"summary":"Create From Template","description":"Create a flow from a template.","operationId":"create_from_template_api_v1_flows__bot_id__from_template__slug__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/policies":{"post":{"tags":["SLA"],"summary":"Create Sla Policy","description":"Create an SLA policy.","operationId":"create_sla_policy_api_v1_sla_policies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SLAPolicyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/policies/{bot_id}":{"get":{"tags":["SLA"],"summary":"List Sla Policies","description":"List SLA policies for a bot.","operationId":"list_sla_policies_api_v1_sla_policies__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/policies/detail/{policy_id}":{"get":{"tags":["SLA"],"summary":"Get Sla Policy","description":"Get SLA policy details.","operationId":"get_sla_policy_api_v1_sla_policies_detail__policy_id__get","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/policies/{policy_id}":{"put":{"tags":["SLA"],"summary":"Update Sla Policy","description":"Update an SLA policy.","operationId":"update_sla_policy_api_v1_sla_policies__policy_id__put","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SLAPolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["SLA"],"summary":"Delete Sla Policy","description":"Delete an SLA policy.","operationId":"delete_sla_policy_api_v1_sla_policies__policy_id__delete","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/templates":{"get":{"tags":["SLA"],"summary":"List Sla Templates","description":"List pre-built SLA templates.","operationId":"list_sla_templates_api_v1_sla_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/sla/policies/{bot_id}/from-template/{slug}":{"post":{"tags":["SLA"],"summary":"Create Sla From Template","description":"Create an SLA policy from a template.","operationId":"create_sla_from_template_api_v1_sla_policies__bot_id__from_template__slug__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/deadlines/compute":{"post":{"tags":["SLA"],"summary":"Compute Deadline","description":"Compute SLA deadlines for a ticket/conversation.","operationId":"compute_deadline_api_v1_sla_deadlines_compute_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/compliance/{bot_id}":{"get":{"tags":["SLA"],"summary":"Sla Compliance","description":"Get SLA compliance dashboard data for a bot.","operationId":"sla_compliance_api_v1_sla_compliance__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sla/breaches/{bot_id}":{"get":{"tags":["SLA"],"summary":"List Breaches","description":"List SLA breach events for a bot.","operationId":"list_breaches_api_v1_sla_breaches__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"breach_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Breach Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/analyze":{"post":{"tags":["Intelligence"],"summary":"Analyze Conversation","description":"Analyze a conversation for topics, sentiment, intents.","operationId":"analyze_conversation_api_v1_intelligence_analyze_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/topics/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Topic Clusters","description":"Get topic clusters with trends for a bot.","operationId":"get_topic_clusters_api_v1_intelligence_topics__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/sentiment/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Sentiment Overview","description":"Get sentiment distribution for a bot.","operationId":"get_sentiment_overview_api_v1_intelligence_sentiment__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/intents/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Intent Distribution","description":"Get intent distribution for a bot.","operationId":"get_intent_distribution_api_v1_intelligence_intents__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/unanswered/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Unanswered Questions","description":"Get unanswered questions that could fill KB gaps.","operationId":"get_unanswered_questions_api_v1_intelligence_unanswered__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/auto-label":{"post":{"tags":["Intelligence"],"summary":"Auto Label Conversations","description":"Auto-label conversations with tags based on content analysis.","operationId":"auto_label_conversations_api_v1_intelligence_auto_label_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/intelligence/trends/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Conversation Trends","description":"Get conversation intelligence trends over time.","operationId":"get_conversation_trends_api_v1_intelligence_trends__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/routing/{bot_id}/rules":{"post":{"tags":["Routing"],"summary":"Create Routing Rule","description":"Create a routing rule for a bot.","operationId":"create_routing_rule_api_v1_routing__bot_id__rules_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__routing__RoutingRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Routing"],"summary":"List Routing Rules","description":"List routing rules for a bot, sorted by priority.","operationId":"list_routing_rules_api_v1_routing__bot_id__rules_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/routing/rules/{rule_id}":{"put":{"tags":["Routing"],"summary":"Update Routing Rule","description":"Update a routing rule.","operationId":"update_routing_rule_api_v1_routing_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Routing"],"summary":"Delete Routing Rule","description":"Delete a routing rule.","operationId":"delete_routing_rule_api_v1_routing_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/routing/agents/capacity":{"get":{"tags":["Routing"],"summary":"List Agent Capacities","description":"List all agent capacities.","operationId":"list_agent_capacities_api_v1_routing_agents_capacity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Routing"],"summary":"Set Agent Capacity","description":"Set or update agent capacity and skills.","operationId":"set_agent_capacity_api_v1_routing_agents_capacity_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCapacity"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/routing/agents/{agent_id}/capacity":{"get":{"tags":["Routing"],"summary":"Get Agent Capacity","description":"Get a specific agent's capacity.","operationId":"get_agent_capacity_api_v1_routing_agents__agent_id__capacity_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/routing/{bot_id}/simulate":{"post":{"tags":["Routing"],"summary":"Simulate Routing","description":"Simulate routing with given context. Returns which agent would be selected.","operationId":"simulate_routing_api_v1_routing__bot_id__simulate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/routing/strategies":{"get":{"tags":["Routing"],"summary":"List Strategies","description":"List available routing strategies.","operationId":"list_strategies_api_v1_routing_strategies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/audit/logs":{"post":{"tags":["Audit"],"summary":"Create Audit Log","description":"Record a new audit log entry.","operationId":"create_audit_log_api_v1_audit_logs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Audit"],"summary":"List Audit Logs","description":"List/search/filter audit log entries with pagination.","operationId":"list_audit_logs_api_v1_audit_logs_get","parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/logs/export":{"get":{"tags":["Audit"],"summary":"Export Audit Logs","description":"Export audit trail as CSV or JSON.","operationId":"export_audit_logs_api_v1_audit_logs_export_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/logs/{log_id}":{"get":{"tags":["Audit"],"summary":"Get Audit Log","description":"Get a single audit log entry by ID.","operationId":"get_audit_log_api_v1_audit_logs__log_id__get","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/stats":{"get":{"tags":["Audit"],"summary":"Audit Stats","description":"Get audit log summary statistics.","operationId":"audit_stats_api_v1_audit_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/testing/scenarios":{"post":{"tags":["Bot Testing"],"summary":"Create Scenario","description":"Create a test scenario with steps.","operationId":"create_scenario_api_v1_testing_scenarios_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/testing/scenarios/{bot_id}":{"get":{"tags":["Bot Testing"],"summary":"List Scenarios","description":"List all test scenarios for a bot.","operationId":"list_scenarios_api_v1_testing_scenarios__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/testing/scenarios/{bot_id}/{scenario_id}":{"get":{"tags":["Bot Testing"],"summary":"Get Scenario","description":"Get a single test scenario.","operationId":"get_scenario_api_v1_testing_scenarios__bot_id___scenario_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bot Testing"],"summary":"Update Scenario","description":"Update a test scenario.","operationId":"update_scenario_api_v1_testing_scenarios__bot_id___scenario_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bot Testing"],"summary":"Delete Scenario","description":"Delete a test scenario.","operationId":"delete_scenario_api_v1_testing_scenarios__bot_id___scenario_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/testing/run/{scenario_id}":{"post":{"tags":["Bot Testing"],"summary":"Run Scenario","description":"Execute a scenario against a bot (simulation mode).","operationId":"run_scenario_api_v1_testing_run__scenario_id__post","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/testing/runs/{bot_id}":{"get":{"tags":["Bot Testing"],"summary":"List Runs","description":"List past test runs for a bot with pagination.","operationId":"list_runs_api_v1_testing_runs__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/testing/runs/{bot_id}/{run_id}":{"get":{"tags":["Bot Testing"],"summary":"Get Run","description":"Get details of a specific test run.","operationId":"get_run_api_v1_testing_runs__bot_id___run_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kb/sources":{"post":{"tags":["Knowledge Base"],"summary":"Add Source","description":"Add a KB source (URL, file, or API feed).","operationId":"add_source_api_v1_kb_sources_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBSourceCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kb/sources/{bot_id}/stats":{"get":{"tags":["Knowledge Base"],"summary":"Source Stats","description":"Get KB source stats for a bot.","operationId":"source_stats_api_v1_kb_sources__bot_id__stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kb/sources/{bot_id}":{"get":{"tags":["Knowledge Base"],"summary":"List Sources","description":"List all KB sources for a bot with sync status and chunk counts.","operationId":"list_sources_api_v1_kb_sources__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(pending|syncing|synced|error)$"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kb/sources/{bot_id}/{source_id}":{"get":{"tags":["Knowledge Base"],"summary":"Get Source","description":"Get details of a specific KB source.","operationId":"get_source_api_v1_kb_sources__bot_id___source_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Knowledge Base"],"summary":"Update Source","description":"Update a KB source configuration.","operationId":"update_source_api_v1_kb_sources__bot_id___source_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBSourceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Knowledge Base"],"summary":"Delete Source","description":"Remove a KB source and its indexed chunks.","operationId":"delete_source_api_v1_kb_sources__bot_id___source_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/kb/sources/{source_id}/sync":{"post":{"tags":["Knowledge Base"],"summary":"Sync Source","description":"Trigger re-sync/re-crawl of a KB source.","operationId":"sync_source_api_v1_kb_sources__source_id__sync_post","parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/macros/templates":{"get":{"tags":["Macros"],"summary":"List Templates","description":"List pre-built macro templates.","operationId":"list_templates_api_v1_macros_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/macros/":{"post":{"tags":["Macros"],"summary":"Create Macro","description":"Create a macro with action steps.","operationId":"create_macro_api_v1_macros__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MacroCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/macros/{bot_id}":{"get":{"tags":["Macros"],"summary":"List Macros","description":"List macros for a bot.","operationId":"list_macros_api_v1_macros__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/macros/{bot_id}/{macro_id}":{"get":{"tags":["Macros"],"summary":"Get Macro","description":"Get details of a specific macro.","operationId":"get_macro_api_v1_macros__bot_id___macro_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Macros"],"summary":"Update Macro","description":"Update macro steps or name.","operationId":"update_macro_api_v1_macros__bot_id___macro_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MacroUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Macros"],"summary":"Delete Macro","description":"Delete a macro.","operationId":"delete_macro_api_v1_macros__bot_id___macro_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/macros/{macro_id}/execute":{"post":{"tags":["Macros"],"summary":"Execute Macro","description":"Execute a macro on a conversation (applies all steps in order).","operationId":"execute_macro_api_v1_macros__macro_id__execute_post","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MacroExecute"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-keys/":{"get":{"tags":["API Keys"],"summary":"List Api Keys","description":"List all API keys for the current user (secrets masked).","operationId":"list_api_keys_api_v1_api_keys__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["API Keys"],"summary":"Create Api Key","description":"Create a new API key. The raw key is returned ONCE — store it securely.","operationId":"create_api_key_api_v1_api_keys__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-keys/{key_id}":{"get":{"tags":["API Keys"],"summary":"Get Api Key","description":"Get API key details (secret never returned).","operationId":"get_api_key_api_v1_api_keys__key_id__get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["API Keys"],"summary":"Update Api Key","description":"Update API key name, scopes, IP restrictions, or expiry.","operationId":"update_api_key_api_v1_api_keys__key_id__put","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["API Keys"],"summary":"Delete Api Key","description":"Revoke/delete an API key permanently.","operationId":"delete_api_key_api_v1_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-keys/{key_id}/rotate":{"post":{"tags":["API Keys"],"summary":"Rotate Api Key","description":"Rotate key — invalidate old secret, issue new one.","operationId":"rotate_api_key_api_v1_api_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhook-logs/":{"post":{"tags":["Webhook Logs"],"summary":"Create Log","description":"Record a webhook delivery log entry.","operationId":"create_log_api_v1_webhook_logs__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookLogCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Webhook Logs"],"summary":"List Logs","description":"List delivery logs with filters.","operationId":"list_logs_api_v1_webhook_logs__get","parameters":[{"name":"webhook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(success|failed)$"},{"type":"null"}],"title":"Status"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhook-logs/stats":{"get":{"tags":["Webhook Logs"],"summary":"Delivery Stats","description":"Delivery stats: success rate, avg latency, top failures.","operationId":"delivery_stats_api_v1_webhook_logs_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/webhook-logs/{log_id}":{"get":{"tags":["Webhook Logs"],"summary":"Get Log","description":"Get full delivery detail.","operationId":"get_log_api_v1_webhook_logs__log_id__get","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhook-logs/{log_id}/retry":{"post":{"tags":["Webhook Logs"],"summary":"Retry Delivery","description":"Manually retry a failed delivery.","operationId":"retry_delivery_api_v1_webhook_logs__log_id__retry_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhook-logs/purge":{"delete":{"tags":["Webhook Logs"],"summary":"Purge Logs","description":"Purge logs older than N days (admin only).","operationId":"purge_logs_api_v1_webhook_logs_purge_delete","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/segments/":{"post":{"tags":["Segments"],"summary":"Create Segment","description":"Create a segment (dynamic with rules, or static with contact IDs).","operationId":"create_segment_api_v1_segments__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__segments__SegmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Segments"],"summary":"List Segments","description":"List segments with member counts.","operationId":"list_segments_api_v1_segments__get","parameters":[{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/segments/{segment_id}":{"get":{"tags":["Segments"],"summary":"Get Segment","description":"Get segment detail + computed member count.","operationId":"get_segment_api_v1_segments__segment_id__get","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Segments"],"summary":"Update Segment","description":"Update segment rules or name.","operationId":"update_segment_api_v1_segments__segment_id__put","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Segments"],"summary":"Delete Segment","description":"Delete a segment.","operationId":"delete_segment_api_v1_segments__segment_id__delete","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/segments/{segment_id}/members":{"get":{"tags":["Segments"],"summary":"Get Segment Members","description":"Paginated list of contacts matching segment rules.","operationId":"get_segment_members_api_v1_segments__segment_id__members_get","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversation-ops/merge":{"post":{"tags":["Conversation Ops"],"summary":"Merge Conversations","description":"Merge 2+ conversations into one (pick primary, append others).","operationId":"merge_conversations_api_v1_conversation_ops_merge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversation-ops/split":{"post":{"tags":["Conversation Ops"],"summary":"Split Conversation","description":"Split a conversation at a specific message into two threads.","operationId":"split_conversation_api_v1_conversation_ops_split_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversation-ops/history":{"get":{"tags":["Conversation Ops"],"summary":"List Operations","description":"List all merge/split operations with audit trail.","operationId":"list_operations_api_v1_conversation_ops_history_get","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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversation-ops/history/{operation_id}":{"get":{"tags":["Conversation Ops"],"summary":"Get Operation","description":"Get detail of a specific merge/split operation.","operationId":"get_operation_api_v1_conversation_ops_history__operation_id__get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/conversation-ops/undo/{operation_id}":{"post":{"tags":["Conversation Ops"],"summary":"Undo Operation","description":"Undo a merge/split operation (within time window).","operationId":"undo_operation_api_v1_conversation_ops_undo__operation_id__post","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/proactive/rules":{"post":{"tags":["Proactive Messaging"],"summary":"Create Rule","description":"Create a proactive messaging rule.","operationId":"create_rule_api_v1_proactive_rules_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Proactive Messaging"],"summary":"List Rules","description":"List proactive rules for a bot.","operationId":"list_rules_api_v1_proactive_rules_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/proactive/rules/{rule_id}":{"get":{"tags":["Proactive Messaging"],"summary":"Get Rule","description":"Get rule detail with delivery stats.","operationId":"get_rule_api_v1_proactive_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Proactive Messaging"],"summary":"Update Rule","description":"Update rule conditions, message, or status.","operationId":"update_rule_api_v1_proactive_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Proactive Messaging"],"summary":"Delete Rule","description":"Delete a proactive rule.","operationId":"delete_rule_api_v1_proactive_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/proactive/rules/{rule_id}/test":{"post":{"tags":["Proactive Messaging"],"summary":"Test Fire Rule","description":"Test-fire a rule against a fake visitor session to preview behavior.","operationId":"test_fire_rule_api_v1_proactive_rules__rule_id__test_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/security-rules/validate":{"post":{"tags":["Security Rules"],"summary":"Validate Ip","description":"Test an IP/country against current ruleset (dry-run check).","operationId":"validate_ip_api_v1_security_rules_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPValidateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/security-rules/":{"post":{"tags":["Security Rules"],"summary":"Create Security Rule","description":"Create a security rule.","operationId":"create_security_rule_api_v1_security_rules__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Security Rules"],"summary":"List Security Rules","description":"List security rules, optionally filtered by type.","operationId":"list_security_rules_api_v1_security_rules__get","parameters":[{"name":"rule_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/security-rules/{rule_id}":{"get":{"tags":["Security Rules"],"summary":"Get Security Rule","description":"Get a security rule by ID.","operationId":"get_security_rule_api_v1_security_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Security Rules"],"summary":"Update Security Rule","description":"Update a security rule.","operationId":"update_security_rule_api_v1_security_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Security Rules"],"summary":"Delete Security Rule","description":"Delete a security rule.","operationId":"delete_security_rule_api_v1_security_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/usage/summary":{"get":{"tags":["Usage & Quotas"],"summary":"Usage Summary","description":"Current-period usage summary.","operationId":"usage_summary_api_v1_usage_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/usage/history":{"get":{"tags":["Usage & Quotas"],"summary":"Usage History","description":"Historical usage over past N periods.","operationId":"usage_history_api_v1_usage_history_get","parameters":[{"name":"periods","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"default":6,"title":"Periods"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/usage/quotas":{"get":{"tags":["Usage & Quotas"],"summary":"Get Quotas","description":"Get current plan quotas/limits.","operationId":"get_quotas_api_v1_usage_quotas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/usage/quotas/overrides":{"put":{"tags":["Usage & Quotas"],"summary":"Override Quotas","description":"Admin-only: override quotas for a user (custom enterprise limits).","operationId":"override_quotas_api_v1_usage_quotas_overrides_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaOverride"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/usage/record":{"post":{"tags":["Usage & Quotas"],"summary":"Record Usage Event","description":"Record a usage event.","operationId":"record_usage_event_api_v1_usage_record_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEvent"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/usage/alerts":{"get":{"tags":["Usage & Quotas"],"summary":"Usage Alerts","description":"List overage/threshold alerts for current user.","operationId":"usage_alerts_api_v1_usage_alerts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/usage/nudges":{"get":{"tags":["Usage & Quotas"],"summary":"Get Nudges","description":"Get contextual upsell nudges based on current usage and plan.","operationId":"get_nudges_api_v1_usage_nudges_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/usage/nudges/{nudge_id}/dismiss":{"post":{"tags":["Usage & Quotas"],"summary":"Dismiss Nudge","description":"Dismiss a nudge so it doesn't show again.","operationId":"dismiss_nudge_api_v1_usage_nudges__nudge_id__dismiss_post","parameters":[{"name":"nudge_id","in":"path","required":true,"schema":{"type":"string","title":"Nudge Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot-personas/":{"get":{"tags":["Bot Personas"],"summary":"List Personas","description":"List all persona profiles for current user.","operationId":"list_personas_api_v1_bot_personas__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Bot Personas"],"summary":"Create Persona","description":"Create a persona profile.","operationId":"create_persona_api_v1_bot_personas__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot-personas/{persona_id}":{"get":{"tags":["Bot Personas"],"summary":"Get Persona","description":"Get persona details.","operationId":"get_persona_api_v1_bot_personas__persona_id__get","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bot Personas"],"summary":"Update Persona","description":"Update persona settings.","operationId":"update_persona_api_v1_bot_personas__persona_id__put","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bot Personas"],"summary":"Delete Persona","description":"Delete a persona.","operationId":"delete_persona_api_v1_bot_personas__persona_id__delete","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/bot-personas/{persona_id}/attach/{bot_id}":{"post":{"tags":["Bot Personas"],"summary":"Attach Persona To Bot","description":"Attach persona to a bot.","operationId":"attach_persona_to_bot_api_v1_bot_personas__persona_id__attach__bot_id__post","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}},{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events/types":{"get":{"tags":["Events"],"summary":"List Event Types","description":"List valid event types.","operationId":"list_event_types_api_v1_events_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/events/batch":{"post":{"tags":["Events"],"summary":"Batch Track","description":"Track multiple events at once.","operationId":"batch_track_api_v1_events_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchEventCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events/":{"post":{"tags":["Events"],"summary":"Track Event","description":"Track a single event.","operationId":"track_event_api_v1_events__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Events"],"summary":"List Events","description":"List tracked events with optional filters.","operationId":"list_events_api_v1_events__get","parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events/{event_id}":{"get":{"tags":["Events"],"summary":"Get Event","description":"Get single event detail.","operationId":"get_event_api_v1_events__event_id__get","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Events"],"summary":"Delete Event","description":"Delete an event.","operationId":"delete_event_api_v1_events__event_id__delete","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/requests":{"post":{"tags":["Compliance"],"summary":"Create Dsr","description":"Create a Data Subject Request.","operationId":"create_dsr_api_v1_compliance_requests_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DSRCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Compliance"],"summary":"List Dsrs","description":"List Data Subject Requests.","operationId":"list_dsrs_api_v1_compliance_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"request_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/requests/{dsr_id}":{"get":{"tags":["Compliance"],"summary":"Get Dsr","description":"Get DSR detail.","operationId":"get_dsr_api_v1_compliance_requests__dsr_id__get","parameters":[{"name":"dsr_id","in":"path","required":true,"schema":{"type":"string","title":"Dsr Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Compliance"],"summary":"Update Dsr Status","description":"Update DSR status.","operationId":"update_dsr_status_api_v1_compliance_requests__dsr_id__patch","parameters":[{"name":"dsr_id","in":"path","required":true,"schema":{"type":"string","title":"Dsr Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DSRStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/requests/{dsr_id}/export":{"get":{"tags":["Compliance"],"summary":"Export Dsr Data","description":"Export data for a DSR (access/portability).","operationId":"export_dsr_data_api_v1_compliance_requests__dsr_id__export_get","parameters":[{"name":"dsr_id","in":"path","required":true,"schema":{"type":"string","title":"Dsr Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/consent/{contact_id}":{"post":{"tags":["Compliance"],"summary":"Update Consent","description":"Track or update consent for a contact.","operationId":"update_consent_api_v1_compliance_consent__contact_id__post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Compliance"],"summary":"Get Consent","description":"Get all consent records for a contact.","operationId":"get_consent_api_v1_compliance_consent__contact_id__get","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/exports/":{"post":{"tags":["Exports"],"summary":"Create Export","description":"Generate and download a data export.\nReturns the file directly as a streaming response.","operationId":"create_export_api_v1_exports__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/exports/history":{"get":{"tags":["Exports"],"summary":"List Exports","description":"List past exports for the current user.","operationId":"list_exports_api_v1_exports_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/exports/formats":{"get":{"tags":["Exports"],"summary":"List Export Formats","description":"List available export resources and formats.","operationId":"list_export_formats_api_v1_exports_formats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/api/blog/posts":{"get":{"tags":["blog"],"summary":"List Blog Posts","description":"List blog posts. No auth required for public read.","operationId":"list_blog_posts_api_v1_api_blog_posts_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["blog"],"summary":"Create Blog Post","description":"Create a blog post (requires auth).","operationId":"create_blog_post_api_v1_api_blog_posts_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPostCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api/blog/posts/{slug}":{"get":{"tags":["blog"],"summary":"Get Blog Post","description":"Get a single blog post by slug.","operationId":"get_blog_post_api_v1_api_blog_posts__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health":{"get":{"tags":["Health"],"summary":"Health","description":"Lightweight health check. Returns 200 if the service is up.\nNo auth required — used by monitoring, load balancers, Vercel health.","operationId":"health_api_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/health/ready":{"get":{"tags":["Health"],"summary":"Readiness","description":"Readiness probe. Checks if the service can handle requests.\nReturns 503 if critical dependencies are down.","operationId":"readiness_api_v1_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/health/diagnostics":{"get":{"tags":["Health"],"summary":"Diagnostics","description":"Detailed system diagnostics. Admin only.\nShows runtime info, dependency status, store stats, and config.","operationId":"diagnostics_api_v1_health_diagnostics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/nps/surveys":{"post":{"tags":["NPS Surveys"],"summary":"Create Survey","description":"Create an NPS survey.","operationId":"create_survey_api_v1_nps_surveys_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["NPS Surveys"],"summary":"List Surveys","description":"List NPS surveys.","operationId":"list_surveys_api_v1_nps_surveys_get","parameters":[{"name":"active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nps/surveys/{survey_id}":{"get":{"tags":["NPS Surveys"],"summary":"Get Survey","description":"Get a single NPS survey.","operationId":"get_survey_api_v1_nps_surveys__survey_id__get","parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["NPS Surveys"],"summary":"Update Survey","description":"Update an NPS survey.","operationId":"update_survey_api_v1_nps_surveys__survey_id__patch","parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nps/responses":{"post":{"tags":["NPS Surveys"],"summary":"Submit Response","description":"Submit an NPS response.","operationId":"submit_response_api_v1_nps_responses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nps/surveys/{survey_id}/results":{"get":{"tags":["NPS Surveys"],"summary":"Survey Results","description":"Computed NPS score and breakdown for a survey.","operationId":"survey_results_api_v1_nps_surveys__survey_id__results_get","parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent-status/me":{"get":{"tags":["Agent Status"],"summary":"Get My Status","description":"Get my current status and stats.","operationId":"get_my_status_api_v1_agent_status_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["Agent Status"],"summary":"Set My Status","description":"Set my current status.","operationId":"set_my_status_api_v1_agent_status_me_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent-status/team":{"get":{"tags":["Agent Status"],"summary":"Get Team Statuses","description":"Get all agents' statuses.","operationId":"get_team_statuses_api_v1_agent_status_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/agent-status/schedule":{"get":{"tags":["Agent Status"],"summary":"List Scheduled Statuses","description":"List my scheduled status changes.","operationId":"list_scheduled_statuses_api_v1_agent_status_schedule_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Agent Status"],"summary":"Create Scheduled Status","description":"Create a scheduled status change.","operationId":"create_scheduled_status_api_v1_agent_status_schedule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledStatusCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent-status/schedule/{schedule_id}":{"delete":{"tags":["Agent Status"],"summary":"Delete Scheduled Status","description":"Cancel a scheduled status change.","operationId":"delete_scheduled_status_api_v1_agent_status_schedule__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/":{"post":{"tags":["Reports"],"summary":"Create Report","description":"Create a custom report.","operationId":"create_report_api_v1_reports__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{bot_id}":{"get":{"tags":["Reports"],"summary":"List Reports","description":"List saved reports for a bot.","operationId":"list_reports_api_v1_reports__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/detail/{report_id}":{"get":{"tags":["Reports"],"summary":"Get Report","description":"Get report config.","operationId":"get_report_api_v1_reports_detail__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{report_id}":{"put":{"tags":["Reports"],"summary":"Update Report","description":"Update a report configuration.","operationId":"update_report_api_v1_reports__report_id__put","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Reports"],"summary":"Delete Report","description":"Delete a report.","operationId":"delete_report_api_v1_reports__report_id__delete","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{report_id}/run":{"post":{"tags":["Reports"],"summary":"Run Report","description":"Execute a report and return results with data points.","operationId":"run_report_api_v1_reports__report_id__run_post","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/templates/list":{"get":{"tags":["Reports"],"summary":"List Report Templates","description":"List pre-built report templates.","operationId":"list_report_templates_api_v1_reports_templates_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/reports/{bot_id}/from-template/{slug}":{"post":{"tags":["Reports"],"summary":"Create Report From Template","description":"Create a report from a template.","operationId":"create_report_from_template_api_v1_reports__bot_id__from_template__slug__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/metrics/available":{"get":{"tags":["Reports"],"summary":"Get Available Metrics","description":"List all available metrics and dimensions for report building.","operationId":"get_available_metrics_api_v1_reports_metrics_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/developer/api-keys":{"get":{"tags":["Developer"],"summary":"Dev List Api Keys","description":"List all developer API keys for the user.","operationId":"dev_list_api_keys_api_v1_developer_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Developer"],"summary":"Dev Create Api Key","description":"Create a scoped API key (developer portal).","operationId":"dev_create_api_key_api_v1_developer_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevAPIKeyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/api-keys/{key_id}":{"put":{"tags":["Developer"],"summary":"Dev Update Api Key","description":"Update a developer API key (name, scopes, status).","operationId":"dev_update_api_key_api_v1_developer_api_keys__key_id__put","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevAPIKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Developer"],"summary":"Dev Revoke Api Key","description":"Revoke (delete) a developer API key permanently.","operationId":"dev_revoke_api_key_api_v1_developer_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/api-keys/{key_id}/usage":{"get":{"tags":["Developer"],"summary":"Get Api Key Usage","description":"Get usage statistics for an API key.","operationId":"get_api_key_usage_api_v1_developer_api_keys__key_id__usage_get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/webhook-events":{"get":{"tags":["Developer"],"summary":"List Webhook Events","description":"List all available webhook event types with payload examples.","operationId":"list_webhook_events_api_v1_developer_webhook_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/developer/sandbox/start":{"post":{"tags":["Developer"],"summary":"Start Sandbox Session","description":"Start a sandbox API session for testing.","operationId":"start_sandbox_session_api_v1_developer_sandbox_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/developer/sandbox/{session_id}/request":{"post":{"tags":["Developer"],"summary":"Sandbox Request","description":"Execute a sandboxed API request (simulated).","operationId":"sandbox_request_api_v1_developer_sandbox__session_id__request_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/sandbox/{session_id}":{"delete":{"tags":["Developer"],"summary":"End Sandbox Session","description":"End and clean up a sandbox session.","operationId":"end_sandbox_session_api_v1_developer_sandbox__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/sdks":{"get":{"tags":["Developer"],"summary":"List Sdks","description":"List available SDKs and code examples.","operationId":"list_sdks_api_v1_developer_sdks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/developer/scopes":{"get":{"tags":["Developer"],"summary":"List Api Scopes","description":"List all available API scopes for key creation.","operationId":"list_api_scopes_api_v1_developer_scopes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/developer/docs":{"get":{"tags":["Developer"],"summary":"Get Api Docs Summary","description":"Get a summary of the public API surface.","operationId":"get_api_docs_summary_api_v1_developer_docs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/queues/":{"post":{"tags":["Queues"],"summary":"Create Queue","description":"Create a named conversation queue.","operationId":"create_queue_api_v1_queues__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/queues/{bot_id}":{"get":{"tags":["Queues"],"summary":"List Queues","description":"List queues for a bot with real-time depth.","operationId":"list_queues_api_v1_queues__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/queues/{queue_id}/metrics":{"get":{"tags":["Queues"],"summary":"Queue Metrics","description":"Queue real-time metrics: depth, avg wait, throughput.","operationId":"queue_metrics_api_v1_queues__queue_id__metrics_get","parameters":[{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/queues/{bot_id}/{queue_id}":{"get":{"tags":["Queues"],"summary":"Get Queue","description":"Get queue details.","operationId":"get_queue_api_v1_queues__bot_id___queue_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Queues"],"summary":"Update Queue","description":"Update queue configuration.","operationId":"update_queue_api_v1_queues__bot_id___queue_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Queues"],"summary":"Delete Queue","description":"Delete a queue (only if empty).","operationId":"delete_queue_api_v1_queues__bot_id___queue_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/queues/{queue_id}/enqueue":{"post":{"tags":["Queues"],"summary":"Enqueue Conversation","description":"Add a conversation to a queue.","operationId":"enqueue_conversation_api_v1_queues__queue_id__enqueue_post","parameters":[{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueItem"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/queues/{queue_id}/pick":{"post":{"tags":["Queues"],"summary":"Pick From Queue","description":"Agent picks next conversation from queue (highest priority, oldest first).","operationId":"pick_from_queue_api_v1_queues__queue_id__pick_post","parameters":[{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/":{"post":{"tags":["Chat"],"summary":"Send Message","description":"Envoie un message à un bot et reçoit la réponse.\nPublic bots (status=active) allow unauthenticated access (widget embed).\nPrivate bots require auth.\nMessage quota is enforced per bot owner's plan.","operationId":"send_message_api_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"}}}}}}},"/api/chat/stream":{"post":{"tags":["Chat"],"summary":"Stream Message","description":"Streaming SSE version of chat — tokens arrive in real-time.","operationId":"stream_message_api_chat_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/with-document":{"post":{"tags":["Chat"],"summary":"Chat With Document","description":"Send a document (PDF/Word/Excel/TXT) to the bot for analysis.\nThe bot reads, extracts text, and responds contextually.\nMax 10MB per file. Supported: PDF, DOCX, DOC, XLSX, XLS, TXT, MD, CSV.","operationId":"chat_with_document_api_chat_with_document_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_chat_with_document_api_chat_with_document_post"}}},"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"}}}}}}},"/api/chat/upload-file":{"post":{"tags":["Chat"],"summary":"Upload File In Chat","description":"Upload a file (image/doc) in chat. Stores in Supabase Storage and returns URL.\nImages are displayed inline. Documents are sent for AI analysis.\nSupported: JPEG, PNG, GIF, WebP, PDF, DOCX, XLSX, TXT, MD, CSV.","operationId":"upload_file_in_chat_api_chat_upload_file_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_in_chat_api_chat_upload_file_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/sessions/{session_id}":{"get":{"tags":["Chat"],"summary":"Get Session","description":"Récupère l'historique d'une session (auth required, DB fallback for serverless)","operationId":"get_session_api_chat_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Chat"],"summary":"Delete Session","description":"Supprime une session (auth required, clears DB + memory)","operationId":"delete_session_api_chat_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/conversations/{bot_id}":{"get":{"tags":["Chat"],"summary":"List Conversations","description":"List all conversation sessions for a bot with message counts.\nOwner only. Returns sessions sorted by last activity.","operationId":"list_conversations_api_chat_conversations__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/feedback":{"post":{"tags":["Chat"],"summary":"Submit Message Feedback","description":"Submit thumbs up/down feedback on an AI message. Public (widget-accessible).","operationId":"submit_message_feedback_api_chat_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageFeedback"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/feedback/{bot_id}/summary":{"get":{"tags":["Chat"],"summary":"Get Feedback Summary","description":"Get aggregated feedback for a bot (owner only).","operationId":"get_feedback_summary_api_chat_feedback__bot_id__summary_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/export/{bot_id}":{"get":{"tags":["Chat"],"summary":"Export Conversations","description":"Export all conversations for a bot as CSV or JSON.\nOwner only. For compliance and reporting.","operationId":"export_conversations_api_chat_export__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"csv","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/search/{bot_id}":{"get":{"tags":["Chat"],"summary":"Search Conversations","description":"Search across chat messages by keyword for a bot.\nOwner only. Uses Supabase full-text / ilike search.","operationId":"search_conversations_api_chat_search__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/export-pdf":{"post":{"tags":["i18n & Export"],"summary":"Export Chat Pdf","description":"Export a chat conversation as PDF.","operationId":"export_chat_pdf_api_chat_export_pdf_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/chat/lead":{"post":{"tags":["Chat"],"summary":"Save Lead","description":"Store lead capture data from the widget pre-chat form.\nNo auth required (public widget). Links lead to session.\nPer-bot rate limited to prevent abuse.","operationId":"save_lead_api_chat_lead_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/leads/{bot_id}":{"get":{"tags":["Chat"],"summary":"List Leads","description":"List all captured leads for a bot. Owner only.","operationId":"list_leads_api_chat_leads__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/leads/{lead_id}":{"delete":{"tags":["Chat"],"summary":"Delete Lead","description":"Delete a single lead. Owner verification via bot.","operationId":"delete_lead_api_chat_leads__lead_id__delete","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/feedback/correction":{"post":{"tags":["Chat"],"summary":"Submit Correction","description":"Submit a corrected response for an AI message (for training/improvement).","operationId":"submit_correction_api_chat_feedback_correction_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackCorrection"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/feedback/{bot_id}/stats":{"get":{"tags":["Chat"],"summary":"Feedback Stats","description":"Get feedback statistics for a bot.","operationId":"feedback_stats_api_chat_feedback__bot_id__stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/feedback/{bot_id}/messages":{"get":{"tags":["Chat"],"summary":"Feedback Messages","description":"List messages with feedback for quality review.","operationId":"feedback_messages_api_chat_feedback__bot_id__messages_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"rating","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(thumbs_up|thumbs_down)$"},{"type":"null"}],"title":"Rating"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/leads/{bot_id}/export":{"get":{"tags":["Chat"],"summary":"Export Leads","description":"Export all leads for a bot as CSV or JSON. Owner only.","operationId":"export_leads_api_chat_leads__bot_id__export_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"csv","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/models/available":{"get":{"tags":["Bots"],"summary":"List Available Models","description":"Liste les modèles AI disponibles pour les bots.","operationId":"list_available_models_api_bots_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/models/byok-providers":{"get":{"tags":["Bots"],"summary":"List Byok Providers","description":"Liste les providers API supportés pour BYOK (Bring Your Own Key).","operationId":"list_byok_providers_api_bots_models_byok_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/models/validate-key":{"post":{"tags":["Bots"],"summary":"Validate Api Key","description":"Valide une clé API client (BYOK) en testant un appel léger.\nNécessite plan Pro+.","operationId":"validate_api_key_api_bots_models_validate_key_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/stats/overview":{"get":{"tags":["Bots"],"summary":"Stats Overview","description":"Dashboard stats for current user's bots (admin sees all). Auth required.","operationId":"stats_overview_api_bots_stats_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/stats/public":{"get":{"tags":["Bots"],"summary":"Stats Public","description":"Public stats for landing page (no auth required). Cached 5 min.","operationId":"stats_public_api_bots_stats_public_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/domains":{"get":{"tags":["Bots"],"summary":"List Domains","description":"Liste les domaines disponibles avec templates","operationId":"list_domains_api_bots_domains_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/templates":{"get":{"tags":["Bots"],"summary":"List Bot Templates","description":"List available bot templates (pre-built configurations). No auth required.","operationId":"list_bot_templates_api_bots_templates_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/templates/{template_id}":{"get":{"tags":["Bots"],"summary":"Get Bot Template","description":"Get a specific bot template with full config details.","operationId":"get_bot_template_api_bots_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/from-template":{"post":{"tags":["Bots"],"summary":"Create Bot From Template","description":"Create a new bot from a pre-built template. Quota-enforced.","operationId":"create_bot_from_template_api_bots_from_template_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__bots__TemplateCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/":{"get":{"tags":["Bots"],"summary":"List Bots","description":"Liste les bots. Si auth header → user's bots only (admins see all). Sinon → active only (demo).\nSupports pagination via limit/offset. Max limit: 100.","operationId":"list_bots_api_bots__get","parameters":[{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Bots"],"summary":"Create Bot","description":"Crée un nouveau bot (quota-enforced, linked to user)","operationId":"create_bot_api_bots__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Bot Api Bots  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}":{"get":{"tags":["Bots"],"summary":"Get Bot","description":"Détails d'un bot. Public info for active bots (chat widget), full info for owner.","operationId":"get_bot_api_bots__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bots"],"summary":"Update Bot","description":"Met à jour un bot (ownership check, auth required)","operationId":"update_bot_api_bots__bot_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Delete Bot","description":"Supprime un bot et sa KB (auth required, ownership check — admins can delete any bot)","operationId":"delete_bot_api_bots__bot_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/avatar":{"post":{"tags":["Bots"],"summary":"Upload Bot Avatar","description":"Upload un avatar/logo pour le bot. Stocke dans Supabase Storage.\nMax 2MB, formats: PNG, JPG, WEBP, GIF, SVG.","operationId":"upload_bot_avatar_api_bots__bot_id__avatar_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_bot_avatar_api_bots__bot_id__avatar_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Delete Bot Avatar","description":"Supprime l'avatar du bot.","operationId":"delete_bot_avatar_api_bots__bot_id__avatar_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/activate":{"post":{"tags":["Bots"],"summary":"Activate Bot","description":"Active un bot (auth required, ownership check)","operationId":"activate_bot_api_bots__bot_id__activate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/deactivate":{"post":{"tags":["Bots"],"summary":"Deactivate Bot","description":"Désactive un bot (auth required, ownership check)","operationId":"deactivate_bot_api_bots__bot_id__deactivate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/clone":{"post":{"tags":["Bots"],"summary":"Clone Bot","description":"Clone an existing bot with a new ID. Copies config but not KB.\nOwner only, quota-enforced.","operationId":"clone_bot_api_bots__bot_id__clone_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/knowledge":{"post":{"tags":["Bots"],"summary":"Upload Knowledge","description":"Upload un document dans la KB du bot (quota-enforced, size-validated)","operationId":"upload_knowledge_api_bots__bot_id__knowledge_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_knowledge_api_bots__bot_id__knowledge_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Bots"],"summary":"Get Knowledge Stats","description":"Stats de la knowledge base d'un bot — from Supabase (auth required)","operationId":"get_knowledge_stats_api_bots__bot_id__knowledge_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Clear Knowledge","description":"Supprime toute la knowledge base d'un bot (auth required)","operationId":"clear_knowledge_api_bots__bot_id__knowledge_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/knowledge/search":{"post":{"tags":["Bots"],"summary":"Search Knowledge","description":"Recherche dans la knowledge base (auth required)","operationId":"search_knowledge_api_bots__bot_id__knowledge_search_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":500,"title":"Query"}},{"name":"top_k","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":5,"title":"Top K"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/kb/train-url":{"post":{"tags":["Bots"],"summary":"Train From Url","description":"Scrape a web page and add its content to the bot's knowledge base.\n\nBody: {\"url\": \"https://example.com\", \"depth\": 1}\ndepth=0: only the given URL, depth=1: follow links on the same domain (max 10 pages).","operationId":"train_from_url_api_bots__bot_id__kb_train_url_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/tools/available":{"get":{"tags":["Bots"],"summary":"List Available Tools","description":"Liste tous les outils/calculateurs disponibles.","operationId":"list_available_tools_api_bots_tools_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/tools/execute":{"post":{"tags":["Bots"],"summary":"Execute Tool","description":"Exécute un outil de calcul directement (pour tests).","operationId":"execute_tool_api_bots_tools_execute_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/ab-tests":{"post":{"tags":["Bots"],"summary":"Create Ab Test","description":"Create an A/B test for a bot. Split traffic across config variants.","operationId":"create_ab_test_api_bots__bot_id__ab_tests_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ABTestCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Bots"],"summary":"List Ab Tests","description":"List all A/B tests for a bot.","operationId":"list_ab_tests_api_bots__bot_id__ab_tests_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/ab-tests/{test_id}":{"get":{"tags":["Bots"],"summary":"Get Ab Test","description":"Get A/B test details with per-variant stats.","operationId":"get_ab_test_api_bots__bot_id__ab_tests__test_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bots"],"summary":"Update Ab Test","description":"Update A/B test (name, status, traffic).","operationId":"update_ab_test_api_bots__bot_id__ab_tests__test_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ABTestUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bots"],"summary":"Delete Ab Test","description":"Delete an A/B test.","operationId":"delete_ab_test_api_bots__bot_id__ab_tests__test_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/ab-tests/{test_id}/stop":{"post":{"tags":["Bots"],"summary":"Stop Ab Test","description":"Stop an A/B test and optionally declare a winner.","operationId":"stop_ab_test_api_bots__bot_id__ab_tests__test_id__stop_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}},{"name":"winner_variant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Winner Variant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/ab-tests/{test_id}/record":{"post":{"tags":["Bots"],"summary":"Record Ab Impression","description":"Record an impression or conversion for an A/B test variant (called from chat).","operationId":"record_ab_impression_api_bots__bot_id__ab_tests__test_id__record_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/{bot_id}/export":{"get":{"tags":["Bots"],"summary":"Export Bot","description":"Export full bot configuration as JSON (profile, skills, automations, canned responses, KB metadata).","operationId":"export_bot_api_bots__bot_id__export_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/import":{"post":{"tags":["Bots"],"summary":"Import Bot","description":"Import a bot from exported JSON. Creates a new bot with the config.","operationId":"import_bot_api_bots_import_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotImportPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bots/languages/available":{"get":{"tags":["Bots"],"summary":"List Available Languages","description":"List all supported languages for bot configuration.","operationId":"list_available_languages_api_bots_languages_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/bots/{bot_id}/languages":{"get":{"tags":["Bots"],"summary":"Get Bot Languages","description":"Get language configuration for a bot.","operationId":"get_bot_languages_api_bots__bot_id__languages_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bots"],"summary":"Update Bot Languages","description":"Update language configuration for a bot.","operationId":"update_bot_languages_api_bots__bot_id__languages_put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguageConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/generate":{"post":{"tags":["Documents"],"summary":"Generate Document","description":"Génère un document (PDF, Word, Excel) — auth required.","operationId":"generate_document_api_documents_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/documents/download/{filename}":{"get":{"tags":["Documents"],"summary":"Download Document","description":"Télécharge un document généré (local ou Supabase Storage). Public — links shared via WhatsApp.","operationId":"download_document_api_documents_download__filename__get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/register":{"post":{"tags":["Auth"],"summary":"Register","description":"Create a new account.","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"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"}}}}}}},"/api/auth/login":{"post":{"tags":["Auth"],"summary":"Login","description":"Login with email/password.","operationId":"login_api_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"}}}}}}},"/api/auth/refresh":{"post":{"tags":["Auth"],"summary":"Refresh Token Endpoint","description":"Exchange a valid refresh token for a new access token + refresh token.","operationId":"refresh_token_endpoint_api_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"}}}}}}},"/api/auth/me":{"get":{"tags":["Auth"],"summary":"Me","description":"Get current user profile.","operationId":"me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/logout":{"post":{"tags":["Auth"],"summary":"Logout","description":"Logout (clear cookie + revoke all refresh tokens).\nAccepts optional refresh_token in body to identify user if access token is expired.","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/api-keys":{"get":{"tags":["Auth"],"summary":"List Keys","description":"List API keys (without the actual key values).","operationId":"list_keys_api_auth_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Auth"],"summary":"Create Key","description":"Generate a new API key. The raw key is shown only once. Requires Pro+ plan.","operationId":"create_key_api_auth_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/api-keys/{key_id}":{"delete":{"tags":["Auth"],"summary":"Delete Key","description":"Revoke an API key. Only the owner can delete.","operationId":"delete_key_api_auth_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/api-keys/{key_id}/rotate":{"post":{"tags":["Auth"],"summary":"Rotate Key","description":"Rotate an API key: deactivate old one and generate a new one atomically.","operationId":"rotate_key_api_auth_api_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/oauth-config":{"get":{"tags":["Auth"],"summary":"Oauth Config","description":"Return public OAuth config (client IDs only, no secrets).","operationId":"oauth_config_api_auth_oauth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/google":{"post":{"tags":["Auth"],"summary":"Google Auth","description":"Login/Register with Google.\nExpects: { \"credential\": \"<Google ID token>\" }\nVerifies the ID token with Google's API.","operationId":"google_auth_api_auth_google_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/google/authorize":{"get":{"tags":["Auth"],"summary":"Google Authorize","description":"Redirect user to Google OAuth consent page with signed CSRF state.","operationId":"google_authorize_api_auth_google_authorize_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/google/redirect":{"get":{"tags":["Auth"],"summary":"Google Redirect","description":"Google OAuth redirect flow.","operationId":"google_redirect_api_auth_google_redirect_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/github":{"get":{"tags":["Auth"],"summary":"Github Redirect","description":"Redirect user to GitHub OAuth page with signed CSRF state.","operationId":"github_redirect_api_auth_github_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/github/callback":{"get":{"tags":["Auth"],"summary":"Github Callback","description":"GitHub OAuth callback — exchange code for token, then login/register.","operationId":"github_callback_api_auth_github_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error Description"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/update-profile":{"put":{"tags":["Auth"],"summary":"Update Profile","description":"Update user display name.","operationId":"update_profile_api_auth_update_profile_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/change-password":{"put":{"tags":["Auth"],"summary":"Change Password","description":"Change user password.","operationId":"change_password_api_auth_change_password_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/delete-account":{"delete":{"tags":["Auth"],"summary":"Delete Account","description":"Delete user account and all associated data.","operationId":"delete_account_api_auth_delete_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/verify-email":{"post":{"tags":["Auth"],"summary":"Verify Email","description":"Verify email with 6-digit code.","operationId":"verify_email_api_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/resend-verification":{"post":{"tags":["Auth"],"summary":"Resend Verification","description":"Resend email verification code.","operationId":"resend_verification_api_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/forgot-password":{"post":{"tags":["Auth"],"summary":"Forgot Password","description":"Send a password reset code by email.","operationId":"forgot_password_api_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Reset Password","description":"Reset password with verification code.","operationId":"reset_password_api_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/2fa/login":{"post":{"tags":["Auth"],"summary":"Login 2Fa","description":"Complete login with 2FA code after password verification.","operationId":"login_2fa_api_auth_2fa_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verify2FALogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/2fa/setup":{"post":{"tags":["Auth"],"summary":"Setup 2Fa","description":"Generate TOTP secret and QR code for 2FA setup.","operationId":"setup_2fa_api_auth_2fa_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/2fa/verify":{"post":{"tags":["Auth"],"summary":"Verify 2Fa Setup","description":"Verify TOTP code and enable 2FA.","operationId":"verify_2fa_setup_api_auth_2fa_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verify2FACode"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/2fa/disable":{"post":{"tags":["Auth"],"summary":"Disable 2Fa","description":"Disable 2FA with a valid TOTP code or backup code.","operationId":"disable_2fa_api_auth_2fa_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verify2FACode"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/":{"get":{"tags":["Plans"],"summary":"Get Plans","description":"List all available plans with features and pricing.","operationId":"get_plans_api_plans__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/plans/current":{"get":{"tags":["Plans"],"summary":"Get Current Plan","description":"Get the current user's plan details, usage, and subscription status.","operationId":"get_current_plan_api_plans_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/plans/upgrade":{"post":{"tags":["Plans"],"summary":"Upgrade Plan","description":"Request a plan upgrade. Admin only — normal users must go through Stripe billing.","operationId":"upgrade_plan_api_plans_upgrade_post","parameters":[{"name":"plan_id","in":"query","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/downgrade":{"post":{"tags":["Plans"],"summary":"Downgrade Plan","description":"Downgrade to a lower plan. Any user can downgrade.\nClears payment/subscription fields.","operationId":"downgrade_plan_api_plans_downgrade_post","parameters":[{"name":"plan_id","in":"query","required":false,"schema":{"type":"string","default":"free","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/plans/usage":{"get":{"tags":["Plans"],"summary":"Get Usage","description":"Get detailed usage stats for the current month.","operationId":"get_usage_api_plans_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/chart/messages":{"get":{"tags":["Analytics"],"summary":"Chart Messages","description":"Get daily message counts for the last N days. Optionally filter by bot_id.","operationId":"chart_messages_api_analytics_chart_messages_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/chart/sessions":{"get":{"tags":["Analytics"],"summary":"Chart Sessions","description":"Get daily session counts for the last N days. Optionally filter by bot_id.","operationId":"chart_sessions_api_analytics_chart_sessions_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/chart/bots":{"get":{"tags":["Analytics"],"summary":"Chart Bots Usage","description":"Get message count per bot (for pie/bar chart). Scoped to user's bots.","operationId":"chart_bots_usage_api_analytics_chart_bots_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/top-bots":{"get":{"tags":["Analytics"],"summary":"Top Bots","description":"Get top bots by message count. Scoped to user's bots.","operationId":"top_bots_api_analytics_top_bots_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/recent-activity":{"get":{"tags":["Analytics"],"summary":"Recent Activity","description":"Get recent chat sessions with details. Scoped to user's bots.","operationId":"recent_activity_api_analytics_recent_activity_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/channels":{"get":{"tags":["Analytics"],"summary":"Channel Breakdown","description":"Get message/session breakdown by channel. Scoped to user's bots.","operationId":"channel_breakdown_api_analytics_channels_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/hourly":{"get":{"tags":["Analytics"],"summary":"Hourly Distribution","description":"Get message distribution by hour of day. Scoped to user's bots.","operationId":"hourly_distribution_api_analytics_hourly_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/response-time":{"get":{"tags":["Analytics"],"summary":"Avg Response Time","description":"Get average bot response time stats. Scoped to user's bots.","operationId":"avg_response_time_api_analytics_response_time_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/export":{"get":{"tags":["Analytics"],"summary":"Export Analytics","description":"Export analytics data as JSON (for PDF/CSV generation on frontend).","operationId":"export_analytics_api_analytics_export_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/export/csv":{"get":{"tags":["Analytics"],"summary":"Export Analytics Csv","description":"Export analytics as CSV file.","operationId":"export_analytics_csv_api_analytics_export_csv_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/summary":{"get":{"tags":["Analytics"],"summary":"Analytics Summary","description":"Quick summary stats for the analytics dashboard header. Scoped to user's bots.","operationId":"analytics_summary_api_analytics_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/bot/{bot_id}":{"get":{"tags":["Analytics"],"summary":"Bot Analytics","description":"Get detailed analytics for a specific bot.\nReturns messages chart, response times, channel breakdown, hourly, and totals.","operationId":"bot_analytics_api_analytics_bot__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/overview":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Overview","description":"Conversation intelligence overview.\nReturns: CSAT avg, containment rate, escalation rate, quality score,\navg messages per session, resolution rate, and period comparisons.","operationId":"analytics_v2_overview_api_analytics_v2_overview_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/funnel":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Funnel","description":"Conversion funnel: Visitors → Widget Opens → Chats Started → Leads Captured.\nUses visitor_events + sessions + contacts tables.","operationId":"analytics_v2_funnel_api_analytics_v2_funnel_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/csat-trend":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Csat Trend","description":"Daily CSAT trend for chart — avg rating per day.","operationId":"analytics_v2_csat_trend_api_analytics_v2_csat_trend_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/quality":{"get":{"tags":["Analytics"],"summary":"Analytics V2 Quality","description":"AI quality scorecard per bot.\nReturns per-bot breakdown: CSAT, containment, resolution, response time, message volume.","operationId":"analytics_v2_quality_api_analytics_v2_quality_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/agents":{"get":{"tags":["Analytics"],"summary":"Agent Performance","description":"Per-agent performance metrics: conversations, response time, CSAT, resolution.","operationId":"agent_performance_api_analytics_v2_agents_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/agents/{agent_id}":{"get":{"tags":["Analytics"],"summary":"Agent Detail","description":"Detailed metrics for a single agent.","operationId":"agent_detail_api_analytics_v2_agents__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/v2/feedback/{bot_id}":{"get":{"tags":["Analytics"],"summary":"Feedback Analytics","description":"Comprehensive feedback analytics: satisfaction trends, problem areas, improvement tracking.","operationId":"feedback_analytics_api_analytics_v2_feedback__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/rate-limits/status":{"get":{"tags":["Analytics"],"summary":"Rate Limit Status","description":"Show current rate limit usage and quotas for the authenticated user.","operationId":"rate_limit_status_api_analytics_rate_limits_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/roi":{"get":{"tags":["Analytics"],"summary":"Get Roi Dashboard","description":"Calculate ROI metrics — hours saved, money saved, efficiency gain.","operationId":"get_roi_dashboard_api_analytics_roi_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard":{"get":{"tags":["Admin"],"summary":"Admin Dashboard","description":"Comprehensive admin dashboard stats.","operationId":"admin_dashboard_api_admin_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/users":{"get":{"tags":["Admin"],"summary":"List Users","description":"List all registered users with filters and search.","operationId":"list_users_api_admin_users_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"created_at","title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}":{"get":{"tags":["Admin"],"summary":"Get User Detail","description":"Get detailed user info.","operationId":"get_user_detail_api_admin_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin"],"summary":"Delete User","description":"Delete a user and all their data.","operationId":"delete_user_api_admin_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/toggle":{"post":{"tags":["Admin"],"summary":"Toggle User","description":"Activate or deactivate a user.","operationId":"toggle_user_api_admin_users__user_id__toggle_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/plan":{"post":{"tags":["Admin"],"summary":"Change User Plan","description":"Change a user's plan (admin override). Resets payment fields.","operationId":"change_user_plan_api_admin_users__user_id__plan_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlanChangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/admin":{"post":{"tags":["Admin"],"summary":"Toggle Admin","description":"Toggle admin status for a user.","operationId":"toggle_admin_api_admin_users__user_id__admin_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bots":{"get":{"tags":["Admin"],"summary":"Admin List Bots","description":"List all bots across all users.","operationId":"admin_list_bots_api_admin_bots_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bots/{bot_id}":{"put":{"tags":["Admin"],"summary":"Admin Update Bot","description":"Admin update: toggle is_public, set custom_domain, change status.","operationId":"admin_update_bot_api_admin_bots__bot_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reset-stats":{"post":{"tags":["Admin"],"summary":"Reset Stats","description":"Reset usage stats (messages, sessions). Requires confirm=RESET to proceed.","operationId":"reset_stats_api_admin_reset_stats_post","parameters":[{"name":"confirm","in":"query","required":false,"schema":{"type":"string","default":"","title":"Confirm"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reseed":{"post":{"tags":["Admin"],"summary":"Reseed Bots","description":"Re-seed demo bots.","operationId":"reseed_bots_api_admin_reseed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/system-health":{"get":{"tags":["Admin"],"summary":"System Health","description":"Get system health information.","operationId":"system_health_api_admin_system_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/export/users":{"get":{"tags":["Admin"],"summary":"Export Users","description":"Export all users as JSON (for CSV conversion on frontend).","operationId":"export_users_api_admin_export_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/audit-log":{"get":{"tags":["Admin"],"summary":"Get Audit Log","description":"View audit log entries. Admin only.","operationId":"get_audit_log_api_admin_audit_log_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"user_id_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/cleanup":{"post":{"tags":["Admin"],"summary":"Db Cleanup","description":"Purge stale data: rate_limits >1h, oauth_states >15m, stripe_events >90d, audit_log >180d.","operationId":"db_cleanup_api_admin_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/users/merge":{"post":{"tags":["Admin"],"summary":"Merge Users","description":"Merge source user into target user. Transfers bots, sessions, messages, API keys.\nSource user is deactivated after merge.","operationId":"merge_users_api_admin_users_merge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MergeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/webhook":{"get":{"tags":["WhatsApp"],"summary":"Verify Webhook","description":"WhatsApp webhook verification (GET).","operationId":"verify_webhook_api_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":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["WhatsApp"],"summary":"Receive Message","description":"Receive incoming WhatsApp messages (Meta Cloud API).\nMulti-tenant: routes by phone_number_id → finds bot with that phone_id → uses bot's token.","operationId":"receive_message_api_whatsapp_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/whatsapp/gateway-webhook":{"post":{"tags":["WhatsApp"],"summary":"Gateway Webhook","description":"Receive messages from the self-hosted Baileys WhatsApp gateway.\nThis is the alternative to the official Meta webhook.","operationId":"gateway_webhook_api_whatsapp_gateway_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/whatsapp/wizard/status/{bot_id}":{"get":{"tags":["WhatsApp"],"summary":"Wizard Status","description":"Get wizard completion status for a bot.","operationId":"wizard_status_api_whatsapp_wizard_status__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/wizard/validate-token":{"post":{"tags":["WhatsApp"],"summary":"Wizard Validate Token","description":"Step 1: Validate a Meta Cloud API token.\nCalls the Meta Graph API to verify the token is valid and returns account info.","operationId":"wizard_validate_token_api_whatsapp_wizard_validate_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardValidateToken"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/wizard/verify-phone":{"post":{"tags":["WhatsApp"],"summary":"Wizard Verify Phone","description":"Step 2: Verify phone number ID.\nCalls Meta API to confirm the phone_number_id exists and returns the display phone number.","operationId":"wizard_verify_phone_api_whatsapp_wizard_verify_phone_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardVerifyPhone"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/wizard/setup-webhook":{"post":{"tags":["WhatsApp"],"summary":"Wizard Setup Webhook","description":"Step 3: Return webhook configuration details.\nThe webhook URL is the same for all bots (multi-tenant routing).\nThe user needs to configure it in Meta Developer Console.","operationId":"wizard_setup_webhook_api_whatsapp_wizard_setup_webhook_post","parameters":[{"name":"bot_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/wizard/test-message":{"post":{"tags":["WhatsApp"],"summary":"Wizard Test Message","description":"Step 4: Send a test message to verify the full pipeline works.","operationId":"wizard_test_message_api_whatsapp_wizard_test_message_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardTestMessage"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/templates/seeds":{"get":{"tags":["WhatsApp"],"summary":"Get Seed Templates","description":"Get pre-built template seeds optimized for Moroccan businesses.","operationId":"get_seed_templates_api_whatsapp_templates_seeds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/whatsapp/bots/{bot_id}/templates/local":{"get":{"tags":["WhatsApp"],"summary":"List Local Templates","description":"List locally created template drafts for a bot.","operationId":"list_local_templates_api_whatsapp_bots__bot_id__templates_local_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/templates/create":{"post":{"tags":["WhatsApp"],"summary":"Create Template Draft","description":"Create a local template draft. Can later be submitted to Meta for approval.\nValidates structure: name format, body length, variable count.","operationId":"create_template_draft_api_whatsapp_bots__bot_id__templates_create_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__whatsapp__TemplateCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/templates/from-seed":{"post":{"tags":["WhatsApp"],"summary":"Create From Seed","description":"Create a template draft from a seed template.","operationId":"create_from_seed_api_whatsapp_bots__bot_id__templates_from_seed_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateFromSeedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/templates/local/{template_id}":{"delete":{"tags":["WhatsApp"],"summary":"Delete Template Draft","description":"Delete a local template draft.","operationId":"delete_template_draft_api_whatsapp_bots__bot_id__templates_local__template_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/templates/submit/{template_id}":{"post":{"tags":["WhatsApp"],"summary":"Submit Template To Meta","description":"Submit a template draft to Meta for approval.\nRequires WABA ID configured on the bot.","operationId":"submit_template_to_meta_api_whatsapp_bots__bot_id__templates_submit__template_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/config":{"post":{"tags":["WhatsApp"],"summary":"Configure Bot Whatsapp","description":"Configure WhatsApp credentials for a specific bot.\nEach client enters their own Token + Phone ID here.\nRequires Enterprise plan (whatsapp_integration feature).","operationId":"configure_bot_whatsapp_api_whatsapp_bots__bot_id__config_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["WhatsApp"],"summary":"Get Bot Whatsapp Config","description":"Get WhatsApp configuration for a specific bot.","operationId":"get_bot_whatsapp_config_api_whatsapp_bots__bot_id__config_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["WhatsApp"],"summary":"Remove Bot Whatsapp Config","description":"Remove WhatsApp configuration from a bot.","operationId":"remove_bot_whatsapp_config_api_whatsapp_bots__bot_id__config_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/test-send":{"post":{"tags":["WhatsApp"],"summary":"Test Send From Bot","description":"Send a test WhatsApp message using a specific bot's credentials.","operationId":"test_send_from_bot_api_whatsapp_bots__bot_id__test_send_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/status":{"get":{"tags":["WhatsApp"],"summary":"Whatsapp Status","description":"Check overall WhatsApp integration status (scoped to user's bots). Auth required.","operationId":"whatsapp_status_api_whatsapp_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/whatsapp/contacts":{"get":{"tags":["WhatsApp"],"summary":"List Wa Contacts","description":"List WhatsApp contacts (scoped to user's bots).","operationId":"list_wa_contacts_api_whatsapp_contacts_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/conversations":{"get":{"tags":["WhatsApp"],"summary":"List Wa Conversations","description":"List WhatsApp conversations (scoped to user's bots).","operationId":"list_wa_conversations_api_whatsapp_conversations_get","parameters":[{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/send":{"post":{"tags":["WhatsApp"],"summary":"Send Manual Message","description":"Send a WhatsApp message manually from the dashboard.\nIf bot_id is specified, uses that bot's credentials.","operationId":"send_manual_message_api_whatsapp_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppSendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/analytics":{"get":{"tags":["WhatsApp"],"summary":"Whatsapp Analytics","description":"Get WhatsApp-specific analytics (scoped to user's bots).","operationId":"whatsapp_analytics_api_whatsapp_analytics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/templates":{"get":{"tags":["WhatsApp"],"summary":"List Templates","description":"List WhatsApp message templates from Meta Business API.","operationId":"list_templates_api_whatsapp_bots__bot_id__templates_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/bots/{bot_id}/templates/sync":{"post":{"tags":["WhatsApp"],"summary":"Sync Templates","description":"Sync templates from Meta and cache them locally in Supabase.","operationId":"sync_templates_api_whatsapp_bots__bot_id__templates_sync_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/send-template":{"post":{"tags":["WhatsApp"],"summary":"Send Template Message","description":"Send a WhatsApp template message (required for initiating conversations after 24h).","operationId":"send_template_message_api_whatsapp_send_template_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppTemplateSend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/send-interactive":{"post":{"tags":["WhatsApp"],"summary":"Send Interactive Message","description":"Send an interactive WhatsApp message with buttons or lists.\n\nButton type: Up to 3 reply buttons with id + title.\nList type: Sections with rows — menu-style selection.","operationId":"send_interactive_message_api_whatsapp_send_interactive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppInteractiveSend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/send-media":{"post":{"tags":["WhatsApp"],"summary":"Send Media Message","description":"Send a media message (image, document, video, audio) via WhatsApp.","operationId":"send_media_message_api_whatsapp_send_media_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppMediaSend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/whatsapp/broadcast":{"post":{"tags":["WhatsApp"],"summary":"Broadcast Message","description":"Broadcast a message or template to multiple WhatsApp recipients.\nNote: For non-template messages, recipients must have an active 24h conversation window.\nTemplates can be sent anytime (if approved on Meta).\nMax 100 recipients per request.","operationId":"broadcast_message_api_whatsapp_broadcast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppBroadcast"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/status":{"get":{"tags":["Billing"],"summary":"Billing Status","description":"Check if Stripe billing is available.","operationId":"billing_status_api_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/checkout":{"post":{"tags":["Billing"],"summary":"Create Checkout Session","description":"Create a Stripe Checkout Session for plan upgrade.\nReturns the checkout URL — frontend redirects the user there.","operationId":"create_checkout_session_api_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/portal":{"post":{"tags":["Billing"],"summary":"Create Portal Session","description":"Create a Stripe Customer Portal session.\nAllows users to manage their subscription, update payment method, view invoices.","operationId":"create_portal_session_api_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events.\n- checkout.session.completed → upgrade user plan\n- customer.subscription.deleted → downgrade to free\n- customer.subscription.updated → update plan if changed\n- invoice.payment_failed → notify user, mark at-risk","operationId":"stripe_webhook_api_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/billing/invoices":{"get":{"tags":["Billing"],"summary":"List Invoices","description":"List recent invoices for the current user from Stripe.","operationId":"list_invoices_api_billing_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/":{"get":{"tags":["Templates"],"summary":"List Templates","description":"List all bot templates, optionally filtered by category.","operationId":"list_templates_api_templates__get","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/popular":{"get":{"tags":["Templates"],"summary":"Popular Templates","description":"Get popular templates.","operationId":"popular_templates_api_templates_popular_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/templates/{template_id}":{"get":{"tags":["Templates"],"summary":"Get Template","description":"Get a specific template by ID.","operationId":"get_template_api_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/templates/{template_id}/create":{"post":{"tags":["Templates"],"summary":"Create Bot From Template","description":"Create a new bot from a template.","operationId":"create_bot_from_template_api_templates__template_id__create_post","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/":{"get":{"tags":["Teams"],"summary":"List My Teams","description":"List teams the user belongs to (as owner or member).","operationId":"list_my_teams_api_teams__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Teams"],"summary":"Create Team","description":"Create a new team.","operationId":"create_team_api_teams__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/my-invites":{"get":{"tags":["Teams"],"summary":"List My Invites","description":"List pending invitations for the current user (by email).","operationId":"list_my_invites_api_teams_my_invites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/teams/invites/{invite_id}/decline":{"post":{"tags":["Teams"],"summary":"Decline Invite","description":"Decline a team invitation.","operationId":"decline_invite_api_teams_invites__invite_id__decline_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/join/{invite_token}":{"get":{"tags":["Teams"],"summary":"Join Team Page","description":"GET handler for email invite links. Redirects to dashboard with invite token.","operationId":"join_team_page_api_teams_join__invite_token__get","parameters":[{"name":"invite_token","in":"path","required":true,"schema":{"type":"string","title":"Invite Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Teams"],"summary":"Accept Invite","description":"Accept a team invitation.","operationId":"accept_invite_api_teams_join__invite_token__post","parameters":[{"name":"invite_token","in":"path","required":true,"schema":{"type":"string","title":"Invite Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}":{"get":{"tags":["Teams"],"summary":"Get Team","description":"Get team details with members.","operationId":"get_team_api_teams__team_id__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Teams"],"summary":"Update Team","description":"Update team name.","operationId":"update_team_api_teams__team_id__put","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Delete Team","description":"Delete a team.","operationId":"delete_team_api_teams__team_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/invite":{"post":{"tags":["Teams"],"summary":"Invite Member","description":"Invite a user to the team by email.","operationId":"invite_member_api_teams__team_id__invite_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInvite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/members/{member_user_id}":{"delete":{"tags":["Teams"],"summary":"Remove Member","description":"Remove a member from the team.","operationId":"remove_member_api_teams__team_id__members__member_user_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","title":"Member User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/members/{member_user_id}/role":{"put":{"tags":["Teams"],"summary":"Change Member Role","description":"Change a member's role.","operationId":"change_member_role_api_teams__team_id__members__member_user_id__role_put","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"member_user_id","in":"path","required":true,"schema":{"type":"string","title":"Member User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/teams/{team_id}/bots/{bot_id}":{"post":{"tags":["Teams"],"summary":"Assign Bot To Team","description":"Assign a bot to a team (shared access).","operationId":"assign_bot_to_team_api_teams__team_id__bots__bot_id__post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Unassign Bot From Team","description":"Remove a bot from a team.","operationId":"unassign_bot_from_team_api_teams__team_id__bots__bot_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/":{"post":{"tags":["Webhooks"],"summary":"Create Webhook","description":"Register a webhook endpoint for a bot. Owner only.","operationId":"create_webhook_api_webhooks__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{bot_id}":{"get":{"tags":["Webhooks"],"summary":"List Webhooks","description":"List all webhooks for a bot. Owner only.","operationId":"list_webhooks_api_webhooks__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{webhook_id}":{"put":{"tags":["Webhooks"],"summary":"Update Webhook","description":"Update a webhook. Owner only.","operationId":"update_webhook_api_webhooks__webhook_id__put","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete Webhook","description":"Delete a webhook. Owner only.","operationId":"delete_webhook_api_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{webhook_id}/test":{"post":{"tags":["Webhooks"],"summary":"Test Webhook","description":"Send a test ping to a webhook endpoint.","operationId":"test_webhook_api_webhooks__webhook_id__test_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{bot_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Get Deliveries","description":"Get recent webhook delivery logs for a bot.","operationId":"get_deliveries_api_webhooks__bot_id__deliveries_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/memory":{"post":{"tags":["data"],"summary":"Save Memory","description":"Sauvegarder une info sur un contact.","operationId":"save_memory_api_data_bots__bot_id__memory_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"Search Memory","description":"Rechercher dans la mémoire du bot.","operationId":"search_memory_api_data_bots__bot_id__memory_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/memory/{contact_id}":{"get":{"tags":["data"],"summary":"Get Contact Memory","description":"Récupérer toute la mémoire d'un contact.","operationId":"get_contact_memory_api_data_bots__bot_id__memory__contact_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/memory/{memory_id}":{"delete":{"tags":["data"],"summary":"Delete Memory","description":"Supprimer une entrée mémoire.","operationId":"delete_memory_api_data_bots__bot_id__memory__memory_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/memory-stats":{"get":{"tags":["data"],"summary":"Memory Stats","description":"Statistiques mémoire du bot.","operationId":"memory_stats_api_data_bots__bot_id__memory_stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections":{"post":{"tags":["data"],"summary":"Create Collection","description":"Créer une collection de données.","operationId":"create_collection_api_data_bots__bot_id__collections_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"List Collections","description":"Lister les collections d'un bot.","operationId":"list_collections_api_data_bots__bot_id__collections_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}":{"delete":{"tags":["data"],"summary":"Delete Collection","description":"Supprimer une collection et ses données.","operationId":"delete_collection_api_data_bots__bot_id__collections__collection_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}/validate":{"post":{"tags":["data"],"summary":"Validate Record","description":"Validate record data against collection schema without saving.","operationId":"validate_record_api_data_bots__bot_id__collections__collection_id__validate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}/records":{"post":{"tags":["data"],"summary":"Add Record","description":"Ajouter un enregistrement (schema-validated if collection has validation enabled).","operationId":"add_record_api_data_bots__bot_id__collections__collection_id__records_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"List Records","description":"Lister/rechercher les enregistrements.","operationId":"list_records_api_data_bots__bot_id__collections__collection_id__records_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}/records/{record_id}":{"put":{"tags":["data"],"summary":"Update Record","description":"Modifier un enregistrement.","operationId":"update_record_api_data_bots__bot_id__collections__collection_id__records__record_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordUpdateInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["data"],"summary":"Delete Record","description":"Supprimer un enregistrement.","operationId":"delete_record_api_data_bots__bot_id__collections__collection_id__records__record_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}/records/bulk":{"post":{"tags":["data"],"summary":"Bulk Add Records","description":"Bulk insert up to 500 records into a collection. Schema-validated if enabled.","operationId":"bulk_add_records_api_data_bots__bot_id__collections__collection_id__records_bulk_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRecordInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["data"],"summary":"Bulk Update Records","description":"Bulk update records. Each item must have 'id' + fields to update.","operationId":"bulk_update_records_api_data_bots__bot_id__collections__collection_id__records_bulk_put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["data"],"summary":"Bulk Delete Records","description":"Bulk delete up to 500 records by ID.","operationId":"bulk_delete_records_api_data_bots__bot_id__collections__collection_id__records_bulk_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}/export":{"get":{"tags":["data"],"summary":"Export Collection","description":"Export all records from a collection as JSON or CSV download.","operationId":"export_collection_api_data_bots__bot_id__collections__collection_id__export_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/collections/{collection_id}/import":{"post":{"tags":["data"],"summary":"Import Collection Records","description":"Import records into a collection (JSON body with records array).\n\nEach record should be a dict of field values (no 'data' wrapper needed).","operationId":"import_collection_records_api_data_bots__bot_id__collections__collection_id__import_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRecordsInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/tasks":{"post":{"tags":["data"],"summary":"Create Task","description":"Créer une tâche ou rendez-vous.","operationId":"create_task_api_data_bots__bot_id__tasks_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["data"],"summary":"List Tasks","description":"Lister les tâches d'un bot.","operationId":"list_tasks_api_data_bots__bot_id__tasks_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"task_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Task Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/tasks/{task_id}":{"put":{"tags":["data"],"summary":"Update Task","description":"Modifier une tâche.","operationId":"update_task_api_data_bots__bot_id__tasks__task_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdateInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["data"],"summary":"Delete Task","description":"Supprimer une tâche.","operationId":"delete_task_api_data_bots__bot_id__tasks__task_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/bots/{bot_id}/task-stats":{"get":{"tags":["data"],"summary":"Task Stats","description":"Statistiques des tâches.","operationId":"task_stats_api_data_bots__bot_id__task_stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/types":{"get":{"tags":["channels"],"summary":"List Channel Types","description":"List available channel types with setup instructions.","operationId":"list_channel_types_api_channels_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/channels/bot/{bot_id}":{"get":{"tags":["channels"],"summary":"List Bot Channels","description":"List all channels connected to a bot.","operationId":"list_bot_channels_api_channels_bot__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/bot/{bot_id}/connect":{"post":{"tags":["channels"],"summary":"Connect Channel","description":"Connect a new channel to a bot.","operationId":"connect_channel_api_channels_bot__bot_id__connect_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/bot/{bot_id}/{channel_id}":{"delete":{"tags":["channels"],"summary":"Disconnect Channel","description":"Disconnect and remove a channel from a bot.","operationId":"disconnect_channel_api_channels_bot__bot_id___channel_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/{channel_id}/status":{"get":{"tags":["channels"],"summary":"Get Channel Status","description":"Get detailed status for a specific channel.","operationId":"get_channel_status_api_channels__channel_id__status_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/telegram/webhook/{channel_id}":{"post":{"tags":["channels"],"summary":"Telegram Webhook","description":"Receive Telegram updates for a specific bot channel.","operationId":"telegram_webhook_api_channels_telegram_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/meta/webhook/{channel_id}":{"get":{"tags":["channels"],"summary":"Meta Webhook Verify","description":"Verify webhook for Instagram/Messenger (Meta platform).","operationId":"meta_webhook_verify_api_channels_meta_webhook__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Meta Webhook Receive","description":"Receive Instagram DM or Messenger messages.","operationId":"meta_webhook_receive_api_channels_meta_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/tiktok/webhook/{channel_id}":{"post":{"tags":["channels"],"summary":"Tiktok Webhook","description":"Receive TikTok Business Messaging events.","operationId":"tiktok_webhook_api_channels_tiktok_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/routing-rules/{bot_id}":{"get":{"tags":["channels"],"summary":"List Routing Rules","description":"List all routing rules for a bot.","operationId":"list_routing_rules_api_channels_routing_rules__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Create Routing Rule","description":"Create a channel routing rule.","operationId":"create_routing_rule_api_channels_routing_rules__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__channels__RoutingRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/routing-rules/{bot_id}/{rule_id}":{"put":{"tags":["channels"],"summary":"Update Routing Rule","description":"Update a routing rule.","operationId":"update_routing_rule_api_channels_routing_rules__bot_id___rule_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__channels__RoutingRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channels"],"summary":"Delete Routing Rule","description":"Delete a routing rule.","operationId":"delete_routing_rule_api_channels_routing_rules__bot_id___rule_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/{channel_id}/health":{"post":{"tags":["channels"],"summary":"Check Channel Health","description":"Check if a channel's credentials are valid and connection is alive.","operationId":"check_channel_health_api_channels__channel_id__health_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/bot/{bot_id}/health-check-all":{"post":{"tags":["channels"],"summary":"Check All Channels Health","description":"Batch health check all channels for a bot.","operationId":"check_all_channels_health_api_channels_bot__bot_id__health_check_all_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/{channel_id}/test":{"post":{"tags":["channels"],"summary":"Send Test Message","description":"Send a test message through a channel to verify it works end-to-end.","operationId":"send_test_message_api_channels__channel_id__test_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/canned/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Canned Responses","description":"List canned responses for a bot. Owner only.","operationId":"list_canned_responses_api_inbox_canned__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/canned":{"post":{"tags":["Inbox"],"summary":"Create Canned Response","description":"Create a canned response template.","operationId":"create_canned_response_api_inbox_canned_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/canned/{response_id}":{"put":{"tags":["Inbox"],"summary":"Update Canned Response","description":"Update a canned response.","operationId":"update_canned_response_api_inbox_canned__response_id__put","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete Canned Response","description":"Delete a canned response.","operationId":"delete_canned_response_api_inbox_canned__response_id__delete","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/canned/{response_id}/use":{"post":{"tags":["Inbox"],"summary":"Use Canned Response","description":"Increment usage count of a canned response (for analytics/sorting).","operationId":"use_canned_response_api_inbox_canned__response_id__use_post","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/sessions/{session_id}/tags":{"put":{"tags":["Inbox"],"summary":"Update Session Tags","description":"Set tags on a conversation session. Owner of the bot only.","operationId":"update_session_tags_api_inbox_sessions__session_id__tags_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTagsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/tags/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Bot Tags","description":"List all unique tags used across sessions of a bot.","operationId":"list_bot_tags_api_inbox_tags__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/sessions/{session_id}/assign":{"put":{"tags":["Inbox"],"summary":"Assign Session","description":"Assign a conversation to a team member (or unassign).","operationId":"assign_session_api_inbox_sessions__session_id__assign_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionAssign"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/auto-assign/{bot_id}":{"post":{"tags":["Inbox"],"summary":"Auto Assign","description":"Auto-assign unassigned conversations using round-robin.\nIf session_id is given, assign just that one. Otherwise assign all unassigned.","operationId":"auto_assign_api_inbox_auto_assign__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/views":{"get":{"tags":["Inbox"],"summary":"List Views","description":"List saved inbox views for the current user.","operationId":"list_views_api_inbox_views_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Inbox"],"summary":"Create View","description":"Create a saved inbox view with filters.","operationId":"create_view_api_inbox_views_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedViewCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/views/{view_id}":{"delete":{"tags":["Inbox"],"summary":"Delete View","description":"Delete a saved view.","operationId":"delete_view_api_inbox_views__view_id__delete","parameters":[{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/sessions/{session_id}/status":{"put":{"tags":["Inbox"],"summary":"Update Session Status","description":"Update conversation status (active/waiting/resolved/closed).","operationId":"update_session_status_api_inbox_sessions__session_id__status_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/conversations/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Inbox Conversations","description":"List conversations with filtering by status, assignment, and tags.\nReturns enriched data including tags, status, and assignment info.","operationId":"list_inbox_conversations_api_inbox_conversations__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(active|waiting|resolved|closed)$"},{"type":"null"}],"title":"Status"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/stats/{bot_id}":{"get":{"tags":["Inbox"],"summary":"Inbox Stats","description":"Get inbox statistics: counts by status, unassigned count.","operationId":"inbox_stats_api_inbox_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/notes/{session_id}":{"get":{"tags":["Inbox"],"summary":"List Notes","description":"List internal notes on a conversation.","operationId":"list_notes_api_inbox_notes__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Inbox"],"summary":"Create Note","description":"Add an internal note to a conversation (not visible to end-user).\nSupports @mentions: include @email in the note content to notify that agent.","operationId":"create_note_api_inbox_notes__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalNoteCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/notes/{note_id}":{"delete":{"tags":["Inbox"],"summary":"Delete Note","description":"Delete an internal note.","operationId":"delete_note_api_inbox_notes__note_id__delete","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/summary/{session_id}":{"get":{"tags":["Inbox"],"summary":"Ai Summary","description":"Generate an AI summary of a conversation for agent handoff.","operationId":"ai_summary_api_inbox_summary__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/export/{bot_id}":{"get":{"tags":["Inbox"],"summary":"Export Conversations","description":"Export conversations with messages as CSV or JSON.\n- CSV: flat format (one row per message) for spreadsheet analysis\n- JSON: nested format (sessions → messages) for programmatic use","operationId":"export_conversations_api_inbox_export__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json)$","default":"json","title":"Format"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"include_messages","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Messages"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/export-session/{session_id}":{"get":{"tags":["Inbox"],"summary":"Export Single Conversation","description":"Export a single conversation with all messages.","operationId":"export_single_conversation_api_inbox_export_session__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json|text)$","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/assignment-rules":{"post":{"tags":["Inbox"],"summary":"Create Assignment Rule","description":"Create an auto-assignment rule for a bot.","operationId":"create_assignment_rule_api_inbox_assignment_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRuleCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/assignment-rules/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Assignment Rules","description":"List assignment rules for a bot.","operationId":"list_assignment_rules_api_inbox_assignment_rules__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/assignment-rules/{rule_id}":{"put":{"tags":["Inbox"],"summary":"Update Assignment Rule","description":"Update an assignment rule.","operationId":"update_assignment_rule_api_inbox_assignment_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete Assignment Rule","description":"Delete an assignment rule.","operationId":"delete_assignment_rule_api_inbox_assignment_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/assignment-rules/{bot_id}/evaluate":{"post":{"tags":["Inbox"],"summary":"Evaluate Assignment Rules","description":"Evaluate assignment rules for a session and return the best agent match.\npayload: {session_id, channel, tags, language}","operationId":"evaluate_assignment_rules_api_inbox_assignment_rules__bot_id__evaluate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/custom-fields":{"post":{"tags":["Inbox"],"summary":"Create Custom Field","description":"Define a custom field for conversations of a bot.","operationId":"create_custom_field_api_inbox_custom_fields_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldDefinition"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/custom-fields/{bot_id}":{"get":{"tags":["Inbox"],"summary":"List Custom Fields","description":"List custom field definitions for a bot.","operationId":"list_custom_fields_api_inbox_custom_fields__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/custom-fields/{field_id}":{"put":{"tags":["Inbox"],"summary":"Update Custom Field","description":"Update a custom field definition.","operationId":"update_custom_field_api_inbox_custom_fields__field_id__put","parameters":[{"name":"field_id","in":"path","required":true,"schema":{"type":"string","title":"Field Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete Custom Field","description":"Delete a custom field definition.","operationId":"delete_custom_field_api_inbox_custom_fields__field_id__delete","parameters":[{"name":"field_id","in":"path","required":true,"schema":{"type":"string","title":"Field Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inbox/sessions/{session_id}/custom-fields":{"put":{"tags":["Inbox"],"summary":"Set Session Custom Fields","description":"Set custom field values on a session.","operationId":"set_session_custom_fields_api_inbox_sessions__session_id__custom_fields_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldValueSet"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Inbox"],"summary":"Get Session Custom Fields","description":"Get custom field values for a session.","operationId":"get_session_custom_fields_api_inbox_sessions__session_id__custom_fields_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/takeover/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Takeover Conversation","description":"Agent takes over a conversation — marks it as handoff and assigns to the agent.","operationId":"takeover_conversation_api_live_agent_takeover__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/release/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Release Conversation","description":"Release conversation back to bot (end handoff).","operationId":"release_conversation_api_live_agent_release__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffReleaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/reply/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Agent Reply","description":"Agent sends a message in a conversation (human reply instead of bot).","operationId":"agent_reply_api_live_agent_reply__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/messages/{session_id}":{"get":{"tags":["Live Agent"],"summary":"Get Agent Messages","description":"Get all agent messages for a session (for agent dashboard).","operationId":"get_agent_messages_api_live_agent_messages__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/handoff-queue/{bot_id}":{"get":{"tags":["Live Agent"],"summary":"Get Handoff Queue","description":"Get all conversations waiting for human handoff.","operationId":"get_handoff_queue_api_live_agent_handoff_queue__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/transfer/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Transfer Conversation","description":"Transfer a conversation from one agent to another with optional context note.","operationId":"transfer_conversation_api_live_agent_transfer__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/whisper/{session_id}":{"post":{"tags":["Live Agent"],"summary":"Send Whisper","description":"Send a private whisper message to the agent handling a session.\nWhispers are internal-only — the customer NEVER sees them.\nUseful for supervisors coaching agents in real-time.","operationId":"send_whisper_api_live_agent_whisper__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhisperRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/whispers/{session_id}":{"get":{"tags":["Live Agent"],"summary":"Get Whispers","description":"Get all whisper messages for a session (agent-only view).","operationId":"get_whispers_api_live_agent_whispers__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/canned-responses/{bot_id}":{"post":{"tags":["Live Agent"],"summary":"Create Canned Response","description":"Create a canned (pre-written) response for agents to quickly insert.","operationId":"create_canned_response_api_live_agent_canned_responses__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Live Agent"],"summary":"List Canned Responses","description":"List all canned responses for a bot (optionally filter by category or search).","operationId":"list_canned_responses_api_live_agent_canned_responses__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/canned-responses/{bot_id}/{response_id}":{"put":{"tags":["Live Agent"],"summary":"Update Canned Response","description":"Update a canned response.","operationId":"update_canned_response_api_live_agent_canned_responses__bot_id___response_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CannedResponseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Live Agent"],"summary":"Delete Canned Response","description":"Delete a canned response.","operationId":"delete_canned_response_api_live_agent_canned_responses__bot_id___response_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/live-agent/metrics/{bot_id}":{"get":{"tags":["Live Agent"],"summary":"Get Agent Metrics","description":"Get agent performance metrics: response time, handle time, resolution rate, volume.\nOptionally filter by specific agent_id. Defaults to last 30 days.","operationId":"get_agent_metrics_api_live_agent_metrics__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{bot_id}":{"get":{"tags":["Tickets"],"summary":"List Tickets","description":"List tickets for a bot with optional filters.","operationId":"list_tickets_api_tickets__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":30,"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/":{"post":{"tags":["Tickets"],"summary":"Create Ticket","description":"Create a new ticket (optionally linked to a conversation).","operationId":"create_ticket_api_tickets__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/detail/{ticket_id}":{"get":{"tags":["Tickets"],"summary":"Get Ticket","description":"Get ticket details with comments.","operationId":"get_ticket_api_tickets_detail__ticket_id__get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Tickets"],"summary":"Update Ticket","description":"Update ticket fields.","operationId":"update_ticket_api_tickets_detail__ticket_id__put","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Tickets"],"summary":"Delete Ticket","description":"Delete a ticket (owner only).","operationId":"delete_ticket_api_tickets_detail__ticket_id__delete","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/detail/{ticket_id}/comments":{"post":{"tags":["Tickets"],"summary":"Add Comment","description":"Add a comment to a ticket.","operationId":"add_comment_api_tickets_detail__ticket_id__comments_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCommentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/from-conversation/{session_id}":{"post":{"tags":["Tickets"],"summary":"Create Ticket From Conversation","description":"Convert a conversation into a ticket with auto-populated fields.","operationId":"create_ticket_from_conversation_api_tickets_from_conversation__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","pattern":"^(low|medium|high|urgent)$","default":"medium","title":"Priority"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/stats/{bot_id}":{"get":{"tags":["Tickets"],"summary":"Ticket Stats","description":"Ticket statistics for a bot.","operationId":"ticket_stats_api_tickets_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/sla-rules":{"post":{"tags":["Tickets"],"summary":"Create Sla Rule","description":"Create a custom SLA rule for a bot (e.g. urgent tickets must be resolved in 2h).","operationId":"create_sla_rule_api_tickets_sla_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SLARuleCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/sla-rules/{bot_id}":{"get":{"tags":["Tickets"],"summary":"List Sla Rules","description":"List all SLA rules for a bot.","operationId":"list_sla_rules_api_tickets_sla_rules__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/sla-rules/{rule_id}":{"delete":{"tags":["Tickets"],"summary":"Delete Sla Rule","description":"Delete an SLA rule.","operationId":"delete_sla_rule_api_tickets_sla_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/sla-check/{bot_id}":{"get":{"tags":["Tickets"],"summary":"Check Sla Breaches","description":"Check all open tickets for SLA breaches — returns breached + at-risk tickets.\n- breached: past deadline\n- at_risk: within 1 hour of deadline\nAlso sends notifications for newly breached tickets.","operationId":"check_sla_breaches_api_tickets_sla_check__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/csat/submit":{"post":{"tags":["CSAT & Visitors"],"summary":"Submit Csat","description":"Submit a CSAT rating. Public endpoint (no auth) — called from chat widget.","operationId":"submit_csat_api_csat_submit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSATSubmitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/csat/results/{bot_id}":{"get":{"tags":["CSAT & Visitors"],"summary":"Get Csat Results","description":"Get CSAT results and analytics for a bot.","operationId":"get_csat_results_api_csat_results__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/csat/config/{bot_id}":{"put":{"tags":["CSAT & Visitors"],"summary":"Update Csat Config","description":"Update CSAT configuration on a bot.","operationId":"update_csat_config_api_csat_config__bot_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSATConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/csat/visitor-event":{"post":{"tags":["CSAT & Visitors"],"summary":"Track Visitor Event","description":"Track a visitor event. Public endpoint (no auth) — called from widget JS.","operationId":"track_visitor_event_api_csat_visitor_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorEventRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/csat/visitors/{bot_id}":{"get":{"tags":["CSAT & Visitors"],"summary":"Get Visitor Analytics","description":"Get visitor analytics for a bot (requires auth).","operationId":"get_visitor_analytics_api_csat_visitors__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/":{"get":{"tags":["Notifications"],"summary":"List Notifications","description":"List user's notifications (newest first).","operationId":"list_notifications_api_notifications__get","parameters":[{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}},{"name":"notif_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notif Type"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/unread-count":{"get":{"tags":["Notifications"],"summary":"Unread Count","description":"Quick unread count for badge display.","operationId":"unread_count_api_notifications_unread_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/notifications/read/{notification_id}":{"put":{"tags":["Notifications"],"summary":"Mark As Read","description":"Mark a notification as read.","operationId":"mark_as_read_api_notifications_read__notification_id__put","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/read-all":{"put":{"tags":["Notifications"],"summary":"Mark All Read","description":"Mark all notifications as read.","operationId":"mark_all_read_api_notifications_read_all_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/notifications/clear-all":{"delete":{"tags":["Notifications"],"summary":"Clear All","description":"Delete all read notifications (keep unread).","operationId":"clear_all_api_notifications_clear_all_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/notifications/{notification_id}":{"delete":{"tags":["Notifications"],"summary":"Delete Notification","description":"Delete a notification.","operationId":"delete_notification_api_notifications__notification_id__delete","parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notifications/preferences":{"get":{"tags":["Notifications"],"summary":"Get Preferences","description":"Get notification preferences.","operationId":"get_preferences_api_notifications_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["Notifications"],"summary":"Update Preferences","description":"Update notification preferences.","operationId":"update_preferences_api_notifications_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPrefsUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"List Flows","description":"List all automation flows for a bot.","operationId":"list_flows_api_automations_flows__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows":{"post":{"tags":["Automations & Flows"],"summary":"Create Flow","description":"Create an automation flow.","operationId":"create_flow_api_automations_flows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFlowRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/detail/{flow_id}":{"get":{"tags":["Automations & Flows"],"summary":"Get Flow","description":"Get a single flow.","operationId":"get_flow_api_automations_flows_detail__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Automations & Flows"],"summary":"Update Flow","description":"Update a flow.","operationId":"update_flow_api_automations_flows_detail__flow_id__put","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFlowRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Automations & Flows"],"summary":"Delete Flow","description":"Delete a flow.","operationId":"delete_flow_api_automations_flows_detail__flow_id__delete","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/toggle/{flow_id}":{"put":{"tags":["Automations & Flows"],"summary":"Toggle Flow","description":"Toggle a flow's active status.","operationId":"toggle_flow_api_automations_flows_toggle__flow_id__put","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/stats/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"Flow Stats","description":"Aggregated flow stats for a bot.","operationId":"flow_stats_api_automations_flows_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/logs/{flow_id}":{"get":{"tags":["Automations & Flows"],"summary":"Flow Logs","description":"Get execution logs for a flow.","operationId":"flow_logs_api_automations_flows_logs__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/proactive/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"List Proactive","description":"List proactive messages for a bot.","operationId":"list_proactive_api_automations_proactive__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/proactive":{"post":{"tags":["Automations & Flows"],"summary":"Create Proactive","description":"Create a proactive message rule.","operationId":"create_proactive_api_automations_proactive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/proactive/{msg_id}":{"put":{"tags":["Automations & Flows"],"summary":"Update Proactive","description":"Update a proactive message.","operationId":"update_proactive_api_automations_proactive__msg_id__put","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Automations & Flows"],"summary":"Delete Proactive","description":"Delete a proactive message.","operationId":"delete_proactive_api_automations_proactive__msg_id__delete","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/proactive/toggle/{msg_id}":{"put":{"tags":["Automations & Flows"],"summary":"Toggle Proactive","description":"Toggle a proactive message on/off.","operationId":"toggle_proactive_api_automations_proactive_toggle__msg_id__put","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/proactive/widget/{bot_id}":{"get":{"tags":["Automations & Flows"],"summary":"Get Active Proactive For Widget","description":"Widget calls this to get proactive messages to display.","operationId":"get_active_proactive_for_widget_api_automations_proactive_widget__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"page_url","in":"query","required":false,"schema":{"type":"string","default":"","title":"Page Url"}},{"name":"visit_count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Visit Count"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/proactive/widget/{msg_id}/stat":{"post":{"tags":["Automations & Flows"],"summary":"Track Proactive Stat","description":"Track proactive message interaction (widget-facing, no auth).","operationId":"track_proactive_stat_api_automations_proactive_widget__msg_id__stat_post","parameters":[{"name":"msg_id","in":"path","required":true,"schema":{"type":"string","title":"Msg Id"}},{"name":"action","in":"query","required":true,"schema":{"type":"string","pattern":"^(sent|clicked|dismissed)$","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/{flow_id}/execute":{"post":{"tags":["Automations & Flows"],"summary":"Execute Flow","description":"Manually execute a flow with given context.\n\nContext example: {\"session_id\": \"...\", \"message\": \"hello\", \"channel\": \"widget\"}","operationId":"execute_flow_api_automations_flows__flow_id__execute_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Context"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/evaluate/{bot_id}":{"post":{"tags":["Automations & Flows"],"summary":"Evaluate Flows","description":"Evaluate all active flows for a bot against the given context.\n\nReturns matched flows and optionally executes the first matching one.","operationId":"evaluate_flows_api_automations_flows_evaluate__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Context"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/templates":{"get":{"tags":["Automations & Flows"],"summary":"List Flow Templates","description":"Get pre-built flow templates.","operationId":"list_flow_templates_api_automations_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/automations/templates/{template_id}":{"get":{"tags":["Automations & Flows"],"summary":"Get Flow Template","description":"Get a specific flow template by ID.","operationId":"get_flow_template_api_automations_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/from-template":{"post":{"tags":["Automations & Flows"],"summary":"Create Flow From Template","description":"Create a new flow from a pre-built template.","operationId":"create_flow_from_template_api_automations_flows_from_template_post","parameters":[{"name":"template_id","in":"query","required":true,"schema":{"type":"string","title":"Template Id"}},{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/automations/flows/{flow_id}/clone":{"post":{"tags":["Automations & Flows"],"summary":"Clone Flow","description":"Clone an existing flow.","operationId":"clone_flow_api_automations_flows__flow_id__clone_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/categories/{bot_id}":{"get":{"tags":["Help Center"],"summary":"List Categories","description":"List all categories for a bot's help center.","operationId":"list_categories_api_helpcenter_categories__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/categories":{"post":{"tags":["Help Center"],"summary":"Create Category","description":"Create a help center category.","operationId":"create_category_api_helpcenter_categories_post","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/categories/{category_id}":{"put":{"tags":["Help Center"],"summary":"Update Category","description":"Update a category.","operationId":"update_category_api_helpcenter_categories__category_id__put","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Help Center"],"summary":"Delete Category","description":"Delete a category (articles become uncategorized).","operationId":"delete_category_api_helpcenter_categories__category_id__delete","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/articles/{bot_id}":{"get":{"tags":["Help Center"],"summary":"List Articles","description":"List articles for admin management.","operationId":"list_articles_api_helpcenter_articles__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/articles":{"post":{"tags":["Help Center"],"summary":"Create Article","description":"Create a help center article.","operationId":"create_article_api_helpcenter_articles_post","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/articles/detail/{article_id}":{"get":{"tags":["Help Center"],"summary":"Get Article Admin","description":"Get article detail (admin).","operationId":"get_article_admin_api_helpcenter_articles_detail__article_id__get","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Help Center"],"summary":"Update Article","description":"Update an article.","operationId":"update_article_api_helpcenter_articles_detail__article_id__put","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Help Center"],"summary":"Delete Article","description":"Delete an article.","operationId":"delete_article_api_helpcenter_articles_detail__article_id__delete","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/public/{bot_id}":{"get":{"tags":["Help Center"],"summary":"Public Helpcenter","description":"Public help center: categories + published article counts.","operationId":"public_helpcenter_api_helpcenter_public__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","default":"fr","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/public/{bot_id}/search":{"get":{"tags":["Help Center"],"summary":"Public Search","description":"Public full-text search for articles.","operationId":"public_search_api_helpcenter_public__bot_id__search_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/public/{bot_id}/article/{slug}":{"get":{"tags":["Help Center"],"summary":"Public Article","description":"Get a published article by slug (increments view count).","operationId":"public_article_api_helpcenter_public__bot_id__article__slug__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/public/{bot_id}/article/{article_id}/feedback":{"post":{"tags":["Help Center"],"summary":"Article Feedback","description":"Submit feedback on an article (helpful/not helpful).","operationId":"article_feedback_api_helpcenter_public__bot_id__article__article_id__feedback_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"article_id","in":"path","required":true,"schema":{"type":"string","title":"Article Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleFeedback"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/stats/{bot_id}":{"get":{"tags":["Help Center"],"summary":"Helpcenter Stats","description":"Help center analytics.","operationId":"helpcenter_stats_api_helpcenter_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/suggest/{bot_id}":{"get":{"tags":["Help Center"],"summary":"Auto Suggest Articles","description":"Auto-suggest relevant Help Center articles based on user's live chat input.\nNo auth required (used from chat widget).\nReturns lightweight article suggestions with title, slug, and relevance score.","operationId":"auto_suggest_articles_api_helpcenter_suggest__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/helpcenter/suggest/{bot_id}/by-session":{"get":{"tags":["Help Center"],"summary":"Suggest Articles For Session","description":"Suggest Help Center articles based on a conversation session's recent messages.\nAnalyzes the last few messages to find relevant KB articles.\nNo auth required (used from agent panel).","operationId":"suggest_articles_for_session_api_helpcenter_suggest__bot_id__by_session_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"default":3,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"List Contacts","description":"List contacts with powerful filtering.","operationId":"list_contacts_api_contacts__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"segment_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Segment Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","pattern":"^(last_seen_at|created_at|name|message_count)$","default":"last_seen_at","title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"desc","title":"Sort Dir"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/":{"post":{"tags":["Contacts CRM"],"summary":"Create Contact","description":"Create a contact manually.","operationId":"create_contact_api_contacts__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/detail/{contact_id}":{"get":{"tags":["Contacts CRM"],"summary":"Get Contact","description":"Get contact profile with activity summary.","operationId":"get_contact_api_contacts_detail__contact_id__get","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Contacts CRM"],"summary":"Update Contact","description":"Update a contact.","operationId":"update_contact_api_contacts_detail__contact_id__put","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts CRM"],"summary":"Delete Contact","description":"Delete a contact.","operationId":"delete_contact_api_contacts_detail__contact_id__delete","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/detail/{contact_id}/tag":{"post":{"tags":["Contacts CRM"],"summary":"Add Tag","description":"Add a tag to a contact.","operationId":"add_tag_api_contacts_detail__contact_id__tag_post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"tag","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts CRM"],"summary":"Remove Tag","description":"Remove a tag from a contact.","operationId":"remove_tag_api_contacts_detail__contact_id__tag_delete","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"tag","in":"query","required":true,"schema":{"type":"string","title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/detail/{contact_id}/notes":{"post":{"tags":["Contacts CRM"],"summary":"Add Note","description":"Add a note/activity to the contact's timeline.","operationId":"add_note_api_contacts_detail__contact_id__notes_post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"content","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Content"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/merge":{"post":{"tags":["Contacts CRM"],"summary":"Merge Contacts","description":"Merge two contacts (secondary into primary).","operationId":"merge_contacts_api_contacts_merge_post","parameters":[{"name":"primary_id","in":"query","required":true,"schema":{"type":"string","title":"Primary Id"}},{"name":"secondary_id","in":"query","required":true,"schema":{"type":"string","title":"Secondary Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/segments/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"List Segments","description":"List contact segments.","operationId":"list_segments_api_contacts_segments__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/segments":{"post":{"tags":["Contacts CRM"],"summary":"Create Segment","description":"Create a contact segment.","operationId":"create_segment_api_contacts_segments_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__contacts__SegmentCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/segments/{segment_id}":{"delete":{"tags":["Contacts CRM"],"summary":"Delete Segment","description":"Delete a segment.","operationId":"delete_segment_api_contacts_segments__segment_id__delete","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/companies/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"List Companies","description":"List companies.","operationId":"list_companies_api_contacts_companies__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/companies":{"post":{"tags":["Contacts CRM"],"summary":"Create Company","description":"Create a company.","operationId":"create_company_api_contacts_companies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/companies/{company_id}":{"put":{"tags":["Contacts CRM"],"summary":"Update Company","description":"Update a company.","operationId":"update_company_api_contacts_companies__company_id__put","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contacts CRM"],"summary":"Delete Company","description":"Delete a company.","operationId":"delete_company_api_contacts_companies__company_id__delete","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/leads/{lead_id}/stage":{"patch":{"tags":["Contacts CRM"],"summary":"Update Lead Stage","description":"Move a lead to a different pipeline stage.","operationId":"update_lead_stage_api_contacts_leads__lead_id__stage_patch","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadStageUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/leads/pipeline/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"Get Lead Pipeline","description":"Get lead pipeline summary with counts per stage.","operationId":"get_lead_pipeline_api_contacts_leads_pipeline__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/stats/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"Contact Stats","description":"Contact analytics for a bot.","operationId":"contact_stats_api_contacts_stats__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/export/{bot_id}":{"get":{"tags":["Contacts CRM"],"summary":"Export Contacts","description":"Export all contacts for a bot as CSV or JSON download.","operationId":"export_contacts_api_contacts_export__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json)$","default":"csv","title":"Format"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts/import/{bot_id}":{"post":{"tags":["Contacts CRM"],"summary":"Import Contacts","description":"Import contacts from CSV-like data or JSON array.\n\nBody format:\n{\n  \"contacts\": [\n    {\"name\": \"...\", \"email\": \"...\", \"phone\": \"...\", \"company\": \"...\", \"channel\": \"web\", \"tags\": [\"vip\"], \"notes\": \"...\"},\n    ...\n  ],\n  \"update_existing\": true  // if contact with same email/phone exists, update it\n}","operationId":"import_contacts_api_contacts_import__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/presence/heartbeat":{"post":{"tags":["Presence"],"summary":"Heartbeat","description":"Agent sends heartbeat to maintain online status. Called every 30s from dashboard.","operationId":"heartbeat_api_presence_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PresenceUpdate"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/presence/team":{"get":{"tags":["Presence"],"summary":"Team Presence","description":"Get online status of team members the user can see (same team only).","operationId":"team_presence_api_presence_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/presence/status":{"put":{"tags":["Presence"],"summary":"Update My Status","description":"Manually set your online status.","operationId":"update_my_status_api_presence_status_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresenceUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/presence/available":{"get":{"tags":["Presence"],"summary":"Available Agents","description":"Get list of agents currently online and available for assignment.","operationId":"available_agents_api_presence_available_get","parameters":[{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/presence/sessions/{session_id}/activity":{"post":{"tags":["Presence"],"summary":"Update Session Activity","description":"Report agent activity on a session (typing, viewing, replying).\nUsed to detect collisions — multiple agents on same session.\nDashboard polls every 3–5 seconds when a session is open.","operationId":"update_session_activity_api_presence_sessions__session_id__activity_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SessionActivityUpdate"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Presence"],"summary":"Get Session Activity","description":"Check who is currently active on a session (collision check).\nReturns list of agents currently typing/viewing this session.","operationId":"get_session_activity_api_presence_sessions__session_id__activity_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Presence"],"summary":"Leave Session","description":"Signal that agent left a session (stopped viewing/typing).","operationId":"leave_session_api_presence_sessions__session_id__activity_delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/platform/status":{"get":{"tags":["Platform"],"summary":"Public Status","description":"Public status endpoint — no auth required. Shows system health.","operationId":"public_status_api_platform_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/platform/changelog":{"get":{"tags":["Platform"],"summary":"Get Changelog","description":"Get recent changelog entries.","operationId":"get_changelog_api_platform_changelog_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/platform/changelog/latest":{"get":{"tags":["Platform"],"summary":"Get Latest Changelog","description":"Get latest version info for 'What's New' banner.","operationId":"get_latest_changelog_api_platform_changelog_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/platform/gdpr/export":{"get":{"tags":["Platform"],"summary":"Gdpr Data Export","description":"Export all personal data for GDPR compliance (Article 20 - Right to portability).","operationId":"gdpr_data_export_api_platform_gdpr_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/platform/gdpr/delete":{"delete":{"tags":["Platform"],"summary":"Gdpr Delete Data","description":"Request complete data deletion (GDPR Article 17 - Right to erasure).\nThis queues the deletion — actual deletion is immediate for own data.","operationId":"gdpr_delete_data_api_platform_gdpr_delete_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"List tasks for a bot.","operationId":"list_tasks_api_tasks_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"task_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tasks"],"summary":"Create Task","description":"Create a new task or appointment.","operationId":"create_task_api_tasks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/{task_id}":{"put":{"tags":["tasks"],"summary":"Update Task","description":"Update a task.","operationId":"update_task_api_tasks__task_id__put","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","description":"Delete a task.","operationId":"delete_task_api_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/stats":{"get":{"tags":["tasks"],"summary":"Task Stats","description":"Get task statistics for a bot.","operationId":"task_stats_api_tasks_stats_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/due-soon":{"get":{"tags":["tasks"],"summary":"Get Due Soon Tasks","description":"Get tasks whose due date is within the next N hours (default: 24h).\nAlso includes overdue tasks (past deadline but not completed).","operationId":"get_due_soon_tasks_api_tasks_due_soon_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/check-reminders/{bot_id}":{"post":{"tags":["tasks"],"summary":"Check And Send Reminders","description":"Check due tasks and send reminder notifications to assigned agents.\nCall this periodically (e.g. every hour via cron/webhook).","operationId":"check_and_send_reminders_api_tasks_check_reminders__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/calendar":{"get":{"tags":["tasks"],"summary":"Get Tasks Calendar","description":"Get tasks/appointments within a date range (for calendar view).","operationId":"get_tasks_calendar_api_tasks_calendar_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","description":"ISO format start date","title":"Start Date"},"description":"ISO format start date"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","description":"ISO format end date","title":"End Date"},"description":"ISO format end date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/process-recurring/{bot_id}":{"post":{"tags":["tasks"],"summary":"Process Recurring Tasks","description":"Process completed recurring tasks: clone them with the next due date.\nCall via cron or webhook periodically.","operationId":"process_recurring_tasks_api_tasks_process_recurring__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tasks/bulk":{"post":{"tags":["tasks"],"summary":"Bulk Create Tasks","description":"Bulk create up to 100 tasks.","operationId":"bulk_create_tasks_api_tasks_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTaskInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/realtime/config":{"get":{"tags":["Realtime"],"summary":"Realtime Config","description":"Return Supabase Realtime config for client-side subscription.\nThe anon key is safe to expose — RLS protects all data.\nWidget users get minimal config (no auth needed for public channels).","operationId":"realtime_config_api_realtime_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/realtime/typing/{session_id}":{"post":{"tags":["Realtime"],"summary":"Send Typing Indicator","description":"Record a typing event — clients poll or use Realtime to display.\nWorks for both widget visitors (no auth) and agents (auth).","operationId":"send_typing_indicator_api_realtime_typing__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/realtime/poll/{session_id}":{"get":{"tags":["Realtime"],"summary":"Poll Messages","description":"Poll for new messages since a given timestamp.\nFallback for clients that can't use Supabase Realtime.\nReturns messages newer than 'after' timestamp.\nRequires valid session_id (UUID format) — session acts as capability token.","operationId":"poll_messages_api_realtime_poll__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"after","in":"query","required":false,"schema":{"type":"string","default":"","title":"After"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/email/webhook/{channel_id}":{"post":{"tags":["email-channel"],"summary":"Email Webhook","description":"Receive inbound emails.\n\nSupports multiple formats:\n1. Resend inbound webhook (JSON with from, to, subject, text, html, headers)\n2. Generic JSON (from, subject, text/body, message_id)\n3. Form-encoded (for SMTP pipe/forwarding services)","operationId":"email_webhook_api_channels_email_webhook__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["email-channel"],"summary":"Email Webhook Verify","description":"Health check / verification endpoint for email webhook.\nSome email forwarding services ping the URL to verify it's active.","operationId":"email_webhook_verify_api_channels_email_webhook__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/email/templates/{bot_id}":{"get":{"tags":["email-channel"],"summary":"List Email Templates","description":"List email templates for a bot.","operationId":"list_email_templates_api_channels_email_templates__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["email-channel"],"summary":"Create Email Template","description":"Create an email HTML template for branded replies.","operationId":"create_email_template_api_channels_email_templates__bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/email/templates/{bot_id}/{template_id}":{"put":{"tags":["email-channel"],"summary":"Update Email Template","description":"Update an email template.","operationId":"update_email_template_api_channels_email_templates__bot_id___template_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailTemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["email-channel"],"summary":"Delete Email Template","description":"Delete an email template.","operationId":"delete_email_template_api_channels_email_templates__bot_id___template_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/channels/email/templates/{bot_id}/{template_id}/preview":{"post":{"tags":["email-channel"],"summary":"Preview Email Template","description":"Preview a rendered email template with sample data.","operationId":"preview_email_template_api_channels_email_templates__bot_id___template_id__preview_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/bots/{bot_id}/memories":{"get":{"tags":["Memory"],"summary":"List Memories","description":"List memories for a bot, with optional filters.","operationId":"list_memories_api_memory_bots__bot_id__memories_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"contact_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Contact Id"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Memory"],"summary":"Create Memory","description":"Manually add a memory entry.","operationId":"create_memory_api_memory_bots__bot_id__memories_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/bots/{bot_id}/memories/stats":{"get":{"tags":["Memory"],"summary":"Memory Stats","description":"Get memory statistics for a bot.","operationId":"memory_stats_api_memory_bots__bot_id__memories_stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/memories/{memory_id}":{"put":{"tags":["Memory"],"summary":"Update Memory","description":"Update a memory entry.","operationId":"update_memory_api_memory_memories__memory_id__put","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Memory"],"summary":"Delete Memory","description":"Delete a memory entry.","operationId":"delete_memory_api_memory_memories__memory_id__delete","parameters":[{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/bots/{bot_id}/memories/recall":{"post":{"tags":["Memory"],"summary":"Recall Memories","description":"Test memory recall — search for relevant memories semantically.","operationId":"recall_memories_api_memory_bots__bot_id__memories_recall_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryRecallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/bots/{bot_id}/memories/import":{"post":{"tags":["Memory"],"summary":"Import Memories","description":"Bulk import memories.","operationId":"import_memories_api_memory_bots__bot_id__memories_import_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryImportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/memory/bots/{bot_id}/memories/clear":{"delete":{"tags":["Memory"],"summary":"Clear Memories","description":"Clear all memories for a bot (or a specific contact).","operationId":"clear_memories_api_memory_bots__bot_id__memories_clear_delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"contact_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills":{"get":{"tags":["Skills Marketplace"],"summary":"Browse Skills","description":"Browse the skills marketplace.","operationId":"browse_skills_api_skills_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"official_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Official Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Skills Marketplace"],"summary":"Create Skill","description":"Create a custom skill.","operationId":"create_skill_api_skills_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/categories":{"get":{"tags":["Skills Marketplace"],"summary":"Get Categories","description":"Get skill categories.","operationId":"get_categories_api_skills_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/skills/{skill_id}":{"get":{"tags":["Skills Marketplace"],"summary":"Get Skill","description":"Get full skill details.","operationId":"get_skill_api_skills__skill_id__get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Skills Marketplace"],"summary":"Update Skill","description":"Update a custom skill.","operationId":"update_skill_api_skills__skill_id__put","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/bots/{bot_id}/installed":{"get":{"tags":["Skills Marketplace"],"summary":"Get Bot Skills","description":"Get all skills installed on a bot.","operationId":"get_bot_skills_api_skills_bots__bot_id__installed_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Enabled Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/bots/{bot_id}/install":{"post":{"tags":["Skills Marketplace"],"summary":"Install Skill","description":"Install a skill on a bot.","operationId":"install_skill_api_skills_bots__bot_id__install_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/bots/{bot_id}/uninstall":{"post":{"tags":["Skills Marketplace"],"summary":"Uninstall Skill","description":"Uninstall a skill from a bot.","operationId":"uninstall_skill_api_skills_bots__bot_id__uninstall_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillInstall"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/bots/{bot_id}/skills/{skill_id}/toggle":{"put":{"tags":["Skills Marketplace"],"summary":"Toggle Skill","operationId":"toggle_skill_api_skills_bots__bot_id__skills__skill_id__toggle_put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillToggle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{skill_id}/versions":{"get":{"tags":["Skills Marketplace"],"summary":"Get Skill Versions","description":"Get version history for a skill.","operationId":"get_skill_versions_api_skills__skill_id__versions_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{skill_id}/publish-version":{"post":{"tags":["Skills Marketplace"],"summary":"Publish Skill Version","description":"Publish a new version of a skill. Saves version snapshot to history.","operationId":"publish_skill_version_api_skills__skill_id__publish_version_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{skill_id}/analytics":{"get":{"tags":["Skills Marketplace"],"summary":"Get Skill Analytics","description":"Get analytics for a skill: install count, usage stats, ratings.","operationId":"get_skill_analytics_api_skills__skill_id__analytics_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{skill_id}/rate":{"post":{"tags":["Skills Marketplace"],"summary":"Rate Skill","description":"Rate and review a skill (1-5 stars).","operationId":"rate_skill_api_skills__skill_id__rate_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRating"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{skill_id}/clone":{"post":{"tags":["Skills Marketplace"],"summary":"Clone Skill","description":"Clone a skill for customization.","operationId":"clone_skill_api_skills__skill_id__clone_post","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/{skill_id}/export":{"get":{"tags":["Skills Marketplace"],"summary":"Export Skill","description":"Export a skill definition as JSON (for import into another workspace).","operationId":"export_skill_api_skills__skill_id__export_get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/import":{"post":{"tags":["Skills Marketplace"],"summary":"Import Skill","description":"Import a skill from a JSON definition.","operationId":"import_skill_api_skills_import_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillImportInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/skills/bots/{bot_id}/copy-from/{source_bot_id}":{"post":{"tags":["Skills Marketplace"],"summary":"Copy Skills From Bot","description":"Copy all installed skills from source_bot to target bot.","operationId":"copy_skills_from_bot_api_skills_bots__bot_id__copy_from__source_bot_id__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_bot_id","in":"path","required":true,"schema":{"type":"string","title":"Source Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/templates/list":{"get":{"tags":["Flows"],"summary":"List Flow Templates","description":"List pre-built flow templates.","operationId":"list_flow_templates_api_flows_templates_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/flows/":{"post":{"tags":["Flows"],"summary":"Create Flow","description":"Create a new conversation flow.","operationId":"create_flow_api_flows__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{bot_id}":{"get":{"tags":["Flows"],"summary":"List Flows","description":"List conversation flows for a bot.","operationId":"list_flows_api_flows__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/detail/{flow_id}":{"get":{"tags":["Flows"],"summary":"Get Flow","description":"Get flow details with full node/edge graph.","operationId":"get_flow_api_flows_detail__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}":{"put":{"tags":["Flows"],"summary":"Update Flow","description":"Update a flow graph and/or metadata.","operationId":"update_flow_api_flows__flow_id__put","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Flows"],"summary":"Delete Flow","description":"Delete a flow.","operationId":"delete_flow_api_flows__flow_id__delete","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}/publish":{"post":{"tags":["Flows"],"summary":"Publish Flow","description":"Publish a flow as the active version for the bot.","operationId":"publish_flow_api_flows__flow_id__publish_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}/test":{"post":{"tags":["Flows"],"summary":"Test Flow","description":"Dry-run a flow with simulated input. Returns execution trace.","operationId":"test_flow_api_flows__flow_id__test_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}/versions":{"get":{"tags":["Flows"],"summary":"List Flow Versions","description":"Get version history of a flow.","operationId":"list_flow_versions_api_flows__flow_id__versions_get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}/clone":{"post":{"tags":["Flows"],"summary":"Clone Flow","description":"Clone a flow.","operationId":"clone_flow_api_flows__flow_id__clone_post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{bot_id}/from-template/{slug}":{"post":{"tags":["Flows"],"summary":"Create From Template","description":"Create a flow from a template.","operationId":"create_from_template_api_flows__bot_id__from_template__slug__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/policies":{"post":{"tags":["SLA"],"summary":"Create Sla Policy","description":"Create an SLA policy.","operationId":"create_sla_policy_api_sla_policies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SLAPolicyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/policies/{bot_id}":{"get":{"tags":["SLA"],"summary":"List Sla Policies","description":"List SLA policies for a bot.","operationId":"list_sla_policies_api_sla_policies__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/policies/detail/{policy_id}":{"get":{"tags":["SLA"],"summary":"Get Sla Policy","description":"Get SLA policy details.","operationId":"get_sla_policy_api_sla_policies_detail__policy_id__get","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/policies/{policy_id}":{"put":{"tags":["SLA"],"summary":"Update Sla Policy","description":"Update an SLA policy.","operationId":"update_sla_policy_api_sla_policies__policy_id__put","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SLAPolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["SLA"],"summary":"Delete Sla Policy","description":"Delete an SLA policy.","operationId":"delete_sla_policy_api_sla_policies__policy_id__delete","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/templates":{"get":{"tags":["SLA"],"summary":"List Sla Templates","description":"List pre-built SLA templates.","operationId":"list_sla_templates_api_sla_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/sla/policies/{bot_id}/from-template/{slug}":{"post":{"tags":["SLA"],"summary":"Create Sla From Template","description":"Create an SLA policy from a template.","operationId":"create_sla_from_template_api_sla_policies__bot_id__from_template__slug__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/deadlines/compute":{"post":{"tags":["SLA"],"summary":"Compute Deadline","description":"Compute SLA deadlines for a ticket/conversation.","operationId":"compute_deadline_api_sla_deadlines_compute_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/compliance/{bot_id}":{"get":{"tags":["SLA"],"summary":"Sla Compliance","description":"Get SLA compliance dashboard data for a bot.","operationId":"sla_compliance_api_sla_compliance__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sla/breaches/{bot_id}":{"get":{"tags":["SLA"],"summary":"List Breaches","description":"List SLA breach events for a bot.","operationId":"list_breaches_api_sla_breaches__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"breach_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Breach Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/analyze":{"post":{"tags":["Intelligence"],"summary":"Analyze Conversation","description":"Analyze a conversation for topics, sentiment, intents.","operationId":"analyze_conversation_api_intelligence_analyze_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/topics/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Topic Clusters","description":"Get topic clusters with trends for a bot.","operationId":"get_topic_clusters_api_intelligence_topics__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/sentiment/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Sentiment Overview","description":"Get sentiment distribution for a bot.","operationId":"get_sentiment_overview_api_intelligence_sentiment__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/intents/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Intent Distribution","description":"Get intent distribution for a bot.","operationId":"get_intent_distribution_api_intelligence_intents__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/unanswered/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Unanswered Questions","description":"Get unanswered questions that could fill KB gaps.","operationId":"get_unanswered_questions_api_intelligence_unanswered__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/auto-label":{"post":{"tags":["Intelligence"],"summary":"Auto Label Conversations","description":"Auto-label conversations with tags based on content analysis.","operationId":"auto_label_conversations_api_intelligence_auto_label_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/intelligence/trends/{bot_id}":{"get":{"tags":["Intelligence"],"summary":"Get Conversation Trends","description":"Get conversation intelligence trends over time.","operationId":"get_conversation_trends_api_intelligence_trends__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/routing/{bot_id}/rules":{"post":{"tags":["Routing"],"summary":"Create Routing Rule","description":"Create a routing rule for a bot.","operationId":"create_routing_rule_api_routing__bot_id__rules_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__routing__RoutingRule"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Routing"],"summary":"List Routing Rules","description":"List routing rules for a bot, sorted by priority.","operationId":"list_routing_rules_api_routing__bot_id__rules_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/routing/rules/{rule_id}":{"put":{"tags":["Routing"],"summary":"Update Routing Rule","description":"Update a routing rule.","operationId":"update_routing_rule_api_routing_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Routing"],"summary":"Delete Routing Rule","description":"Delete a routing rule.","operationId":"delete_routing_rule_api_routing_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/routing/agents/capacity":{"get":{"tags":["Routing"],"summary":"List Agent Capacities","description":"List all agent capacities.","operationId":"list_agent_capacities_api_routing_agents_capacity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Routing"],"summary":"Set Agent Capacity","description":"Set or update agent capacity and skills.","operationId":"set_agent_capacity_api_routing_agents_capacity_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCapacity"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/routing/agents/{agent_id}/capacity":{"get":{"tags":["Routing"],"summary":"Get Agent Capacity","description":"Get a specific agent's capacity.","operationId":"get_agent_capacity_api_routing_agents__agent_id__capacity_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/routing/{bot_id}/simulate":{"post":{"tags":["Routing"],"summary":"Simulate Routing","description":"Simulate routing with given context. Returns which agent would be selected.","operationId":"simulate_routing_api_routing__bot_id__simulate_post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/routing/strategies":{"get":{"tags":["Routing"],"summary":"List Strategies","description":"List available routing strategies.","operationId":"list_strategies_api_routing_strategies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/audit/logs":{"post":{"tags":["Audit"],"summary":"Create Audit Log","description":"Record a new audit log entry.","operationId":"create_audit_log_api_audit_logs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Audit"],"summary":"List Audit Logs","description":"List/search/filter audit log entries with pagination.","operationId":"list_audit_logs_api_audit_logs_get","parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/logs/export":{"get":{"tags":["Audit"],"summary":"Export Audit Logs","description":"Export audit trail as CSV or JSON.","operationId":"export_audit_logs_api_audit_logs_export_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/logs/{log_id}":{"get":{"tags":["Audit"],"summary":"Get Audit Log","description":"Get a single audit log entry by ID.","operationId":"get_audit_log_api_audit_logs__log_id__get","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audit/stats":{"get":{"tags":["Audit"],"summary":"Audit Stats","description":"Get audit log summary statistics.","operationId":"audit_stats_api_audit_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/testing/scenarios":{"post":{"tags":["Bot Testing"],"summary":"Create Scenario","description":"Create a test scenario with steps.","operationId":"create_scenario_api_testing_scenarios_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/testing/scenarios/{bot_id}":{"get":{"tags":["Bot Testing"],"summary":"List Scenarios","description":"List all test scenarios for a bot.","operationId":"list_scenarios_api_testing_scenarios__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/testing/scenarios/{bot_id}/{scenario_id}":{"get":{"tags":["Bot Testing"],"summary":"Get Scenario","description":"Get a single test scenario.","operationId":"get_scenario_api_testing_scenarios__bot_id___scenario_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bot Testing"],"summary":"Update Scenario","description":"Update a test scenario.","operationId":"update_scenario_api_testing_scenarios__bot_id___scenario_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bot Testing"],"summary":"Delete Scenario","description":"Delete a test scenario.","operationId":"delete_scenario_api_testing_scenarios__bot_id___scenario_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/testing/run/{scenario_id}":{"post":{"tags":["Bot Testing"],"summary":"Run Scenario","description":"Execute a scenario against a bot (simulation mode).","operationId":"run_scenario_api_testing_run__scenario_id__post","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/testing/runs/{bot_id}":{"get":{"tags":["Bot Testing"],"summary":"List Runs","description":"List past test runs for a bot with pagination.","operationId":"list_runs_api_testing_runs__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/testing/runs/{bot_id}/{run_id}":{"get":{"tags":["Bot Testing"],"summary":"Get Run","description":"Get details of a specific test run.","operationId":"get_run_api_testing_runs__bot_id___run_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/sources":{"post":{"tags":["Knowledge Base"],"summary":"Add Source","description":"Add a KB source (URL, file, or API feed).","operationId":"add_source_api_kb_sources_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBSourceCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/sources/{bot_id}/stats":{"get":{"tags":["Knowledge Base"],"summary":"Source Stats","description":"Get KB source stats for a bot.","operationId":"source_stats_api_kb_sources__bot_id__stats_get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/sources/{bot_id}":{"get":{"tags":["Knowledge Base"],"summary":"List Sources","description":"List all KB sources for a bot with sync status and chunk counts.","operationId":"list_sources_api_kb_sources__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(pending|syncing|synced|error)$"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/sources/{bot_id}/{source_id}":{"get":{"tags":["Knowledge Base"],"summary":"Get Source","description":"Get details of a specific KB source.","operationId":"get_source_api_kb_sources__bot_id___source_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Knowledge Base"],"summary":"Update Source","description":"Update a KB source configuration.","operationId":"update_source_api_kb_sources__bot_id___source_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBSourceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Knowledge Base"],"summary":"Delete Source","description":"Remove a KB source and its indexed chunks.","operationId":"delete_source_api_kb_sources__bot_id___source_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kb/sources/{source_id}/sync":{"post":{"tags":["Knowledge Base"],"summary":"Sync Source","description":"Trigger re-sync/re-crawl of a KB source.","operationId":"sync_source_api_kb_sources__source_id__sync_post","parameters":[{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/macros/templates":{"get":{"tags":["Macros"],"summary":"List Templates","description":"List pre-built macro templates.","operationId":"list_templates_api_macros_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/macros/":{"post":{"tags":["Macros"],"summary":"Create Macro","description":"Create a macro with action steps.","operationId":"create_macro_api_macros__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MacroCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/macros/{bot_id}":{"get":{"tags":["Macros"],"summary":"List Macros","description":"List macros for a bot.","operationId":"list_macros_api_macros__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/macros/{bot_id}/{macro_id}":{"get":{"tags":["Macros"],"summary":"Get Macro","description":"Get details of a specific macro.","operationId":"get_macro_api_macros__bot_id___macro_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Macros"],"summary":"Update Macro","description":"Update macro steps or name.","operationId":"update_macro_api_macros__bot_id___macro_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MacroUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Macros"],"summary":"Delete Macro","description":"Delete a macro.","operationId":"delete_macro_api_macros__bot_id___macro_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/macros/{macro_id}/execute":{"post":{"tags":["Macros"],"summary":"Execute Macro","description":"Execute a macro on a conversation (applies all steps in order).","operationId":"execute_macro_api_macros__macro_id__execute_post","parameters":[{"name":"macro_id","in":"path","required":true,"schema":{"type":"string","title":"Macro Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MacroExecute"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/api-keys/":{"get":{"tags":["API Keys"],"summary":"List Api Keys","description":"List all API keys for the current user (secrets masked).","operationId":"list_api_keys_api_api_keys__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["API Keys"],"summary":"Create Api Key","description":"Create a new API key. The raw key is returned ONCE — store it securely.","operationId":"create_api_key_api_api_keys__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/api-keys/{key_id}":{"get":{"tags":["API Keys"],"summary":"Get Api Key","description":"Get API key details (secret never returned).","operationId":"get_api_key_api_api_keys__key_id__get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["API Keys"],"summary":"Update Api Key","description":"Update API key name, scopes, IP restrictions, or expiry.","operationId":"update_api_key_api_api_keys__key_id__put","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["API Keys"],"summary":"Delete Api Key","description":"Revoke/delete an API key permanently.","operationId":"delete_api_key_api_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/api-keys/{key_id}/rotate":{"post":{"tags":["API Keys"],"summary":"Rotate Api Key","description":"Rotate key — invalidate old secret, issue new one.","operationId":"rotate_api_key_api_api_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhook-logs/":{"post":{"tags":["Webhook Logs"],"summary":"Create Log","description":"Record a webhook delivery log entry.","operationId":"create_log_api_webhook_logs__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookLogCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Webhook Logs"],"summary":"List Logs","description":"List delivery logs with filters.","operationId":"list_logs_api_webhook_logs__get","parameters":[{"name":"webhook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(success|failed)$"},{"type":"null"}],"title":"Status"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhook-logs/stats":{"get":{"tags":["Webhook Logs"],"summary":"Delivery Stats","description":"Delivery stats: success rate, avg latency, top failures.","operationId":"delivery_stats_api_webhook_logs_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/webhook-logs/{log_id}":{"get":{"tags":["Webhook Logs"],"summary":"Get Log","description":"Get full delivery detail.","operationId":"get_log_api_webhook_logs__log_id__get","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhook-logs/{log_id}/retry":{"post":{"tags":["Webhook Logs"],"summary":"Retry Delivery","description":"Manually retry a failed delivery.","operationId":"retry_delivery_api_webhook_logs__log_id__retry_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhook-logs/purge":{"delete":{"tags":["Webhook Logs"],"summary":"Purge Logs","description":"Purge logs older than N days (admin only).","operationId":"purge_logs_api_webhook_logs_purge_delete","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/segments/":{"post":{"tags":["Segments"],"summary":"Create Segment","description":"Create a segment (dynamic with rules, or static with contact IDs).","operationId":"create_segment_api_segments__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__segments__SegmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Segments"],"summary":"List Segments","description":"List segments with member counts.","operationId":"list_segments_api_segments__get","parameters":[{"name":"bot_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/segments/{segment_id}":{"get":{"tags":["Segments"],"summary":"Get Segment","description":"Get segment detail + computed member count.","operationId":"get_segment_api_segments__segment_id__get","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Segments"],"summary":"Update Segment","description":"Update segment rules or name.","operationId":"update_segment_api_segments__segment_id__put","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Segments"],"summary":"Delete Segment","description":"Delete a segment.","operationId":"delete_segment_api_segments__segment_id__delete","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/segments/{segment_id}/members":{"get":{"tags":["Segments"],"summary":"Get Segment Members","description":"Paginated list of contacts matching segment rules.","operationId":"get_segment_members_api_segments__segment_id__members_get","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversation-ops/merge":{"post":{"tags":["Conversation Ops"],"summary":"Merge Conversations","description":"Merge 2+ conversations into one (pick primary, append others).","operationId":"merge_conversations_api_conversation_ops_merge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversation-ops/split":{"post":{"tags":["Conversation Ops"],"summary":"Split Conversation","description":"Split a conversation at a specific message into two threads.","operationId":"split_conversation_api_conversation_ops_split_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversation-ops/history":{"get":{"tags":["Conversation Ops"],"summary":"List Operations","description":"List all merge/split operations with audit trail.","operationId":"list_operations_api_conversation_ops_history_get","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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversation-ops/history/{operation_id}":{"get":{"tags":["Conversation Ops"],"summary":"Get Operation","description":"Get detail of a specific merge/split operation.","operationId":"get_operation_api_conversation_ops_history__operation_id__get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversation-ops/undo/{operation_id}":{"post":{"tags":["Conversation Ops"],"summary":"Undo Operation","description":"Undo a merge/split operation (within time window).","operationId":"undo_operation_api_conversation_ops_undo__operation_id__post","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/proactive/rules":{"post":{"tags":["Proactive Messaging"],"summary":"Create Rule","description":"Create a proactive messaging rule.","operationId":"create_rule_api_proactive_rules_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Proactive Messaging"],"summary":"List Rules","description":"List proactive rules for a bot.","operationId":"list_rules_api_proactive_rules_get","parameters":[{"name":"bot_id","in":"query","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/proactive/rules/{rule_id}":{"get":{"tags":["Proactive Messaging"],"summary":"Get Rule","description":"Get rule detail with delivery stats.","operationId":"get_rule_api_proactive_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Proactive Messaging"],"summary":"Update Rule","description":"Update rule conditions, message, or status.","operationId":"update_rule_api_proactive_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProactiveRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Proactive Messaging"],"summary":"Delete Rule","description":"Delete a proactive rule.","operationId":"delete_rule_api_proactive_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/proactive/rules/{rule_id}/test":{"post":{"tags":["Proactive Messaging"],"summary":"Test Fire Rule","description":"Test-fire a rule against a fake visitor session to preview behavior.","operationId":"test_fire_rule_api_proactive_rules__rule_id__test_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/security-rules/validate":{"post":{"tags":["Security Rules"],"summary":"Validate Ip","description":"Test an IP/country against current ruleset (dry-run check).","operationId":"validate_ip_api_security_rules_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPValidateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/security-rules/":{"post":{"tags":["Security Rules"],"summary":"Create Security Rule","description":"Create a security rule.","operationId":"create_security_rule_api_security_rules__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Security Rules"],"summary":"List Security Rules","description":"List security rules, optionally filtered by type.","operationId":"list_security_rules_api_security_rules__get","parameters":[{"name":"rule_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/security-rules/{rule_id}":{"get":{"tags":["Security Rules"],"summary":"Get Security Rule","description":"Get a security rule by ID.","operationId":"get_security_rule_api_security_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Security Rules"],"summary":"Update Security Rule","description":"Update a security rule.","operationId":"update_security_rule_api_security_rules__rule_id__put","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Security Rules"],"summary":"Delete Security Rule","description":"Delete a security rule.","operationId":"delete_security_rule_api_security_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/summary":{"get":{"tags":["Usage & Quotas"],"summary":"Usage Summary","description":"Current-period usage summary.","operationId":"usage_summary_api_usage_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/usage/history":{"get":{"tags":["Usage & Quotas"],"summary":"Usage History","description":"Historical usage over past N periods.","operationId":"usage_history_api_usage_history_get","parameters":[{"name":"periods","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"default":6,"title":"Periods"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/quotas":{"get":{"tags":["Usage & Quotas"],"summary":"Get Quotas","description":"Get current plan quotas/limits.","operationId":"get_quotas_api_usage_quotas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/usage/quotas/overrides":{"put":{"tags":["Usage & Quotas"],"summary":"Override Quotas","description":"Admin-only: override quotas for a user (custom enterprise limits).","operationId":"override_quotas_api_usage_quotas_overrides_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaOverride"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/record":{"post":{"tags":["Usage & Quotas"],"summary":"Record Usage Event","description":"Record a usage event.","operationId":"record_usage_event_api_usage_record_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEvent"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/usage/alerts":{"get":{"tags":["Usage & Quotas"],"summary":"Usage Alerts","description":"List overage/threshold alerts for current user.","operationId":"usage_alerts_api_usage_alerts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/usage/nudges":{"get":{"tags":["Usage & Quotas"],"summary":"Get Nudges","description":"Get contextual upsell nudges based on current usage and plan.","operationId":"get_nudges_api_usage_nudges_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/usage/nudges/{nudge_id}/dismiss":{"post":{"tags":["Usage & Quotas"],"summary":"Dismiss Nudge","description":"Dismiss a nudge so it doesn't show again.","operationId":"dismiss_nudge_api_usage_nudges__nudge_id__dismiss_post","parameters":[{"name":"nudge_id","in":"path","required":true,"schema":{"type":"string","title":"Nudge Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot-personas/":{"get":{"tags":["Bot Personas"],"summary":"List Personas","description":"List all persona profiles for current user.","operationId":"list_personas_api_bot_personas__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Bot Personas"],"summary":"Create Persona","description":"Create a persona profile.","operationId":"create_persona_api_bot_personas__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot-personas/{persona_id}":{"get":{"tags":["Bot Personas"],"summary":"Get Persona","description":"Get persona details.","operationId":"get_persona_api_bot_personas__persona_id__get","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bot Personas"],"summary":"Update Persona","description":"Update persona settings.","operationId":"update_persona_api_bot_personas__persona_id__put","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bot Personas"],"summary":"Delete Persona","description":"Delete a persona.","operationId":"delete_persona_api_bot_personas__persona_id__delete","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot-personas/{persona_id}/attach/{bot_id}":{"post":{"tags":["Bot Personas"],"summary":"Attach Persona To Bot","description":"Attach persona to a bot.","operationId":"attach_persona_to_bot_api_bot_personas__persona_id__attach__bot_id__post","parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","title":"Persona Id"}},{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events/types":{"get":{"tags":["Events"],"summary":"List Event Types","description":"List valid event types.","operationId":"list_event_types_api_events_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/events/batch":{"post":{"tags":["Events"],"summary":"Batch Track","description":"Track multiple events at once.","operationId":"batch_track_api_events_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchEventCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events/":{"post":{"tags":["Events"],"summary":"Track Event","description":"Track a single event.","operationId":"track_event_api_events__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Events"],"summary":"List Events","description":"List tracked events with optional filters.","operationId":"list_events_api_events__get","parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/events/{event_id}":{"get":{"tags":["Events"],"summary":"Get Event","description":"Get single event detail.","operationId":"get_event_api_events__event_id__get","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Events"],"summary":"Delete Event","description":"Delete an event.","operationId":"delete_event_api_events__event_id__delete","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compliance/requests":{"post":{"tags":["Compliance"],"summary":"Create Dsr","description":"Create a Data Subject Request.","operationId":"create_dsr_api_compliance_requests_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DSRCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Compliance"],"summary":"List Dsrs","description":"List Data Subject Requests.","operationId":"list_dsrs_api_compliance_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"request_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compliance/requests/{dsr_id}":{"get":{"tags":["Compliance"],"summary":"Get Dsr","description":"Get DSR detail.","operationId":"get_dsr_api_compliance_requests__dsr_id__get","parameters":[{"name":"dsr_id","in":"path","required":true,"schema":{"type":"string","title":"Dsr Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Compliance"],"summary":"Update Dsr Status","description":"Update DSR status.","operationId":"update_dsr_status_api_compliance_requests__dsr_id__patch","parameters":[{"name":"dsr_id","in":"path","required":true,"schema":{"type":"string","title":"Dsr Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DSRStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compliance/requests/{dsr_id}/export":{"get":{"tags":["Compliance"],"summary":"Export Dsr Data","description":"Export data for a DSR (access/portability).","operationId":"export_dsr_data_api_compliance_requests__dsr_id__export_get","parameters":[{"name":"dsr_id","in":"path","required":true,"schema":{"type":"string","title":"Dsr Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/compliance/consent/{contact_id}":{"post":{"tags":["Compliance"],"summary":"Update Consent","description":"Track or update consent for a contact.","operationId":"update_consent_api_compliance_consent__contact_id__post","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Compliance"],"summary":"Get Consent","description":"Get all consent records for a contact.","operationId":"get_consent_api_compliance_consent__contact_id__get","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/exports/":{"post":{"tags":["Exports"],"summary":"Create Export","description":"Generate and download a data export.\nReturns the file directly as a streaming response.","operationId":"create_export_api_exports__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/exports/history":{"get":{"tags":["Exports"],"summary":"List Exports","description":"List past exports for the current user.","operationId":"list_exports_api_exports_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/exports/formats":{"get":{"tags":["Exports"],"summary":"List Export Formats","description":"List available export resources and formats.","operationId":"list_export_formats_api_exports_formats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/api/blog/posts":{"get":{"tags":["blog"],"summary":"List Blog Posts","description":"List blog posts. No auth required for public read.","operationId":"list_blog_posts_api_api_blog_posts_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["blog"],"summary":"Create Blog Post","description":"Create a blog post (requires auth).","operationId":"create_blog_post_api_api_blog_posts_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPostCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/api/blog/posts/{slug}":{"get":{"tags":["blog"],"summary":"Get Blog Post","description":"Get a single blog post by slug.","operationId":"get_blog_post_api_api_blog_posts__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"tags":["Health"],"summary":"Health","description":"Lightweight health check. Returns 200 if the service is up.\nNo auth required — used by monitoring, load balancers, Vercel health.","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health/ready":{"get":{"tags":["Health"],"summary":"Readiness","description":"Readiness probe. Checks if the service can handle requests.\nReturns 503 if critical dependencies are down.","operationId":"readiness_api_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health/diagnostics":{"get":{"tags":["Health"],"summary":"Diagnostics","description":"Detailed system diagnostics. Admin only.\nShows runtime info, dependency status, store stats, and config.","operationId":"diagnostics_api_health_diagnostics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/nps/surveys":{"post":{"tags":["NPS Surveys"],"summary":"Create Survey","description":"Create an NPS survey.","operationId":"create_survey_api_nps_surveys_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["NPS Surveys"],"summary":"List Surveys","description":"List NPS surveys.","operationId":"list_surveys_api_nps_surveys_get","parameters":[{"name":"active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/nps/surveys/{survey_id}":{"get":{"tags":["NPS Surveys"],"summary":"Get Survey","description":"Get a single NPS survey.","operationId":"get_survey_api_nps_surveys__survey_id__get","parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["NPS Surveys"],"summary":"Update Survey","description":"Update an NPS survey.","operationId":"update_survey_api_nps_surveys__survey_id__patch","parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/nps/responses":{"post":{"tags":["NPS Surveys"],"summary":"Submit Response","description":"Submit an NPS response.","operationId":"submit_response_api_nps_responses_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/nps/surveys/{survey_id}/results":{"get":{"tags":["NPS Surveys"],"summary":"Survey Results","description":"Computed NPS score and breakdown for a survey.","operationId":"survey_results_api_nps_surveys__survey_id__results_get","parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-status/me":{"get":{"tags":["Agent Status"],"summary":"Get My Status","description":"Get my current status and stats.","operationId":"get_my_status_api_agent_status_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["Agent Status"],"summary":"Set My Status","description":"Set my current status.","operationId":"set_my_status_api_agent_status_me_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-status/team":{"get":{"tags":["Agent Status"],"summary":"Get Team Statuses","description":"Get all agents' statuses.","operationId":"get_team_statuses_api_agent_status_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/agent-status/schedule":{"get":{"tags":["Agent Status"],"summary":"List Scheduled Statuses","description":"List my scheduled status changes.","operationId":"list_scheduled_statuses_api_agent_status_schedule_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Agent Status"],"summary":"Create Scheduled Status","description":"Create a scheduled status change.","operationId":"create_scheduled_status_api_agent_status_schedule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledStatusCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent-status/schedule/{schedule_id}":{"delete":{"tags":["Agent Status"],"summary":"Delete Scheduled Status","description":"Cancel a scheduled status change.","operationId":"delete_scheduled_status_api_agent_status_schedule__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/":{"post":{"tags":["Reports"],"summary":"Create Report","description":"Create a custom report.","operationId":"create_report_api_reports__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/{bot_id}":{"get":{"tags":["Reports"],"summary":"List Reports","description":"List saved reports for a bot.","operationId":"list_reports_api_reports__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/detail/{report_id}":{"get":{"tags":["Reports"],"summary":"Get Report","description":"Get report config.","operationId":"get_report_api_reports_detail__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/{report_id}":{"put":{"tags":["Reports"],"summary":"Update Report","description":"Update a report configuration.","operationId":"update_report_api_reports__report_id__put","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Reports"],"summary":"Delete Report","description":"Delete a report.","operationId":"delete_report_api_reports__report_id__delete","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/{report_id}/run":{"post":{"tags":["Reports"],"summary":"Run Report","description":"Execute a report and return results with data points.","operationId":"run_report_api_reports__report_id__run_post","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/templates/list":{"get":{"tags":["Reports"],"summary":"List Report Templates","description":"List pre-built report templates.","operationId":"list_report_templates_api_reports_templates_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/reports/{bot_id}/from-template/{slug}":{"post":{"tags":["Reports"],"summary":"Create Report From Template","description":"Create a report from a template.","operationId":"create_report_from_template_api_reports__bot_id__from_template__slug__post","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/metrics/available":{"get":{"tags":["Reports"],"summary":"Get Available Metrics","description":"List all available metrics and dimensions for report building.","operationId":"get_available_metrics_api_reports_metrics_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/developer/api-keys":{"get":{"tags":["Developer"],"summary":"Dev List Api Keys","description":"List all developer API keys for the user.","operationId":"dev_list_api_keys_api_developer_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Developer"],"summary":"Dev Create Api Key","description":"Create a scoped API key (developer portal).","operationId":"dev_create_api_key_api_developer_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevAPIKeyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/api-keys/{key_id}":{"put":{"tags":["Developer"],"summary":"Dev Update Api Key","description":"Update a developer API key (name, scopes, status).","operationId":"dev_update_api_key_api_developer_api_keys__key_id__put","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevAPIKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Developer"],"summary":"Dev Revoke Api Key","description":"Revoke (delete) a developer API key permanently.","operationId":"dev_revoke_api_key_api_developer_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/api-keys/{key_id}/usage":{"get":{"tags":["Developer"],"summary":"Get Api Key Usage","description":"Get usage statistics for an API key.","operationId":"get_api_key_usage_api_developer_api_keys__key_id__usage_get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/webhook-events":{"get":{"tags":["Developer"],"summary":"List Webhook Events","description":"List all available webhook event types with payload examples.","operationId":"list_webhook_events_api_developer_webhook_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/developer/sandbox/start":{"post":{"tags":["Developer"],"summary":"Start Sandbox Session","description":"Start a sandbox API session for testing.","operationId":"start_sandbox_session_api_developer_sandbox_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/developer/sandbox/{session_id}/request":{"post":{"tags":["Developer"],"summary":"Sandbox Request","description":"Execute a sandboxed API request (simulated).","operationId":"sandbox_request_api_developer_sandbox__session_id__request_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/sandbox/{session_id}":{"delete":{"tags":["Developer"],"summary":"End Sandbox Session","description":"End and clean up a sandbox session.","operationId":"end_sandbox_session_api_developer_sandbox__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/developer/sdks":{"get":{"tags":["Developer"],"summary":"List Sdks","description":"List available SDKs and code examples.","operationId":"list_sdks_api_developer_sdks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/developer/scopes":{"get":{"tags":["Developer"],"summary":"List Api Scopes","description":"List all available API scopes for key creation.","operationId":"list_api_scopes_api_developer_scopes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/developer/docs":{"get":{"tags":["Developer"],"summary":"Get Api Docs Summary","description":"Get a summary of the public API surface.","operationId":"get_api_docs_summary_api_developer_docs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/queues/":{"post":{"tags":["Queues"],"summary":"Create Queue","description":"Create a named conversation queue.","operationId":"create_queue_api_queues__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/queues/{bot_id}":{"get":{"tags":["Queues"],"summary":"List Queues","description":"List queues for a bot with real-time depth.","operationId":"list_queues_api_queues__bot_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/queues/{queue_id}/metrics":{"get":{"tags":["Queues"],"summary":"Queue Metrics","description":"Queue real-time metrics: depth, avg wait, throughput.","operationId":"queue_metrics_api_queues__queue_id__metrics_get","parameters":[{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/queues/{bot_id}/{queue_id}":{"get":{"tags":["Queues"],"summary":"Get Queue","description":"Get queue details.","operationId":"get_queue_api_queues__bot_id___queue_id__get","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Queues"],"summary":"Update Queue","description":"Update queue configuration.","operationId":"update_queue_api_queues__bot_id___queue_id__put","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Queues"],"summary":"Delete Queue","description":"Delete a queue (only if empty).","operationId":"delete_queue_api_queues__bot_id___queue_id__delete","parameters":[{"name":"bot_id","in":"path","required":true,"schema":{"type":"string","title":"Bot Id"}},{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/queues/{queue_id}/enqueue":{"post":{"tags":["Queues"],"summary":"Enqueue Conversation","description":"Add a conversation to a queue.","operationId":"enqueue_conversation_api_queues__queue_id__enqueue_post","parameters":[{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueItem"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/queues/{queue_id}/pick":{"post":{"tags":["Queues"],"summary":"Pick From Queue","description":"Agent picks next conversation from queue (highest priority, oldest first).","operationId":"pick_from_queue_api_queues__queue_id__pick_post","parameters":[{"name":"queue_id","in":"path","required":true,"schema":{"type":"string","title":"Queue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/version":{"get":{"summary":"Api Version","description":"Return API version info and deprecation notices.","operationId":"api_version_api_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["Pages"],"summary":"Landing","operationId":"landing__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/demo":{"get":{"tags":["Pages"],"summary":"Demo","operationId":"demo_demo_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/bot/{domain}":{"get":{"tags":["Pages"],"summary":"Bot Landing","description":"SEO-friendly landing page for each bot domain.","operationId":"bot_landing_bot__domain__get","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","title":"Domain"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contact":{"get":{"tags":["Pages"],"summary":"Contact","operationId":"contact_contact_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/blog":{"get":{"tags":["Pages"],"summary":"Blog Index","operationId":"blog_index_blog_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/blog/{slug}":{"get":{"tags":["Pages"],"summary":"Blog Article","description":"SEO-optimised article page – server-renders meta tags for crawlers.","operationId":"blog_article_blog__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contact":{"post":{"tags":["Pages"],"summary":"Contact Submit","description":"Handle contact form submissions — store in DB + send notification.","operationId":"contact_submit_api_contact_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/chat-widget":{"get":{"tags":["Pages"],"summary":"Chat Widget","operationId":"chat_widget_chat_widget_get","parameters":[{"name":"bot","in":"query","required":false,"schema":{"type":"string","default":"","title":"Bot"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dashboard":{"get":{"tags":["Pages"],"summary":"Dashboard","operationId":"dashboard_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin-panel":{"get":{"tags":["Pages"],"summary":"Admin Panel","operationId":"admin_panel_admin_panel_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/pricing":{"get":{"tags":["Pages"],"summary":"Pricing","operationId":"pricing_pricing_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/partenaires/fatoura360":{"get":{"tags":["Pages"],"summary":"Fatoura360 Promo","description":"Cross-promo page presenting Fatoura360 billing SaaS.","operationId":"fatoura360_promo_partenaires_fatoura360_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/fatoura360":{"get":{"tags":["Pages"],"summary":"Fatoura360 Promo","description":"Cross-promo page presenting Fatoura360 billing SaaS.","operationId":"fatoura360_promo_fatoura360_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/partenaires/cryptocomply":{"get":{"tags":["Pages"],"summary":"Cryptocomply Promo","description":"Cross-promo page presenting CryptoComply MA crypto compliance SaaS.","operationId":"cryptocomply_promo_partenaires_cryptocomply_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/cryptocomply":{"get":{"tags":["Pages"],"summary":"Cryptocomply Promo","description":"Cross-promo page presenting CryptoComply MA crypto compliance SaaS.","operationId":"cryptocomply_promo_cryptocomply_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/konan-token":{"get":{"tags":["Pages"],"summary":"Token Page","operationId":"token_page_konan_token_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/token":{"get":{"tags":["Pages"],"summary":"Token Page","operationId":"token_page_token_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api-docs":{"get":{"tags":["Pages"],"summary":"Api Docs","operationId":"api_docs_api_docs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/privacy-policy":{"get":{"tags":["Pages"],"summary":"Privacy Policy","operationId":"privacy_policy_privacy_policy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/privacy":{"get":{"tags":["Pages"],"summary":"Privacy Policy","operationId":"privacy_policy_privacy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/terms-of-service":{"get":{"tags":["Pages"],"summary":"Terms Of Service","operationId":"terms_of_service_terms_of_service_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/terms":{"get":{"tags":["Pages"],"summary":"Terms Of Service","operationId":"terms_of_service_terms_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/data-deletion":{"get":{"tags":["Pages"],"summary":"Data Deletion","operationId":"data_deletion_data_deletion_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["Pages"],"summary":"Data Deletion Callback","description":"Facebook / Meta Data Deletion Callback.\nPer Meta Platform Terms §3.2: upon receiving a deletion request,\nwe MUST delete all user data obtained from Meta APIs.\nReturns a status URL + confirmation code for Meta's tracking.","operationId":"data_deletion_callback_data_deletion_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/embed.js":{"get":{"tags":["Pages"],"summary":"Embed Js","operationId":"embed_js_embed_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/konan-logo.png":{"get":{"tags":["Pages"],"summary":"Konan Logo Png","operationId":"konan_logo_png_konan_logo_png_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/manifest.json":{"get":{"tags":["Pages"],"summary":"Pwa Manifest","operationId":"pwa_manifest_manifest_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/pwa-icon-192.svg":{"get":{"tags":["Pages"],"summary":"Pwa Icon 192","description":"Legacy SVG endpoint — redirect to PNG.","operationId":"pwa_icon_192_pwa_icon_192_svg_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/pwa-icon-512.svg":{"get":{"tags":["Pages"],"summary":"Pwa Icon 512","description":"Legacy SVG endpoint — redirect to PNG.","operationId":"pwa_icon_512_pwa_icon_512_svg_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/favicon.svg":{"get":{"tags":["Pages"],"summary":"Favicon Svg","description":"Legacy SVG endpoint — redirect to PNG.","operationId":"favicon_svg_favicon_svg_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/favicon.ico":{"get":{"tags":["Pages"],"summary":"Favicon Ico","description":"Browsers auto-request /favicon.ico — serve the PNG logo.","operationId":"favicon_ico_favicon_ico_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/robots.txt":{"get":{"tags":["Pages"],"summary":"Robots Txt","operationId":"robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sitemap.xml":{"get":{"tags":["Pages"],"summary":"Sitemap Xml","description":"Dynamic sitemap with static pages + public help center articles.","operationId":"sitemap_xml_sitemap_xml_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sw.js":{"get":{"tags":["Pages"],"summary":"Service Worker","operationId":"service_worker_sw_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/i18n/{lang}":{"get":{"tags":["i18n & Export"],"summary":"Get Translations","operationId":"get_translations_api_i18n__lang__get","parameters":[{"name":"lang","in":"path","required":true,"schema":{"type":"string","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/lifecycle/run":{"post":{"tags":["Lifecycle"],"summary":"Lifecycle Cron","description":"Daily lifecycle email cron job.\nProcesses: welcome (Day 0), onboarding Day 2, onboarding Day 5,\nusage alerts (80%+), re-engagement (14d inactive).","operationId":"lifecycle_cron_api_lifecycle_run_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/lifecycle/weekly-digest":{"post":{"tags":["Lifecycle"],"summary":"Weekly Digest Cron","description":"Weekly digest email — runs every Monday at 09:00 UTC.\nSends activity summary to all active users.","operationId":"weekly_digest_cron_api_lifecycle_weekly_digest_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sentry-debug":{"get":{"summary":"Trigger Error","description":"Triggers a test error to verify Sentry is working. Admin only.","operationId":"trigger_error_sentry_debug_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/migrate":{"get":{"summary":"Admin Migrate","description":"One-time DB migration — add missing columns to users table. Admin only + secret header.","operationId":"admin_migrate_admin_migrate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/cleanup-rate-limits":{"get":{"summary":"Cleanup Rate Limits","description":"Manual cleanup of expired rate_limits. Admin only.","operationId":"cleanup_rate_limits_api_v1_admin_cleanup_rate_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ABTestCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"variants":{"items":{"$ref":"#/components/schemas/ABVariant"},"type":"array","maxItems":5,"minItems":2,"title":"Variants"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"traffic_percentage":{"type":"number","maximum":100.0,"minimum":1.0,"title":"Traffic Percentage","default":100.0}},"type":"object","required":["name","variants"],"title":"ABTestCreate"},"ABTestUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"traffic_percentage":{"anyOf":[{"type":"number","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Traffic Percentage"},"status":{"anyOf":[{"type":"string","pattern":"^(active|paused|completed)$"},{"type":"null"}],"title":"Status"}},"type":"object","title":"ABTestUpdate"},"ABVariant":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"weight":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Weight","default":50.0},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["name"],"title":"ABVariant"},"APIKeyCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"ip_allowlist":{"items":{"type":"string"},"type":"array","title":"Ip Allowlist"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["name"],"title":"APIKeyCreate"},"APIKeyUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"ip_allowlist":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Ip Allowlist"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","title":"APIKeyUpdate"},"AgentCapacity":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"max_concurrent":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Max Concurrent","default":5},"skills":{"items":{"type":"string"},"type":"array","title":"Skills"},"languages":{"items":{"type":"string"},"type":"array","title":"Languages"},"is_available":{"type":"boolean","title":"Is Available","default":true},"current_load":{"type":"integer","title":"Current Load","default":0},"priority_level":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Priority Level","default":1}},"type":"object","required":["agent_id"],"title":"AgentCapacity"},"AgentReplyRequest":{"properties":{"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"AgentReplyRequest"},"ArticleFeedback":{"properties":{"helpful":{"type":"boolean","title":"Helpful"},"comment":{"type":"string","maxLength":1000,"title":"Comment","default":""}},"type":"object","required":["helpful"],"title":"ArticleFeedback"},"ArticleRequest":{"properties":{"title":{"type":"string","maxLength":300,"minLength":1,"title":"Title"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"content":{"type":"string","minLength":1,"title":"Content"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"status":{"type":"string","pattern":"^(draft|published|archived)$","title":"Status","default":"draft"},"language":{"type":"string","maxLength":5,"title":"Language","default":"fr"},"meta_description":{"type":"string","maxLength":300,"title":"Meta Description","default":""}},"type":"object","required":["title","content"],"title":"ArticleRequest"},"AssignmentRuleCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"strategy":{"type":"string","pattern":"^(round_robin|least_busy|skill_based|random|priority)$","title":"Strategy"},"priority":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Priority","default":0},"is_active":{"type":"boolean","title":"Is Active","default":true},"conditions":{"additionalProperties":true,"type":"object","title":"Conditions"},"agent_ids":{"items":{"type":"string"},"type":"array","title":"Agent Ids"},"skills_required":{"items":{"type":"string"},"type":"array","title":"Skills Required"}},"type":"object","required":["bot_id","name","strategy"],"title":"AssignmentRuleCreate"},"AssignmentRuleUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"strategy":{"anyOf":[{"type":"string","pattern":"^(round_robin|least_busy|skill_based|random|priority)$"},{"type":"null"}],"title":"Strategy"},"priority":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Priority"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"conditions":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conditions"},"agent_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Agent Ids"},"skills_required":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills Required"}},"type":"object","title":"AssignmentRuleUpdate"},"AuditLogCreate":{"properties":{"user_id":{"type":"string","title":"User Id"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"action":{"type":"string","maxLength":100,"minLength":1,"title":"Action"},"target_type":{"type":"string","maxLength":50,"minLength":1,"title":"Target Type"},"target_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"},"details":{"additionalProperties":true,"type":"object","title":"Details"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"}},"type":"object","required":["user_id","action","target_type"],"title":"AuditLogCreate"},"BatchEventCreate":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EventCreate"},"type":"array","maxItems":100,"minItems":1,"title":"Events"}},"type":"object","required":["events"],"title":"BatchEventCreate"},"BlogPostCreate":{"properties":{"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"excerpt":{"type":"string","title":"Excerpt","default":""},"content":{"type":"string","title":"Content","default":""},"author":{"type":"string","title":"Author","default":"Équipe KONAN"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"status":{"type":"string","title":"Status","default":"draft"}},"type":"object","required":["slug","title"],"title":"BlogPostCreate"},"Body_chat_with_document_api_chat_with_document_post":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"message":{"type":"string","title":"Message","default":"Analyse ce document"},"session_id":{"type":"string","title":"Session Id"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["bot_id","file"],"title":"Body_chat_with_document_api_chat_with_document_post"},"Body_chat_with_document_api_v1_chat_with_document_post":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"message":{"type":"string","title":"Message","default":"Analyse ce document"},"session_id":{"type":"string","title":"Session Id"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["bot_id","file"],"title":"Body_chat_with_document_api_v1_chat_with_document_post"},"Body_submit_feedback_api_chat_feedback_post":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"session_id":{"type":"string","title":"Session Id"},"message_index":{"type":"integer","title":"Message Index"},"rating":{"type":"integer","title":"Rating"},"comment":{"type":"string","title":"Comment","default":""}},"type":"object","required":["bot_id","session_id","message_index","rating"],"title":"Body_submit_feedback_api_chat_feedback_post"},"Body_submit_feedback_api_v1_chat_feedback_post":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"session_id":{"type":"string","title":"Session Id"},"message_index":{"type":"integer","title":"Message Index"},"rating":{"type":"integer","title":"Rating"},"comment":{"type":"string","title":"Comment","default":""}},"type":"object","required":["bot_id","session_id","message_index","rating"],"title":"Body_submit_feedback_api_v1_chat_feedback_post"},"Body_upload_bot_avatar_api_bots__bot_id__avatar_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_bot_avatar_api_bots__bot_id__avatar_post"},"Body_upload_bot_avatar_api_v1_bots__bot_id__avatar_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_bot_avatar_api_v1_bots__bot_id__avatar_post"},"Body_upload_file_in_chat_api_chat_upload_file_post":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"session_id":{"type":"string","title":"Session Id"},"message":{"type":"string","title":"Message","default":""},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["bot_id","file"],"title":"Body_upload_file_in_chat_api_chat_upload_file_post"},"Body_upload_file_in_chat_api_v1_chat_upload_file_post":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"session_id":{"type":"string","title":"Session Id"},"message":{"type":"string","title":"Message","default":""},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["bot_id","file"],"title":"Body_upload_file_in_chat_api_v1_chat_upload_file_post"},"Body_upload_knowledge_api_bots__bot_id__knowledge_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"title":{"type":"string","title":"Title","default":""}},"type":"object","required":["file"],"title":"Body_upload_knowledge_api_bots__bot_id__knowledge_post"},"Body_upload_knowledge_api_v1_bots__bot_id__knowledge_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"title":{"type":"string","title":"Title","default":""}},"type":"object","required":["file"],"title":"Body_upload_knowledge_api_v1_bots__bot_id__knowledge_post"},"BotCreateRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":2,"title":"Name","description":"Nom du bot"},"domain":{"type":"string","maxLength":50,"minLength":2,"pattern":"^[a-z0-9_-]+$","title":"Domain","description":"Domaine (slug)"},"description":{"type":"string","maxLength":500,"title":"Description","default":""},"persona_name":{"type":"string","maxLength":50,"title":"Persona Name","default":"Assistant"},"persona_tone":{"type":"string","maxLength":30,"title":"Persona Tone","default":"professionnel"},"persona_language":{"type":"string","maxLength":5,"title":"Persona Language","default":"fr"},"welcome_message":{"type":"string","maxLength":500,"title":"Welcome Message","default":"Bonjour ! Comment puis-je vous aider ?"},"accent_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","title":"Accent Color","default":"#2563EB"},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"},"widget_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Widget Config"},"system_prompt":{"type":"string","maxLength":5000,"title":"System Prompt","default":""},"can_generate_documents":{"type":"boolean","title":"Can Generate Documents","default":true},"can_schedule_appointments":{"type":"boolean","title":"Can Schedule Appointments","default":false},"suggested_questions":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Suggested Questions","default":[]},"lead_capture":{"type":"boolean","title":"Lead Capture","default":false},"lead_fields":{"items":{"type":"string"},"type":"array","maxItems":5,"title":"Lead Fields","default":["name","phone"]},"lead_fields_config":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Lead Fields Config"},"lead_stages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Lead Stages"},"ai_model":{"type":"string","maxLength":100,"title":"Ai Model","default":""},"max_tokens":{"type":"integer","maximum":16000.0,"minimum":256.0,"title":"Max Tokens","default":4000},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7},"custom_api_key":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Custom Api Key","description":"Your own API key (encrypted at rest)"},"custom_ai_provider":{"anyOf":[{"type":"string","pattern":"^(openai|anthropic|openrouter|google)$"},{"type":"null"}],"title":"Custom Ai Provider"}},"type":"object","required":["name","domain"],"title":"BotCreateRequest","description":"Créer un nouveau bot"},"BotImportPayload":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data"},"new_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Name"}},"type":"object","required":["data"],"title":"BotImportPayload"},"BotUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":2},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"},"persona_name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Persona Name"},"persona_tone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Persona Tone"},"persona_language":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Persona Language"},"welcome_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Welcome Message"},"accent_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Accent Color"},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"},"widget_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Widget Config"},"system_prompt":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"System Prompt"},"can_generate_documents":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Generate Documents"},"can_schedule_appointments":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Can Schedule Appointments"},"suggested_questions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Suggested Questions"},"lead_capture":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Lead Capture"},"lead_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Lead Fields"},"lead_fields_config":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Lead Fields Config"},"lead_stages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Lead Stages"},"ai_model":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Ai Model"},"max_tokens":{"anyOf":[{"type":"integer","maximum":16000.0,"minimum":256.0},{"type":"null"}],"title":"Max Tokens"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"status":{"anyOf":[{"type":"string","pattern":"^(active|draft|disabled)$"},{"type":"null"}],"title":"Status"},"custom_api_key":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Custom Api Key"},"custom_ai_provider":{"anyOf":[{"type":"string","pattern":"^(openai|anthropic|openrouter|google|)$"},{"type":"null"}],"title":"Custom Ai Provider"},"is_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Public"},"custom_domain":{"anyOf":[{"type":"string","maxLength":253,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"},{"type":"null"}],"title":"Custom Domain"},"business_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Business Hours"}},"type":"object","title":"BotUpdateRequest","description":"Mise à jour d'un bot (tous les champs optionnels)"},"BulkDeleteInput":{"properties":{"record_ids":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Record Ids"}},"type":"object","required":["record_ids"],"title":"BulkDeleteInput"},"BulkRecordInput":{"properties":{"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":500,"minItems":1,"title":"Records"}},"type":"object","required":["records"],"title":"BulkRecordInput"},"BulkTaskInput":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/CreateTaskRequest"},"type":"array","maxItems":100,"minItems":1,"title":"Tasks"}},"type":"object","required":["tasks"],"title":"BulkTaskInput"},"BusinessHours":{"properties":{"timezone":{"type":"string","title":"Timezone","default":"Europe/Paris"},"days":{"items":{"type":"integer"},"type":"array","title":"Days"},"start_hour":{"type":"integer","title":"Start Hour","default":9},"end_hour":{"type":"integer","title":"End Hour","default":18}},"type":"object","title":"BusinessHours"},"CSATConfigUpdate":{"properties":{"csat_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Csat Enabled"},"csat_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Csat Config"}},"type":"object","title":"CSATConfigUpdate"},"CSATSubmitRequest":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"rating":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Rating"},"nps_score":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Nps Score"},"feedback":{"type":"string","maxLength":2000,"title":"Feedback","default":""},"channel":{"type":"string","title":"Channel","default":"web"}},"type":"object","required":["bot_id","rating"],"title":"CSATSubmitRequest"},"CannedResponseCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content"},"shortcut":{"anyOf":[{"type":"string","maxLength":50,"pattern":"^/[a-z0-9_-]+$"},{"type":"null"}],"title":"Shortcut"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category"}},"type":"object","required":["bot_id","title","content"],"title":"CannedResponseCreate"},"CannedResponseRequest":{"properties":{"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content"},"shortcut":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Shortcut","description":"Quick shortcut e.g. /greet"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category"}},"type":"object","required":["title","content"],"title":"CannedResponseRequest"},"CannedResponseUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Title"},"content":{"anyOf":[{"type":"string","maxLength":5000,"minLength":1},{"type":"null"}],"title":"Content"},"shortcut":{"anyOf":[{"type":"string","maxLength":50,"pattern":"^/[a-z0-9_-]+$"},{"type":"null"}],"title":"Shortcut"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category"}},"type":"object","title":"CannedResponseUpdate"},"CategoryRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"icon":{"type":"string","maxLength":10,"title":"Icon","default":"📁"},"sort_order":{"type":"integer","minimum":0.0,"title":"Sort Order","default":0}},"type":"object","required":["name"],"title":"CategoryRequest"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest"},"ChannelConnectRequest":{"properties":{"channel_type":{"$ref":"#/components/schemas/ChannelType"},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"}},"type":"object","required":["channel_type"],"title":"ChannelConnectRequest","description":"Requête pour connecter un canal à un bot"},"ChannelType":{"type":"string","enum":["web","whatsapp","api","telegram","instagram","messenger","tiktok","email"],"title":"ChannelType"},"ChatRequest":{"properties":{"message":{"type":"string","maxLength":4000,"title":"Message"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"bot_id":{"type":"string","title":"Bot Id"},"channel":{"$ref":"#/components/schemas/ChannelType","default":"web"},"user_info":{"additionalProperties":true,"type":"object","title":"User Info","default":{}}},"type":"object","required":["message","bot_id"],"title":"ChatRequest","description":"Requête chat API"},"ChatResponse":{"properties":{"reply":{"type":"string","title":"Reply"},"session_id":{"type":"string","title":"Session Id"},"sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sources","default":[]},"actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Actions","default":[]},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}}},"type":"object","required":["reply","session_id"],"title":"ChatResponse","description":"Réponse chat API"},"CheckoutRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"billing":{"type":"string","title":"Billing","default":"monthly"},"trial":{"type":"boolean","title":"Trial","default":true}},"type":"object","required":["plan"],"title":"CheckoutRequest"},"CollectionInput":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":500,"title":"Description","default":""},"schema_fields":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Schema Fields"},"icon":{"type":"string","maxLength":4,"title":"Icon","default":"📋"},"enable_validation":{"type":"boolean","title":"Enable Validation","description":"Enforce schema validation on records","default":false},"ttl_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Ttl Days","description":"Auto-delete records after N days"}},"type":"object","required":["name"],"title":"CollectionInput"},"CompanyCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":300,"minLength":1,"title":"Name"},"domain":{"type":"string","maxLength":300,"title":"Domain","default":""},"industry":{"type":"string","maxLength":100,"title":"Industry","default":""},"size":{"type":"string","maxLength":50,"title":"Size","default":""},"notes":{"type":"string","maxLength":5000,"title":"Notes","default":""},"custom_fields":{"additionalProperties":true,"type":"object","title":"Custom Fields"}},"type":"object","required":["bot_id","name"],"title":"CompanyCreate"},"ConsentUpdate":{"properties":{"purpose":{"type":"string","title":"Purpose"},"granted":{"type":"boolean","title":"Granted"}},"type":"object","required":["purpose","granted"],"title":"ConsentUpdate"},"ContactCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"title":"Name","default":""},"email":{"type":"string","maxLength":300,"title":"Email","default":""},"phone":{"type":"string","maxLength":50,"title":"Phone","default":""},"company":{"type":"string","maxLength":200,"title":"Company","default":""},"channel":{"type":"string","maxLength":50,"title":"Channel","default":"web"},"external_id":{"type":"string","maxLength":200,"title":"External Id","default":""},"avatar_url":{"type":"string","maxLength":500,"title":"Avatar Url","default":""},"custom_fields":{"additionalProperties":true,"type":"object","title":"Custom Fields"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"notes":{"type":"string","maxLength":5000,"title":"Notes","default":""}},"type":"object","required":["bot_id"],"title":"ContactCreate"},"ContactUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"custom_fields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Custom Fields"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_blocked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Blocked"}},"type":"object","title":"ContactUpdate"},"CrawlConfig":{"properties":{"max_depth":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Depth","default":2},"max_pages":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Max Pages","default":50},"follow_links":{"type":"boolean","title":"Follow Links","default":true},"include_patterns":{"items":{"type":"string"},"type":"array","title":"Include Patterns"},"exclude_patterns":{"items":{"type":"string"},"type":"array","title":"Exclude Patterns"},"refresh_interval_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Refresh Interval Hours","default":24}},"type":"object","title":"CrawlConfig"},"CreateFlowRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"bot_id":{"type":"string","title":"Bot Id"},"trigger_type":{"type":"string","pattern":"^(event|schedule|manual|proactive)$","title":"Trigger Type","default":"event"},"conditions":{"items":{"$ref":"#/components/schemas/app__api__automations__TriggerCondition"},"type":"array","title":"Conditions"},"conditions_logic":{"type":"string","pattern":"^(and|or)$","title":"Conditions Logic","default":"and"},"actions":{"items":{"$ref":"#/components/schemas/FlowAction"},"type":"array","minItems":1,"title":"Actions"},"is_active":{"type":"boolean","title":"Is Active","default":true},"priority":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Priority","default":0}},"type":"object","required":["name","bot_id"],"title":"CreateFlowRequest"},"CreateKeyRequest":{"properties":{"name":{"type":"string","title":"Name","default":"default"}},"type":"object","title":"CreateKeyRequest"},"CreateTaskRequest":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"title":{"type":"string","maxLength":500,"minLength":1,"title":"Title"},"description":{"type":"string","title":"Description","default":""},"task_type":{"type":"string","title":"Task Type","default":"task"},"priority":{"type":"string","title":"Priority","default":"normal"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"recurrence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurrence"},"recurrence_interval":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recurrence Interval"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["bot_id","title"],"title":"CreateTaskRequest"},"CustomFieldDefinition":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"field_type":{"type":"string","pattern":"^(text|number|boolean|date|select|url|email)$","title":"Field Type","default":"text"},"required":{"type":"boolean","title":"Required","default":false},"default_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Value"},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["bot_id","name"],"title":"CustomFieldDefinition"},"CustomFieldUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"field_type":{"anyOf":[{"type":"string","pattern":"^(text|number|boolean|date|select|url|email)$"},{"type":"null"}],"title":"Field Type"},"required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Required"},"default_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Value"},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"CustomFieldUpdate"},"CustomFieldValueSet":{"properties":{"values":{"additionalProperties":true,"type":"object","title":"Values"}},"type":"object","required":["values"],"title":"CustomFieldValueSet"},"DSRCreate":{"properties":{"contact_id":{"type":"string","title":"Contact Id"},"request_type":{"type":"string","title":"Request Type"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["contact_id","request_type"],"title":"DSRCreate"},"DSRStatusUpdate":{"properties":{"status":{"type":"string","title":"Status"},"resolution_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Notes"}},"type":"object","required":["status"],"title":"DSRStatusUpdate"},"DevAPIKeyCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"},"rate_limit_per_minute":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Rate Limit Per Minute","default":60}},"type":"object","required":["name","scopes"],"title":"DevAPIKeyCreate"},"DevAPIKeyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"rate_limit_per_minute":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Limit Per Minute"}},"type":"object","title":"DevAPIKeyUpdate"},"DocumentRequest":{"properties":{"template_id":{"type":"string","title":"Template Id","default":"default"},"doc_type":{"$ref":"#/components/schemas/DocumentType","default":"pdf"},"data":{"additionalProperties":true,"type":"object","title":"Data","default":{}},"title":{"type":"string","title":"Title","default":"Document"}},"type":"object","title":"DocumentRequest","description":"Demande de génération de document"},"DocumentType":{"type":"string","enum":["pdf","word","excel"],"title":"DocumentType"},"EmailTemplateCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"subject_template":{"type":"string","maxLength":200,"title":"Subject Template","default":"Re: {{subject}}"},"html_template":{"type":"string","maxLength":50000,"title":"Html Template","default":""},"accent_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","title":"Accent Color","default":"#2563EB"},"footer_text":{"type":"string","maxLength":500,"title":"Footer Text","default":"Propulsé par KONAN"},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"},"is_default":{"type":"boolean","title":"Is Default","default":false}},"type":"object","required":["name"],"title":"EmailTemplateCreate"},"EmailTemplateUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"subject_template":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Subject Template"},"html_template":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Html Template"},"accent_color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Accent Color"},"footer_text":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Footer Text"},"logo_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Logo Url"},"is_default":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Default"}},"type":"object","title":"EmailTemplateUpdate"},"EscalationRule":{"properties":{"level":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Level"},"after_minutes":{"type":"integer","minimum":1.0,"title":"After Minutes"},"action":{"type":"string","pattern":"^(notify|reassign|escalate_manager)$","title":"Action"},"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target"}},"type":"object","required":["level","after_minutes","action"],"title":"EscalationRule"},"EventCreate":{"properties":{"event_type":{"type":"string","title":"Event Type"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"properties":{"additionalProperties":true,"type":"object","title":"Properties"}},"type":"object","required":["event_type"],"title":"EventCreate"},"ExportFormat":{"type":"string","enum":["csv","json"],"title":"ExportFormat"},"ExportRequest":{"properties":{"resource":{"$ref":"#/components/schemas/ExportResource"},"format":{"$ref":"#/components/schemas/ExportFormat","default":"csv"},"date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From","description":"ISO date (YYYY-MM-DD)"},"date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To","description":"ISO date (YYYY-MM-DD)"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"},"filters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filters"},"columns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Columns"}},"type":"object","required":["resource"],"title":"ExportRequest"},"ExportResource":{"type":"string","enum":["conversations","contacts","messages","audit_logs","analytics","feedback","tickets"],"title":"ExportResource"},"FeedbackCorrection":{"properties":{"message_id":{"type":"string","title":"Message Id"},"session_id":{"type":"string","title":"Session Id"},"bot_id":{"type":"string","title":"Bot Id"},"corrected_response":{"type":"string","maxLength":5000,"minLength":1,"title":"Corrected Response"}},"type":"object","required":["message_id","session_id","bot_id","corrected_response"],"title":"FeedbackCorrection"},"FilterRule":{"properties":{"field":{"type":"string","title":"Field"},"operator":{"type":"string","title":"Operator"},"value":{"title":"Value"}},"type":"object","required":["field","operator","value"],"title":"FilterRule"},"FlowAction":{"properties":{"type":{"type":"string","pattern":"^(send_message|assign_agent|add_tag|remove_tag|set_status|create_ticket|send_webhook|wait|condition)$","title":"Type"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["type"],"title":"FlowAction"},"FlowCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"nodes":{"items":{"$ref":"#/components/schemas/FlowNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/FlowEdge"},"type":"array","title":"Edges"},"trigger":{"additionalProperties":true,"type":"object","title":"Trigger"}},"type":"object","required":["bot_id","name"],"title":"FlowCreate"},"FlowEdge":{"properties":{"id":{"type":"string","title":"Id"},"source":{"type":"string","title":"Source"},"target":{"type":"string","title":"Target"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition"}},"type":"object","required":["id","source","target"],"title":"FlowEdge"},"FlowNode":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"position":{"additionalProperties":true,"type":"object","title":"Position"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["id","type"],"title":"FlowNode"},"FlowUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"nodes":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowNode"},"type":"array"},{"type":"null"}],"title":"Nodes"},"edges":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowEdge"},"type":"array"},{"type":"null"}],"title":"Edges"},"trigger":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trigger"},"status":{"anyOf":[{"type":"string","pattern":"^(draft|active|archived)$"},{"type":"null"}],"title":"Status"}},"type":"object","title":"FlowUpdate"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandoffReleaseRequest":{"properties":{"status":{"type":"string","pattern":"^(active|resolved|closed)$","title":"Status","default":"active"}},"type":"object","title":"HandoffReleaseRequest","description":"Release conversation back to bot."},"IPValidateRequest":{"properties":{"ip":{"type":"string","title":"Ip"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}},"type":"object","required":["ip"],"title":"IPValidateRequest"},"ImportRecordsInput":{"properties":{"records":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":5000,"minItems":1,"title":"Records"},"skip_validation":{"type":"boolean","title":"Skip Validation","default":false}},"type":"object","required":["records"],"title":"ImportRecordsInput"},"InternalNoteCreate":{"properties":{"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"InternalNoteCreate"},"KBSourceCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"source_type":{"type":"string","pattern":"^(url|file|api_feed)$","title":"Source Type"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"crawl_config":{"anyOf":[{"$ref":"#/components/schemas/CrawlConfig"},{"type":"null"}]}},"type":"object","required":["bot_id","name","source_type"],"title":"KBSourceCreate"},"KBSourceUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"crawl_config":{"anyOf":[{"$ref":"#/components/schemas/CrawlConfig"},{"type":"null"}]},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"KBSourceUpdate"},"LanguageConfig":{"properties":{"supported_languages":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Supported Languages","default":["fr","en"]},"default_language":{"type":"string","maxLength":5,"title":"Default Language","default":"fr"},"auto_detect":{"type":"boolean","title":"Auto Detect","default":true},"language_prompts":{"additionalProperties":true,"type":"object","title":"Language Prompts"},"language_greetings":{"additionalProperties":true,"type":"object","title":"Language Greetings"}},"type":"object","title":"LanguageConfig"},"LeadStageUpdate":{"properties":{"stage":{"type":"string","title":"Stage","description":"Pipeline stage"}},"type":"object","required":["stage"],"title":"LeadStageUpdate"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MacroCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"steps":{"items":{"$ref":"#/components/schemas/MacroStep"},"type":"array","minItems":1,"title":"Steps"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"shortcut":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortcut"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["bot_id","name","steps"],"title":"MacroCreate"},"MacroExecute":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["conversation_id"],"title":"MacroExecute"},"MacroStep":{"properties":{"type":{"type":"string","title":"Type"},"params":{"additionalProperties":true,"type":"object","title":"Params"}},"type":"object","required":["type"],"title":"MacroStep"},"MacroUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/MacroStep"},"type":"array"},{"type":"null"}],"title":"Steps"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"shortcut":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortcut"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"MacroUpdate"},"MemoryCreate":{"properties":{"content":{"type":"string","maxLength":2000,"minLength":3,"title":"Content"},"category":{"type":"string","title":"Category","default":"fact"},"importance":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Importance","default":3},"contact_id":{"type":"string","title":"Contact Id","default":""}},"type":"object","required":["content"],"title":"MemoryCreate"},"MemoryImportItem":{"properties":{"content":{"type":"string","title":"Content"},"category":{"type":"string","title":"Category","default":"fact"},"importance":{"type":"integer","title":"Importance","default":3},"contact_id":{"type":"string","title":"Contact Id","default":""}},"type":"object","required":["content"],"title":"MemoryImportItem"},"MemoryImportRequest":{"properties":{"memories":{"items":{"$ref":"#/components/schemas/MemoryImportItem"},"type":"array","maxItems":100,"title":"Memories"}},"type":"object","required":["memories"],"title":"MemoryImportRequest"},"MemoryInput":{"properties":{"contact_id":{"type":"string","maxLength":200,"title":"Contact Id"},"key":{"type":"string","maxLength":100,"title":"Key"},"value":{"type":"string","maxLength":2000,"title":"Value"},"category":{"type":"string","maxLength":50,"title":"Category","default":"general"}},"type":"object","required":["contact_id","key","value"],"title":"MemoryInput"},"MemoryRecallRequest":{"properties":{"query":{"type":"string","maxLength":1000,"minLength":1,"title":"Query"},"contact_id":{"type":"string","title":"Contact Id","default":""},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","default":8},"categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Categories"},"min_importance":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Min Importance","default":1}},"type":"object","required":["query"],"title":"MemoryRecallRequest"},"MemoryUpdate":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"importance":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Importance"}},"type":"object","title":"MemoryUpdate"},"MergeRequest":{"properties":{"primary_conversation_id":{"type":"string","title":"Primary Conversation Id"},"conversation_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Conversation Ids"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["primary_conversation_id","conversation_ids"],"title":"MergeRequest"},"MessageFeedback":{"properties":{"message_id":{"type":"string","title":"Message Id"},"session_id":{"type":"string","title":"Session Id"},"bot_id":{"type":"string","title":"Bot Id"},"rating":{"type":"string","pattern":"^(thumbs_up|thumbs_down)$","title":"Rating"},"comment":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Comment"},"tags":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["message_id","session_id","bot_id","rating"],"title":"MessageFeedback"},"NotificationPrefsUpdate":{"properties":{"email_on_new_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On New Message"},"email_on_assignment":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On Assignment"},"email_on_sla_breach":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On Sla Breach"},"email_on_handoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On Handoff"},"email_on_ticket_update":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On Ticket Update"},"in_app_sound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"In App Sound"},"desktop_push":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Desktop Push"}},"type":"object","title":"NotificationPrefsUpdate"},"PersonaCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"tone":{"type":"string","title":"Tone","default":"friendly"},"verbosity":{"type":"string","title":"Verbosity","default":"normal"},"emoji_usage":{"type":"boolean","title":"Emoji Usage","default":true},"humor_level":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Humor Level","default":3},"language_complexity":{"type":"string","title":"Language Complexity","default":"simple"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"}},"type":"object","required":["name"],"title":"PersonaCreate"},"PersonaUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone"},"verbosity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verbosity"},"emoji_usage":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Emoji Usage"},"humor_level":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Humor Level"},"language_complexity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Complexity"},"custom_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Instructions"}},"type":"object","title":"PersonaUpdate"},"PresenceUpdate":{"properties":{"status":{"type":"string","pattern":"^(online|away|offline|busy)$","title":"Status","default":"online"}},"type":"object","title":"PresenceUpdate"},"PriorityTarget":{"properties":{"priority":{"type":"string","pattern":"^(urgent|high|normal|low)$","title":"Priority"},"first_response_minutes":{"type":"integer","minimum":1.0,"title":"First Response Minutes"},"resolution_minutes":{"type":"integer","minimum":1.0,"title":"Resolution Minutes"}},"type":"object","required":["priority","first_response_minutes","resolution_minutes"],"title":"PriorityTarget"},"ProactiveMessageRequest":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"trigger_url_pattern":{"type":"string","maxLength":500,"title":"Trigger Url Pattern","default":"*"},"trigger_delay_seconds":{"type":"integer","maximum":300.0,"minimum":0.0,"title":"Trigger Delay Seconds","default":5},"trigger_scroll_percent":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Trigger Scroll Percent"},"trigger_visit_count":{"type":"integer","minimum":1.0,"title":"Trigger Visit Count","default":1},"show_once_per_visitor":{"type":"boolean","title":"Show Once Per Visitor","default":true},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["bot_id","name","message"],"title":"ProactiveMessageRequest"},"ProactiveRuleCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"trigger":{"$ref":"#/components/schemas/app__api__proactive__TriggerCondition"},"message_template":{"type":"string","maxLength":1000,"minLength":1,"title":"Message Template"},"cooldown_minutes":{"type":"integer","maximum":10080.0,"minimum":0.0,"title":"Cooldown Minutes","default":60},"is_active":{"type":"boolean","title":"Is Active","default":true},"priority":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Priority","default":0}},"type":"object","required":["bot_id","name","trigger","message_template"],"title":"ProactiveRuleCreate"},"ProactiveRuleUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"trigger":{"anyOf":[{"$ref":"#/components/schemas/app__api__proactive__TriggerCondition"},{"type":"null"}]},"message_template":{"anyOf":[{"type":"string","maxLength":1000,"minLength":1},{"type":"null"}],"title":"Message Template"},"cooldown_minutes":{"anyOf":[{"type":"integer","maximum":10080.0,"minimum":0.0},{"type":"null"}],"title":"Cooldown Minutes"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"priority":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Priority"}},"type":"object","title":"ProactiveRuleUpdate"},"QueueCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"priority":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Priority","default":0},"capacity":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Capacity","default":100},"overflow_action":{"type":"string","pattern":"^(reject|transfer|queue_overflow)$","title":"Overflow Action","default":"reject"},"fallback_queue_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Queue Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["bot_id","name"],"title":"QueueCreate"},"QueueItem":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"priority":{"type":"integer","title":"Priority","default":0},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["conversation_id"],"title":"QueueItem"},"QueueUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"capacity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Capacity"},"overflow_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Overflow Action"},"fallback_queue_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Queue Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"QueueUpdate"},"QuotaOverride":{"properties":{"quotas":{"additionalProperties":{"type":"integer"},"type":"object","title":"Quotas"}},"type":"object","required":["quotas"],"title":"QuotaOverride"},"RecordInput":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","title":"RecordInput"},"RecordUpdateInput":{"properties":{"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"RecordUpdateInput"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Email address"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password","description":"Min 8 chars, must contain letter + digit"},"name":{"type":"string","maxLength":100,"title":"Name","description":"Display name","default":""}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ReportCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"metrics":{"items":{"type":"string"},"type":"array","title":"Metrics"},"dimensions":{"items":{"type":"string"},"type":"array","title":"Dimensions"},"filters":{"items":{"$ref":"#/components/schemas/ReportFilter"},"type":"array","title":"Filters"},"chart_type":{"type":"string","pattern":"^(line|bar|pie|area|table|number|heatmap|funnel)$","title":"Chart Type","default":"line"},"date_range":{"type":"string","pattern":"^(today|yesterday|last_7_days|last_30_days|last_90_days|custom)$","title":"Date Range","default":"last_7_days"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/ReportSchedule"},{"type":"null"}]}},"type":"object","required":["bot_id","name","metrics"],"title":"ReportCreate"},"ReportFilter":{"properties":{"field":{"type":"string","title":"Field"},"operator":{"type":"string","pattern":"^(eq|ne|gt|lt|gte|lte|in|contains)$","title":"Operator","default":"eq"},"value":{"title":"Value"}},"type":"object","required":["field"],"title":"ReportFilter"},"ReportSchedule":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"frequency":{"type":"string","pattern":"^(daily|weekly|monthly)$","title":"Frequency","default":"weekly"},"day_of_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Week"},"hour":{"type":"integer","title":"Hour","default":9},"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients"},"format":{"type":"string","pattern":"^(pdf|csv|xlsx)$","title":"Format","default":"pdf"}},"type":"object","title":"ReportSchedule"},"ReportUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"metrics":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metrics"},"dimensions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Dimensions"},"filters":{"anyOf":[{"items":{"$ref":"#/components/schemas/ReportFilter"},"type":"array"},{"type":"null"}],"title":"Filters"},"chart_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chart Type"},"date_range":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Range"},"schedule":{"anyOf":[{"$ref":"#/components/schemas/ReportSchedule"},{"type":"null"}]}},"type":"object","title":"ReportUpdate"},"ResetPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"},"new_password":{"type":"string","minLength":8,"title":"New Password"}},"type":"object","required":["email","code","new_password"],"title":"ResetPasswordRequest"},"ResponseCreate":{"properties":{"survey_id":{"type":"string","title":"Survey Id"},"contact_id":{"type":"string","title":"Contact Id"},"score":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Score"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["survey_id","contact_id","score"],"title":"ResponseCreate"},"RoleChange":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"RoleChange"},"RoutingCondition":{"properties":{"field":{"type":"string","pattern":"^(channel|language|topic|segment|tag|keyword|time)$","title":"Field"},"operator":{"type":"string","pattern":"^(equals|contains|regex|in|not_in|between)$","title":"Operator","default":"equals"},"value":{"title":"Value"}},"type":"object","required":["field","value"],"title":"RoutingCondition"},"RoutingRuleUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"conditions":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conditions"},"fallback_strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Strategy"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"RoutingRuleUpdate"},"SLAPolicyCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority_targets":{"items":{"$ref":"#/components/schemas/PriorityTarget"},"type":"array","title":"Priority Targets"},"business_hours":{"anyOf":[{"$ref":"#/components/schemas/BusinessHours"},{"type":"null"}]},"escalation_rules":{"items":{"$ref":"#/components/schemas/EscalationRule"},"type":"array","title":"Escalation Rules"},"apply_to_channels":{"items":{"type":"string"},"type":"array","title":"Apply To Channels"}},"type":"object","required":["bot_id","name","priority_targets"],"title":"SLAPolicyCreate"},"SLAPolicyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority_targets":{"anyOf":[{"items":{"$ref":"#/components/schemas/PriorityTarget"},"type":"array"},{"type":"null"}],"title":"Priority Targets"},"business_hours":{"anyOf":[{"$ref":"#/components/schemas/BusinessHours"},{"type":"null"}]},"escalation_rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/EscalationRule"},"type":"array"},{"type":"null"}],"title":"Escalation Rules"},"apply_to_channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Apply To Channels"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"SLAPolicyUpdate"},"SLARuleCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"priority":{"type":"string","pattern":"^(low|medium|high|urgent)$","title":"Priority","default":"medium"},"response_time_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Response Time Hours","default":24},"resolution_time_hours":{"type":"integer","maximum":2160.0,"minimum":1.0,"title":"Resolution Time Hours","default":72},"notify_on_breach":{"type":"boolean","title":"Notify On Breach","default":true},"escalate_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalate To"}},"type":"object","required":["bot_id","name"],"title":"SLARuleCreate"},"SavedViewCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"bot_id":{"type":"string","title":"Bot Id"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"icon":{"type":"string","maxLength":5,"title":"Icon","default":"📋"}},"type":"object","required":["name","bot_id"],"title":"SavedViewCreate"},"ScenarioCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"steps":{"items":{"$ref":"#/components/schemas/TestStep"},"type":"array","minItems":1,"title":"Steps"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["bot_id","name","steps"],"title":"ScenarioCreate"},"ScenarioUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/TestStep"},"type":"array"},{"type":"null"}],"title":"Steps"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"ScenarioUpdate"},"ScheduledStatusCreate":{"properties":{"status":{"type":"string","title":"Status"},"scheduled_at":{"type":"string","title":"Scheduled At"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["status","scheduled_at"],"title":"ScheduledStatusCreate"},"SecurityRuleCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"rule_type":{"type":"string","title":"Rule Type"},"cidrs":{"items":{"type":"string"},"type":"array","title":"Cidrs"},"countries":{"items":{"type":"string"},"type":"array","title":"Countries"},"threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name","rule_type"],"title":"SecurityRuleCreate"},"SecurityRuleUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"cidrs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Cidrs"},"countries":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Countries"},"threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"SecurityRuleUpdate"},"SegmentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/FilterRule"},"type":"array"},{"type":"null"}],"title":"Rules"},"contact_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Contact Ids"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"SegmentUpdate"},"SessionActivityUpdate":{"properties":{"action":{"type":"string","pattern":"^(typing|viewing|replying|idle)$","title":"Action","default":"typing"}},"type":"object","title":"SessionActivityUpdate"},"SessionAssign":{"properties":{"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},"type":"object","title":"SessionAssign"},"SessionStatusUpdate":{"properties":{"status":{"type":"string","pattern":"^(active|waiting|resolved|closed)$","title":"Status"}},"type":"object","required":["status"],"title":"SessionStatusUpdate"},"SessionTagsUpdate":{"properties":{"tags":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Tags"}},"type":"object","required":["tags"],"title":"SessionTagsUpdate"},"SkillCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":2,"title":"Name"},"slug":{"type":"string","maxLength":100,"title":"Slug","default":""},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"category":{"type":"string","title":"Category","default":"general"},"icon":{"type":"string","title":"Icon","default":"🔧"},"system_prompt":{"type":"string","maxLength":5000,"title":"System Prompt","default":""},"tool_definitions":{"items":{},"type":"array","title":"Tool Definitions","default":[]},"webhook_url":{"type":"string","title":"Webhook Url","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"is_public":{"type":"boolean","title":"Is Public","default":false},"version":{"type":"string","maxLength":20,"title":"Version","default":"1.0.0"},"changelog":{"type":"string","maxLength":2000,"title":"Changelog","default":""}},"type":"object","required":["name"],"title":"SkillCreate"},"SkillImportInput":{"properties":{"name":{"type":"string","maxLength":100,"minLength":2,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description","default":""},"category":{"type":"string","title":"Category","default":"general"},"icon":{"type":"string","title":"Icon","default":"🔧"},"system_prompt":{"type":"string","maxLength":5000,"title":"System Prompt","default":""},"tool_definitions":{"items":{},"type":"array","title":"Tool Definitions","default":[]},"webhook_url":{"type":"string","title":"Webhook Url","default":""},"tags":{"items":{},"type":"array","title":"Tags","default":[]}},"type":"object","required":["name"],"title":"SkillImportInput"},"SkillInstall":{"properties":{"skill_id":{"type":"string","title":"Skill Id"},"config":{"additionalProperties":true,"type":"object","title":"Config","default":{}}},"type":"object","required":["skill_id"],"title":"SkillInstall"},"SkillRating":{"properties":{"rating":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Rating"},"review":{"type":"string","maxLength":1000,"title":"Review","default":""}},"type":"object","required":["rating"],"title":"SkillRating"},"SkillToggle":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"SkillToggle"},"SkillUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"tool_definitions":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tool Definitions"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"changelog":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changelog"}},"type":"object","title":"SkillUpdate"},"SplitRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"split_at_message_index":{"type":"integer","minimum":1.0,"title":"Split At Message Index"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["conversation_id","split_at_message_index"],"title":"SplitRequest"},"StatusUpdate":{"properties":{"status":{"type":"string","title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"max_conversations":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Max Conversations"}},"type":"object","required":["status"],"title":"StatusUpdate"},"SurveyCreate":{"properties":{"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question","default":"How likely are you to recommend us?"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["title"],"title":"SurveyCreate"},"SurveyUpdate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"SurveyUpdate"},"TaskInput":{"properties":{"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"task_type":{"type":"string","pattern":"^(task|appointment|reminder|follow_up)$","title":"Task Type","default":"task"},"priority":{"type":"string","pattern":"^(low|normal|high|urgent)$","title":"Priority","default":"normal"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"}},"type":"object","required":["title"],"title":"TaskInput"},"TaskUpdateInput":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"}},"type":"object","title":"TaskUpdateInput"},"TeamCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"TeamCreate"},"TeamInvite":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role","default":"editor"}},"type":"object","required":["email"],"title":"TeamInvite"},"TeamUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"TeamUpdate"},"TemplateComponent":{"properties":{"type":{"type":"string","title":"Type"},"parameters":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["type"],"title":"TemplateComponent"},"TemplateFromSeedRequest":{"properties":{"seed_id":{"type":"string","title":"Seed Id"},"bot_id":{"type":"string","title":"Bot Id"}},"type":"object","required":["seed_id","bot_id"],"title":"TemplateFromSeedRequest"},"TestStep":{"properties":{"user_message":{"type":"string","minLength":1,"title":"User Message"},"expected_pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Pattern"},"expected_intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Intent"},"timeout_seconds":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Timeout Seconds","default":10}},"type":"object","required":["user_message"],"title":"TestStep"},"TicketCommentRequest":{"properties":{"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content"},"is_internal":{"type":"boolean","title":"Is Internal","default":false}},"type":"object","required":["content"],"title":"TicketCommentRequest"},"TicketCreateRequest":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"subject":{"type":"string","maxLength":300,"minLength":1,"title":"Subject"},"description":{"type":"string","maxLength":5000,"title":"Description","default":""},"priority":{"type":"string","pattern":"^(low|medium|high|urgent)$","title":"Priority","default":"medium"},"category":{"type":"string","maxLength":100,"title":"Category","default":"general"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"sla_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sla Hours"}},"type":"object","required":["bot_id","subject"],"title":"TicketCreateRequest"},"TicketUpdateRequest":{"properties":{"subject":{"anyOf":[{"type":"string","maxLength":300,"minLength":1},{"type":"null"}],"title":"Subject"},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string","pattern":"^(open|in_progress|waiting|resolved|closed)$"},{"type":"null"}],"title":"Status"},"priority":{"anyOf":[{"type":"string","pattern":"^(low|medium|high|urgent)$"},{"type":"null"}],"title":"Priority"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"TicketUpdateRequest"},"TokenResponse":{"properties":{"token":{"type":"string","title":"Token"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"user":{"additionalProperties":true,"type":"object","title":"User"}},"type":"object","required":["token","user"],"title":"TokenResponse"},"TransferRequest":{"properties":{"target_agent_id":{"type":"string","title":"Target Agent Id","description":"ID of the agent receiving the conversation"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note","description":"Handoff note for receiving agent"}},"type":"object","required":["target_agent_id"],"title":"TransferRequest"},"UpdateFlowRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"trigger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Type"},"conditions":{"anyOf":[{"items":{"$ref":"#/components/schemas/app__api__automations__TriggerCondition"},"type":"array"},{"type":"null"}],"title":"Conditions"},"conditions_logic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conditions Logic"},"actions":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowAction"},"type":"array"},{"type":"null"}],"title":"Actions"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"type":"object","title":"UpdateFlowRequest"},"UpdateProfileRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"UpdateProfileRequest"},"UpdateTaskRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},"type":"object","title":"UpdateTaskRequest"},"UsageEvent":{"properties":{"metric":{"type":"string","title":"Metric"},"amount":{"type":"integer","minimum":1.0,"title":"Amount","default":1}},"type":"object","required":["metric"],"title":"UsageEvent"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Verify2FACode":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["code"],"title":"Verify2FACode"},"Verify2FALogin":{"properties":{"challenge_token":{"type":"string","title":"Challenge Token"},"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["challenge_token","code"],"title":"Verify2FALogin"},"VerifyEmailRequest":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["code"],"title":"VerifyEmailRequest"},"VisitorEventRequest":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"visitor_id":{"type":"string","maxLength":200,"minLength":1,"title":"Visitor Id"},"event_type":{"type":"string","pattern":"^(page_view|chat_start|chat_end|widget_open|widget_close)$","title":"Event Type"},"page_url":{"type":"string","maxLength":2000,"title":"Page Url","default":""},"page_title":{"type":"string","maxLength":500,"title":"Page Title","default":""},"referrer":{"type":"string","maxLength":2000,"title":"Referrer","default":""}},"type":"object","required":["bot_id","visitor_id","event_type"],"title":"VisitorEventRequest"},"WebhookCreateRequest":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events","default":[]},"secret":{"type":"string","title":"Secret","default":""}},"type":"object","required":["bot_id","url"],"title":"WebhookCreateRequest"},"WebhookLogCreate":{"properties":{"webhook_id":{"type":"string","title":"Webhook Id"},"event_type":{"type":"string","minLength":1,"title":"Event Type"},"endpoint_url":{"type":"string","title":"Endpoint Url"},"request_headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Request Headers"},"request_body":{"additionalProperties":true,"type":"object","title":"Request Body"}},"type":"object","required":["webhook_id","event_type","endpoint_url"],"title":"WebhookLogCreate"},"WebhookUpdateRequest":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"WebhookUpdateRequest"},"WhatsAppBroadcast":{"properties":{"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"language_code":{"type":"string","title":"Language Code","default":"fr"},"components":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateComponent"},"type":"array"},{"type":"null"}],"title":"Components"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"type":"object","required":["recipients"],"title":"WhatsAppBroadcast"},"WhatsAppConfigUpdate":{"properties":{"whatsapp_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Token"},"whatsapp_phone_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Phone Id"},"whatsapp_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Number"},"whatsapp_waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Whatsapp Waba Id"}},"type":"object","title":"WhatsAppConfigUpdate","description":"Per-bot WhatsApp configuration."},"WhatsAppInteractiveSend":{"properties":{"to":{"type":"string","title":"To"},"interactive_type":{"type":"string","title":"Interactive Type"},"header":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Header"},"body":{"type":"string","title":"Body"},"footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Footer"},"buttons":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Buttons"},"sections":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Sections"},"button_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Button Text"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"type":"object","required":["to","interactive_type","body"],"title":"WhatsAppInteractiveSend"},"WhatsAppMediaSend":{"properties":{"to":{"type":"string","title":"To"},"media_type":{"type":"string","title":"Media Type"},"media_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Url"},"media_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Id"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"type":"object","required":["to","media_type"],"title":"WhatsAppMediaSend"},"WhatsAppSendRequest":{"properties":{"to":{"type":"string","title":"To"},"message":{"type":"string","title":"Message"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"type":"object","required":["to","message"],"title":"WhatsAppSendRequest"},"WhatsAppTemplateSend":{"properties":{"to":{"type":"string","title":"To"},"template_name":{"type":"string","title":"Template Name"},"language_code":{"type":"string","title":"Language Code","default":"fr"},"components":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateComponent"},"type":"array"},{"type":"null"}],"title":"Components"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"type":"object","required":["to","template_name"],"title":"WhatsAppTemplateSend"},"WhisperRequest":{"properties":{"content":{"type":"string","maxLength":5000,"minLength":1,"title":"Content"},"target_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Agent Id","description":"If set, whisper only to this agent"}},"type":"object","required":["content"],"title":"WhisperRequest"},"WizardTestMessage":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"to":{"type":"string","title":"To"}},"type":"object","required":["bot_id","to"],"title":"WizardTestMessage"},"WizardValidateToken":{"properties":{"token":{"type":"string","title":"Token"},"bot_id":{"type":"string","title":"Bot Id"}},"type":"object","required":["token","bot_id"],"title":"WizardValidateToken"},"WizardVerifyPhone":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"phone_id":{"type":"string","title":"Phone Id"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"}},"type":"object","required":["bot_id","phone_id"],"title":"WizardVerifyPhone"},"_MergeRequest":{"properties":{"source_user_id":{"type":"string","title":"Source User Id"},"target_user_id":{"type":"string","title":"Target User Id"}},"type":"object","required":["source_user_id","target_user_id"],"title":"_MergeRequest"},"_PlanChangeRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"plan_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Expires At"}},"type":"object","required":["plan"],"title":"_PlanChangeRequest"},"app__api__automations__TriggerCondition":{"properties":{"type":{"type":"string","pattern":"^(page_url|time_on_page|visitor_return|message_contains|no_agent_reply|session_start|widget_open|custom_event)$","title":"Type"},"operator":{"type":"string","pattern":"^(equals|contains|starts_with|greater_than|less_than|regex)$","title":"Operator","default":"equals"},"value":{"type":"string","title":"Value","default":""}},"type":"object","required":["type"],"title":"TriggerCondition"},"app__api__bots__TemplateCreateRequest":{"properties":{"template_id":{"type":"string","maxLength":50,"title":"Template Id"},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"ai_model":{"type":"string","maxLength":100,"title":"Ai Model","default":""}},"type":"object","required":["template_id"],"title":"TemplateCreateRequest"},"app__api__channels__RoutingRule":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":500,"title":"Description","default":""},"conditions":{"items":{"$ref":"#/components/schemas/RoutingCondition"},"type":"array","minItems":1,"title":"Conditions"},"action":{"type":"string","pattern":"^(assign_bot|assign_agent|transfer|auto_reply|tag)$","title":"Action","default":"assign_bot"},"target_id":{"type":"string","maxLength":100,"title":"Target Id","description":"Bot ID, agent ID, or canned reply ID","default":""},"priority":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Priority","default":0},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name","conditions"],"title":"RoutingRule"},"app__api__contacts__SegmentCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":500,"title":"Description","default":""},"color":{"type":"string","maxLength":10,"title":"Color","default":"#6366f1"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"}},"type":"object","required":["bot_id","name"],"title":"SegmentCreate"},"app__api__proactive__TriggerCondition":{"properties":{"trigger_type":{"type":"string","title":"Trigger Type"},"page_pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Pattern"},"threshold_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold Seconds"},"custom_event_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Event Name"}},"type":"object","required":["trigger_type"],"title":"TriggerCondition"},"app__api__routing__RoutingRule":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"strategy":{"type":"string","pattern":"^(skills_match|workload|language|vip|round_robin|random|priority)$","title":"Strategy","default":"skills_match"},"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority","default":1},"conditions":{"additionalProperties":true,"type":"object","title":"Conditions"},"fallback_strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Strategy"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["name"],"title":"RoutingRule"},"app__api__segments__SegmentCreate":{"properties":{"bot_id":{"type":"string","title":"Bot Id"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"segment_type":{"type":"string","pattern":"^(dynamic|static)$","title":"Segment Type","default":"dynamic"},"rules":{"items":{"$ref":"#/components/schemas/FilterRule"},"type":"array","title":"Rules"},"contact_ids":{"items":{"type":"string"},"type":"array","title":"Contact Ids"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["bot_id","name"],"title":"SegmentCreate"},"app__api__whatsapp__TemplateCreateRequest":{"properties":{"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category","default":"UTILITY"},"language":{"type":"string","title":"Language","default":"fr"},"body_text":{"type":"string","title":"Body Text"},"footer_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Footer Text","default":"Envoyé via KONAN"},"header_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Text"},"variables":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Variables"},"bot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Id"}},"type":"object","required":["name","body_text"],"title":"TemplateCreateRequest"}}},"tags":[{"name":"Auth","description":"Authentication, registration, JWT tokens"},{"name":"Bots","description":"Bot CRUD, configuration, activation"},{"name":"Chat","description":"Chat sessions, messages, AI responses"},{"name":"Plans","description":"Subscription plans, billing"},{"name":"Analytics","description":"Bot analytics, conversations, CSAT"},{"name":"Inbox","description":"Live agent inbox, canned responses, notes"},{"name":"Webhooks","description":"Webhook endpoints, event delivery"},{"name":"Teams","description":"Team management, members, roles"},{"name":"Tickets","description":"Support ticket system"},{"name":"Contacts","description":"Contact management, CRM"},{"name":"Presence","description":"Agent online status, heartbeat"},{"name":"Notifications","description":"In-app notifications, preferences"},{"name":"Admin","description":"Platform administration (admin only)"}]}