{"openapi":"3.1.0","info":{"title":"Backend - Multilingual Voice Agent System","description":"FastAPI backend for multilingual voice agents with tool use","version":"1.0.0"},"paths":{"/auth/token":{"post":{"tags":["authentication"],"summary":"Login","description":"Login and get access token.\n\n**PERMANENT AUTHENTICATION:**\n- Users are retrieved from PostgreSQL database\n- owner_id is PERMANENT and never changes\n- Your agents will ALWAYS be accessible","operationId":"login_auth_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["authentication"],"summary":"Get User Info","description":"Get current user information.","operationId":"get_user_info_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/refresh":{"post":{"tags":["authentication"],"summary":"Refresh Token","description":"Refresh access token using refresh token.\n\n**How it works:**\n- Client sends refresh_token (30-day validity)\n- Server verifies refresh_token\n- Server issues new access_token (24-hour validity)\n- Server issues new refresh_token (30-day validity)\n\n**Use this when:**\n- Access token expires (after 24 hours)\n- You want to extend user session without re-login","operationId":"refresh_token_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/signup":{"post":{"tags":["authentication"],"summary":"Sign Up","description":"Sign up a new user and auto-create tenant for business users.\n\n**PERMANENT USER STORAGE:**\n- Users are stored in PostgreSQL database\n- owner_id is generated ONCE and persists forever\n- Agents are NEVER lost because owner_id never changes\n\n**User Roles:**\n- **BUSINESS**: Organization owner - automatically gets a tenant created\n- **DEVELOPER**: Technical user - no tenant created (uses platform features only)\n\n**What happens during signup:**\n1. User account is created in DATABASE (not memory)\n2. If role=BUSINESS → Tenant (organization) is automatically created\n3. User becomes the owner of their tenant\n4. Tenant ID = owner_id (for consistency)\n\n**Business User Flow:**\n- Sign up → Tenant auto-created → Create agents → Make calls\n\n**Developer User Flow:**  \n- Sign up → Access platform APIs → No tenant needed","operationId":"sign_up_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify":{"post":{"tags":["authentication"],"summary":"Verify Email","description":"Verify user email with JWT token.","operationId":"verify_email_auth_verify_post","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["authentication"],"summary":"Request Password Reset","description":"Request password reset token.","operationId":"request_password_reset_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password/confirm":{"post":{"tags":["authentication"],"summary":"Confirm Password Reset","description":"Confirm password reset with token.","operationId":"confirm_password_reset_auth_reset_password_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetConfirm"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/profile":{"put":{"tags":["authentication"],"summary":"Update User Profile","description":"Update user profile.","operationId":"update_user_profile_auth_profile_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/change-password":{"post":{"tags":["authentication"],"summary":"Change Password","description":"Change user password.","operationId":"change_password_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/set-password":{"post":{"tags":["authentication"],"summary":"Set Password","description":"Set a password for an OAuth user who doesn't have one.\nThis lets OAuth users add password login to their account.","operationId":"set_password_auth_set_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/logout":{"post":{"tags":["authentication"],"summary":"Logout","description":"Logout the current user.\n\nNote: JWT tokens are stateless, so this endpoint confirms the logout.\nThe frontend should discard the tokens. For token blacklisting,\nRedis-based revocation can be added later.","operationId":"logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/account":{"delete":{"tags":["authentication"],"summary":"Delete Account","description":"Deactivate the current user's account.\nSets is_active=False so the user can no longer login.\nAccount data is preserved for audit purposes.","operationId":"delete_account_auth_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/resend-verification":{"post":{"tags":["authentication"],"summary":"Resend Verification","description":"Resend email verification token for the current user.","operationId":"resend_verification_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/oauth/providers":{"get":{"tags":["oauth"],"summary":"List Oauth Providers","description":"Returns which OAuth providers are configured and available.\nFrontend uses this to show/hide social login buttons.","operationId":"list_oauth_providers_auth_oauth_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/oauth/{provider}/authorize":{"get":{"tags":["oauth"],"summary":"Oauth Authorize","description":"Returns the OAuth authorization URL for the given provider.\nFrontend should redirect the user to this URL.","operationId":"oauth_authorize_auth_oauth__provider__authorize_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/oauth/{provider}/callback":{"get":{"tags":["oauth"],"summary":"Oauth Callback","description":"Handles the OAuth callback. Exchanges the authorization code for user info,\ncreates or finds the user, and returns JWT tokens.\n\nThe frontend should verify the state parameter matches what was returned\nby /authorize before calling this endpoint.","operationId":"oauth_callback_auth_oauth__provider__callback_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"code","in":"query","required":true,"schema":{"type":"string","description":"Authorization code from provider","title":"Code"},"description":"Authorization code from provider"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"State parameter for CSRF verification","title":"State"},"description":"State parameter for CSRF verification"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/available":{"get":{"tags":["providers"],"summary":"Get Available Providers","description":"Get all configured and available providers.\n\n**Developer Workflow:**\n1. Call this endpoint to discover what providers you can use\n2. Use the returned provider names when creating agents\n3. System validates that you're using configured providers","operationId":"get_available_providers_providers_available_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_type","in":"query","required":false,"schema":{"type":"string","description":"Filter by service type: asr, tts, llm, mt","title":"Service Type"},"description":"Filter by service type: asr, tts, llm, mt"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/validate":{"get":{"tags":["providers"],"summary":"Validate Provider Configuration","description":"Validate if a provider is configured and available.","operationId":"validate_provider_configuration_providers_validate_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","description":"Provider name to validate","title":"Provider"},"description":"Provider name to validate"},{"name":"service_type","in":"query","required":true,"schema":{"type":"string","description":"Service type: asr, tts, llm, mt","title":"Service Type"},"description":"Service type: asr, tts, llm, mt"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/tts/providers":{"get":{"tags":["providers"],"summary":"Get Tts Providers Comprehensive","description":"🎙️ Get ALL TTS providers with complete configuration data.\n\n**Frontend Usage:**\nUse this to populate provider selection dropdowns and show capabilities.\n\n**Returns for each provider:**\n- Available models with language support\n- Pre-built voices with metadata\n- Latency and quality information\n- Configuration status\n- Agent configuration examples\n\n**Example Response:**\n```json\n{\n  \"providers\": {\n    \"elevenlabs\": {\n      \"name\": \"ElevenLabs\",\n      \"configured\": true,\n      \"models\": [...],\n      \"voices\": [...],\n      \"max_languages\": 74,\n      \"recommended_model\": \"eleven_flash_v2_5\"\n    }\n  }\n}\n```","operationId":"get_tts_providers_comprehensive_providers_tts_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/tts/providers/{provider}":{"get":{"tags":["providers"],"summary":"Get Tts Provider Details","description":"🎙️ Get detailed information for a specific TTS provider.\n\n**Includes:**\n- All models with language support details\n- All voices with metadata\n- Configuration examples\n- Language matrix","operationId":"get_tts_provider_details_providers_tts_providers__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/tts/voices":{"get":{"tags":["providers"],"summary":"Get All Tts Voices","description":"🎤 Get all available TTS voices across all providers.\n\n**Frontend Usage:**\nUse this to populate voice selection dropdowns with filtering.\n\n**Query Parameters:**\n- `provider`: Filter by provider (elevenlabs, openai, cartesia, deepgram)\n- `gender`: Filter by gender (male, female, neutral)\n- `language`: Filter by language code (e.g., 'en', 'es', 'zh')","operationId":"get_all_tts_voices_providers_tts_voices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider","title":"Provider"},"description":"Filter by provider"},{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by gender: male, female, neutral","title":"Gender"},"description":"Filter by gender: male, female, neutral"},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by supported language code","title":"Language"},"description":"Filter by supported language code"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/stt/providers":{"get":{"tags":["providers"],"summary":"Get Stt Providers Comprehensive","description":"🎧 Get ALL STT (Speech-to-Text) providers with complete configuration data.\n\n**Frontend Usage:**\nUse this to populate STT provider selection and show language support.\n\n**Returns for each provider:**\n- Available models with language support\n- Real-time/streaming capabilities\n- Diarization support\n- Agent configuration examples","operationId":"get_stt_providers_comprehensive_providers_stt_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/stt/providers/{provider}":{"get":{"tags":["providers"],"summary":"Get Stt Provider Details","description":"🎧 Get detailed information for a specific STT provider.","operationId":"get_stt_provider_details_providers_stt_providers__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/llm/providers":{"get":{"tags":["providers"],"summary":"Get Llm Providers Comprehensive","description":"🧠 Get ALL LLM (Language Model) providers with complete configuration data.\n\n**Frontend Usage:**\nUse this to populate model provider selection dropdowns and show capabilities.\n\n**Returns for each provider:**\n- Available models with latency, pricing, capabilities\n- Configuration status\n- Recommended models for voice agents\n- API key requirements\n\n**Example Response:**\n```json\n{\n  \"providers\": {\n    \"openai\": {\n      \"name\": \"OpenAI\",\n      \"configured\": true,\n      \"models\": {...},\n      \"default_model\": \"gpt-4o-mini\",\n      \"recommended_for_voice_agents\": \"gpt-4o-mini\"\n    }\n  }\n}\n```","operationId":"get_llm_providers_comprehensive_providers_llm_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/llm/providers/{provider}":{"get":{"tags":["providers"],"summary":"Get Llm Provider Details","description":"🧠 Get detailed information for a specific LLM provider.\n\n**Includes:**\n- All models with latency, pricing, capabilities\n- Configuration status\n- Recommended configurations for different use cases\n- Required environment variables","operationId":"get_llm_provider_details_providers_llm_providers__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/llm/models":{"get":{"tags":["providers"],"summary":"Get All Llm Models","description":"🧠 Get all available LLM models across all providers.\n\n**Frontend Usage:**\nUse this to populate model selection dropdowns with filtering.\n\n**Query Parameters:**\n- `provider`: Filter by provider (openai, anthropic, groq, etc.)\n- `capability`: Filter by capability (fast, multimodal, standard, reasoning, coding)\n- `max_latency_ms`: Filter by maximum latency","operationId":"get_all_llm_models_providers_llm_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider","title":"Provider"},"description":"Filter by provider"},{"name":"capability","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by capability: fast, multimodal, standard, reasoning, coding","title":"Capability"},"description":"Filter by capability: fast, multimodal, standard, reasoning, coding"},{"name":"max_latency_ms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by maximum latency in milliseconds","title":"Max Latency Ms"},"description":"Filter by maximum latency in milliseconds"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/llm/api-keys":{"get":{"tags":["providers"],"summary":"Get Llm Api Keys Status","description":"🔑 Get status of all LLM provider API keys.\n\n**Frontend Usage:**\nCheck which LLM providers are configured and which need API keys.\n\n**Returns:**\n- List of configured providers\n- List of missing API keys with environment variable names\n- Setup instructions","operationId":"get_llm_api_keys_status_providers_llm_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/languages":{"get":{"tags":["providers"],"summary":"Get All Languages","description":"🌍 Get all supported languages with full metadata.\n\n**Frontend Usage:**\nUse this to populate language selection dropdowns.\n\n**Returns:**\n- Language code (ISO 639-1)\n- Language name in English\n- Native name\n- Region","operationId":"get_all_languages_providers_languages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by region: europe, asia, africa, middle_east, oceania, global","title":"Region"},"description":"Filter by region: europe, asia, africa, middle_east, oceania, global"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/languages/{language_code}":{"get":{"tags":["providers"],"summary":"Get Language Provider Support","description":"🌍 Get provider support for a specific language.\n\n**Returns:**\n- Which TTS providers support this language\n- Which STT providers support this language\n- Recommended provider combinations\n- Model-specific support","operationId":"get_language_provider_support_providers_languages__language_code__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"language_code","in":"path","required":true,"schema":{"type":"string","title":"Language Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/agent-config/recommended":{"get":{"tags":["providers"],"summary":"Get Recommended Agent Config","description":"🤖 Get recommended provider configuration for creating an agent.\n\n**Frontend Usage:**\nCall this when user selects language/use case to auto-populate provider fields.\n\n**Parameters:**\n- `language`: Primary language (e.g., 'en', 'es', 'zh')\n- `use_case`: voice_agent, customer_support, call_center\n- `priority`: speed, quality, cost, balanced\n\n**Returns:**\nReady-to-use agent configuration with recommended providers.","operationId":"get_recommended_agent_config_providers_agent_config_recommended_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","description":"Primary language for the agent","default":"en","title":"Language"},"description":"Primary language for the agent"},{"name":"use_case","in":"query","required":false,"schema":{"type":"string","description":"Use case: voice_agent, customer_support, call_center","default":"voice_agent","title":"Use Case"},"description":"Use case: voice_agent, customer_support, call_center"},{"name":"priority","in":"query","required":false,"schema":{"type":"string","description":"Priority: speed, quality, cost, balanced","default":"balanced","title":"Priority"},"description":"Priority: speed, quality, cost, balanced"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/agent-config/schema":{"get":{"tags":["providers"],"summary":"Get Agent Config Schema","description":"📋 Get complete schema for agent voice configuration.\n\n**Frontend Usage:**\nUse this to build forms for agent creation/editing with proper validation.","operationId":"get_agent_config_schema_providers_agent_config_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/summary":{"get":{"tags":["providers"],"summary":"Get Providers Summary","description":"📊 Get a high-level summary of all providers and their capabilities.\n\nQuick reference for what's available in the system.","operationId":"get_providers_summary_providers_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/languages/matrix":{"get":{"tags":["providers"],"summary":"Get Language Support Matrix","description":"🌍 Get comprehensive language support matrix for ALL providers.\n\n**Frontend Usage:**\nUse this to show which languages are supported by which providers/models.\n\n**Returns:**\n- TTS providers with models and their supported languages\n- STT providers with models and their supported languages\n- LLM providers with models and their supported languages\n- Language-to-provider mapping for quick lookup","operationId":"get_language_support_matrix_providers_languages_matrix_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/providers/tts/voices/{provider}":{"get":{"tags":["providers"],"summary":"Get Tts Voices By Provider","description":"🎤 Get ALL voices for a specific TTS provider with full metadata.\n\n**Frontend Usage:**\nUse this to populate voice selection with filtering by gender, accent, and language.\n\n**Parameters:**\n- `provider`: elevenlabs, openai, cartesia, deepgram\n- `gender`: Filter by gender (male, female, neutral)\n- `accent`: Filter by accent (american, british, indian, etc)\n- `language`: Filter by primary or supported language\n\n**Returns:**\nComplete voice data with gender, accent, tone, and language support.","operationId":"get_tts_voices_by_provider_providers_tts_voices__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by gender: male, female, neutral","title":"Gender"},"description":"Filter by gender: male, female, neutral"},{"name":"accent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by accent: american, british, australian, etc","title":"Accent"},"description":"Filter by accent: american, british, australian, etc"},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by language code: en, es, ta, etc","title":"Language"},"description":"Filter by language code: en, es, ta, etc"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/stt/models":{"get":{"tags":["providers"],"summary":"Get All Stt Models","description":"🎧 Get ALL STT (transcriber) models with complete language support data.\n\n**Frontend Usage:**\nUse this to show which transcription models support which languages.\n\n**Returns:**\nAll STT models with languages per model, including OpenAI Whisper.","operationId":"get_all_stt_models_providers_stt_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider: deepgram, openai, assemblyai","title":"Provider"},"description":"Filter by provider: deepgram, openai, assemblyai"},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by language code","title":"Language"},"description":"Filter by language code"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/llm/models/comprehensive":{"get":{"tags":["providers"],"summary":"Get All Llm Models Comprehensive","description":"🧠 Get ALL LLM models with complete language support and capabilities.\n\n**Frontend Usage:**\nUse this to show which LLM models support which languages and capabilities.\n\n**Returns:**\nAll LLM providers with models, languages per model, and capabilities.","operationId":"get_comprehensive_llm_models","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider","title":"Provider"},"description":"Filter by provider"},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by language support","title":"Language"},"description":"Filter by language support"},{"name":"capability","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by capability: fast, reasoning, coding, vision","title":"Capability"},"description":"Filter by capability: fast, reasoning, coding, vision"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/voices/search":{"get":{"tags":["providers"],"summary":"Search Voices","description":"🔍 Search and filter voices across all providers.\n\n**Frontend Usage:**\nUse this for advanced voice search with multiple filters.\n\n**Example:**\n- /voices/search?language=ta&gender=female - Tamil female voices\n- /voices/search?accent=british&for_voice_agents=true - British voices for agents","operationId":"search_voices_providers_voices_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search voices by name, description, or use case","title":"Query"},"description":"Search voices by name, description, or use case"},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by language","title":"Language"},"description":"Filter by language"},{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by gender","title":"Gender"},"description":"Filter by gender"},{"name":"accent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by accent","title":"Accent"},"description":"Filter by accent"},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider","title":"Provider"},"description":"Filter by provider"},{"name":"for_voice_agents","in":"query","required":false,"schema":{"type":"boolean","description":"Only show voices recommended for voice agents","default":false,"title":"For Voice Agents"},"description":"Only show voices recommended for voice agents"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/voice-options":{"get":{"tags":["platform"],"summary":"Get Platform Voice Options","description":"Get voice service options that users can select and configure on your platform.","operationId":"get_platform_voice_options_platform_voice_options_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/platform/supported-languages":{"get":{"tags":["platform"],"summary":"Get Supported Languages","description":"Get languages supported by the platform.","operationId":"get_supported_languages_platform_supported_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/platform/pricing/calculator":{"get":{"tags":["platform"],"summary":"Get Pricing Calculator","description":"Calculate estimated pricing for platform usage.","operationId":"get_pricing_calculator_platform_pricing_calculator_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"en","title":"Language"}},{"name":"use_case","in":"query","required":false,"schema":{"type":"string","default":"customer_support","title":"Use Case"}},{"name":"monthly_calls","in":"query","required":false,"schema":{"type":"integer","default":1000,"title":"Monthly Calls"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/demo":{"get":{"tags":["platform"],"summary":"Get Platform Demo Info","description":"Get platform demo and trial information.","operationId":"get_platform_demo_info_platform_demo_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-services/integration-status":{"get":{"tags":["voice-services"],"summary":"Get Integration Status","description":"Get status of provider integrations (for platform owner monitoring).","operationId":"get_integration_status_voice_services_integration_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-services/livekit/regions":{"get":{"tags":["voice-services"],"summary":"Get Livekit Regions","description":"Get available LiveKit Cloud regions.\n\nThis endpoint proxies the LiveKit Cloud API to retrieve available regions.\nThe frontend cannot access LiveKit Cloud APIs directly due to authentication requirements.","operationId":"get_livekit_regions_voice_services_livekit_regions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-services/livekit-integration":{"get":{"tags":["voice-services"],"summary":"Get Livekit Integration Status","description":"Get detailed LiveKit integration status.","operationId":"get_livekit_integration_status_voice_services_livekit_integration_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice-services/provider-recommendations":{"get":{"tags":["voice-services"],"summary":"Get Provider Recommendations For Language","description":"Get provider recommendations for a specific language and use case.","operationId":"get_provider_recommendations_for_language_voice_services_provider_recommendations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"language","in":"query","required":true,"schema":{"type":"string","title":"Language"}},{"name":"use_case","in":"query","required":false,"schema":{"type":"string","default":"customer_support","title":"Use Case"}},{"name":"priority","in":"query","required":false,"schema":{"type":"string","default":"balanced","title":"Priority"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants":{"post":{"tags":["tenants"],"summary":"Create Tenant","description":"Create a new tenant (organization/customer) - Usually auto-created during signup.\n\n**⚠️ NOTE: For most users, tenants are AUTO-CREATED during signup!**\n\n**When to use this endpoint:**\n- **Platform Admins**: Manually create organizations for customers\n- **Recovery**: If auto-creation failed during signup\n- **Migration**: Importing existing organizations into the platform\n- **Advanced**: Creating additional sub-organizations\n\n**For Regular Users (BUSINESS role):**\n- Your tenant is **automatically created** when you sign up via `POST /auth/signup`\n- You don't need to call this endpoint\n- Your tenant_id = your owner_id (automatically linked)\n\n**What it does:**\n- Creates a new tenant account with unique ID (uses current_user.owner_id)\n- Sets up billing plan and usage limits\n- Configures SIP capabilities (if enabled)\n- Establishes compliance settings (HIPAA, PCI)\n- Encrypts sensitive credentials (SIP passwords)\n\n**Key Configuration:**\n- `name`: Organization name\n- `billing_plan`: Subscription tier (starter/business/enterprise)\n- `max_concurrent_calls`: Call capacity limit (1-1000)\n- `monthly_call_limit`: Monthly usage cap\n- `sip_enabled`: Enable phone number integration\n- `recording_enabled`: Call recording capability\n- `analytics_enabled`: Analytics dashboard access\n\n**User Flow Clarification:**\n1. **Sign up** → `POST /auth/signup` (role=BUSINESS) → Tenant auto-created ✅\n2. **Login** → `POST /auth/token` → Get access token\n3. **Create agents** → `POST /agents` → Start building\n\n❌ You do NOT need to manually create tenant after signup!","operationId":"create_tenant_tenants_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tenants"],"summary":"List Tenants","description":"List all tenants (for platform administrators).\n\n**Purpose:** View all tenants/organizations on the platform\n\n**What it does:**\n- Returns paginated list of all organizations\n- Supports filtering by status (active/inactive)\n- Used by platform admins to manage customers\n- Shows tenant overview for monitoring\n\n**Parameters:**\n- `limit`: Maximum number of tenants to return (default: 100)\n- `offset`: Number of tenants to skip for pagination (default: 0)\n- `status_filter`: Filter by tenant status (active/inactive/suspended)\n\n**Use Cases:**\n- Platform administration and monitoring\n- Customer account management\n- Bulk operations on tenants\n- Usage reporting across all customers","operationId":"list_tenants_tenants_get","security":[{"HTTPBearer":[]}],"parameters":[{"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"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tenant"},"title":"Response List Tenants Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","description":"Get detailed information about a specific tenant.\n\n**Purpose:** Retrieve complete tenant profile and configuration\n\n**What it does:**\n- Returns complete tenant profile\n- Shows billing, usage, and configuration details\n- Displays SIP settings and compliance status\n- Shows webhook configuration for integrations\n\n**Response Includes:**\n- Organization details (name, status, created_at)\n- Billing plan and usage limits\n- Feature flags (sip_enabled, recording_enabled, analytics_enabled)\n- Compliance settings (hipaa_enabled, pci_enabled)\n- Recording format and retention policy (retention_days)\n- Webhook URL for event notifications\n- Monthly usage tracking (monthly_usage_cents)\n- Creation and update timestamps\n\n**Use Cases:**\n- Viewing customer account details\n- Auditing tenant configuration\n- Billing and usage review\n- Support and troubleshooting","operationId":"get_tenant_tenants__tenant_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tenants"],"summary":"Update Tenant","description":"Update tenant settings and configuration.\n\n**Purpose:** Complete your organization setup or modify settings\n\n**👤 For Business Users After Signup:**\nAfter signing up, your tenant is auto-created with minimal fields (just name).\nUse this endpoint to complete your organization setup:\n- Set your organization name properly\n- Configure billing plan (starter/business/enterprise)\n- Set usage limits (max_concurrent_calls, monthly_call_limit)\n- Enable features (SIP, recording, analytics)\n- Configure compliance (HIPAA, PCI for healthcare/finance)\n\n**What it does:**\n- Update organization name and billing plan\n- Adjust usage limits and concurrent call capacity\n- Enable/disable features (SIP, recording, analytics)\n- Change compliance settings (HIPAA, PCI)\n- Update SIP credentials (automatically encrypted)\n- Modify webhook configuration for integrations\n\n**Common Use Cases:**\n- **Initial Setup:** After signup, set your org name and billing plan\n- **Upgrade subscription:** Change billing_plan, increase limits\n- **Enable phone calls:** Set sip_enabled=true, configure SIP details\n- **Enable enterprise features:** Set hipaa_enabled=true, pci_enabled=true\n- **Update webhook:** Change webhook_url for event notifications\n\n**Your tenant_id = your owner_id** (returned in login token)\n\n**Security Notes:**\n- SIP passwords are automatically encrypted before storage\n- Webhook secrets are stored securely\n- All changes are logged for audit trail","operationId":"update_tenant_tenants__tenant_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Tenant","description":"Delete tenant from the platform (PERMANENT).\n\n**Purpose:** Remove a tenant/organization from the platform\n\n**What it does:**\n- Permanently deletes tenant account\n- Used when customer cancels service\n- Removes all tenant data from the system\n\n**⚠️ WARNING - CASCADE DELETE:**\nThis operation permanently deletes ALL related data:\n- **All agents** created by this tenant\n- **Call history and recordings** (all calls)\n- **Workflows and integrations** (custom flows, API configs)\n- **Files and logs** (knowledge base, activity logs)\n- **SIP trunks** (phone number configurations)\n- **Squad configurations** (agent teams)\n\n**Use Cases:**\n- Customer account cancellation\n- Service termination\n- Data cleanup after trial expiration\n\n**Recommended Practice:**\n- Export/backup tenant data before deletion\n- Verify tenant has no active calls/sessions\n- Notify customer before deletion\n- Consider soft-delete (status=inactive) instead","operationId":"delete_tenant_tenants__tenant_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/stats":{"get":{"tags":["tenants"],"summary":"Get Tenant Stats","description":"Get tenant usage statistics and analytics.\n\n**Purpose:** View usage statistics, performance metrics, and billing data\n\n**What it returns:**\n```json\n{\n  \"tenant_id\": \"uuid\",\n  \"total_agents\": 5,              // Number of AI agents created\n  \"total_calls_today\": 23,        // Today's call volume\n  \"total_calls_month\": 456,       // Monthly call volume\n  \"avg_call_duration\": 180.5,     // Average call length (seconds)\n  \"avg_sentiment_score\": 0.75,    // Customer satisfaction (-1 to 1)\n  \"active_sessions\": 3,            // Current active calls/sessions\n  \"monthly_usage_cents\": 1250,    // Billing amount for current month\n  \"last_call_at\": \"2025-10-02T10:30:00Z\"  // Last call timestamp\n}\n```\n\n**Used For:**\n- **Billing calculations:** Track monthly_usage_cents for invoicing\n- **Usage monitoring:** Check if approaching monthly_call_limit\n- **Customer dashboards:** Display usage stats to tenant users\n- **Capacity planning:** Monitor concurrent calls vs max_concurrent_calls\n- **Performance tracking:** Average call duration and sentiment scores\n- **Support insights:** Identify usage patterns and issues\n\n**Real-World Scenarios:**\n- Admin sees tenant approaching limit → proactively offer upgrade\n- Customer views their dashboard → sees call volume trends\n- Billing system queries stats → generates monthly invoice\n- Support team checks stats → troubleshoots customer issues","operationId":"get_tenant_stats_tenants__tenant_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/generate-system-prompt":{"post":{"tags":["agents"],"summary":"Generate a full system prompt from a short brief","description":"Expand a 1-2 sentence brief into a production-ready voice-agent system prompt.\n\nThe frontend's \"Generate\" button hits this. The result is returned, not\nstored — the operator reviews/edits before posting it as `system_prompt`\nin the agent create/update payload.","operationId":"generate_system_prompt_agents_generate_system_prompt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSystemPromptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSystemPromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/agents":{"post":{"tags":["agents"],"summary":"Create Agent","description":"Create a new agent using LiveKit Cloud for all media/dispatch config.","operationId":"create_agent_agents_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agents"],"summary":"List Agents","description":"List agents for the current user.","operationId":"list_agents_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"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"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/AgentStatus"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Agent"},"title":"Response List Agents Agents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/multipart":{"post":{"tags":["agents"],"summary":"Create Agent With Documents","description":"Create a new agent with document uploads (integrated with External Factory).\n\nThis endpoint allows creating an agent and uploading knowledge base documents in one request.\nUses the integrated CreateAgentUseCase with file support.","operationId":"create_agent_with_documents_agents_multipart_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_agent_with_documents_agents_multipart_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/agents/{agent_id}":{"get":{"tags":["agents"],"summary":"Get Agent","description":"Get agent by ID.","operationId":"get_agent_agents__agent_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agents"],"summary":"Update Agent","description":"Update agent using integrated use case.","operationId":"update_agent_agents__agent_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agents"],"summary":"Delete Agent","description":"Delete agent using integrated use case.\n\nThis will:\n- Delete ALL phone numbers associated with the agent\n- Clean up ALL LiveKit resources (inbound trunks, outbound trunks, dispatch rules)\n- Delete the agent's knowledge base\n- Delete the agent from the database (cascades to tools, sessions, etc.)","operationId":"delete_agent_agents__agent_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/documents":{"post":{"tags":["agents"],"summary":"Upload Documents","description":"Upload documents to agent knowledge base using integrated use case.","operationId":"upload_documents_agents__agent_id__documents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_documents_agents__agent_id__documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-knowledge"],"summary":"List Documents","description":"List all documents in an agent's knowledge base (Local System).\n\nReturns metadata for all uploaded documents including:\n- Document ID\n- Filename\n- Content type\n- Upload timestamp\n- File size","operationId":"list_documents_agents__agent_id__documents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/knowledge/urls":{"post":{"tags":["agent-knowledge"],"summary":"Add Knowledge Urls","description":"Add knowledge base URLs to an existing agent.\n\n**PHASE 3 MIGRATION**: Now scrapes websites locally and adds to knowledge base.\n\nThis endpoint:\n- Fetches content from the provided URLs\n- Extracts text from HTML\n- Chunks and embeds the content locally\n- Stores in local FAISS vector index\n- Makes web content immediately searchable for RAG\n\nExample:\n```json\n{\n  \"urls\": [\n    \"https://company.com/about\",\n    \"https://docs.company.com/api-guide\"\n  ]\n}\n```\n\nSupports:\n- HTTP/HTTPS URLs\n- HTML content extraction\n- Concurrent fetching (up to 3 URLs at once)\n- Automatic chunking and embedding","operationId":"add_knowledge_urls_agents__agent_id__knowledge_urls_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddKnowledgeUrlsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddKnowledgeUrlsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/chat":{"post":{"tags":["agent-chat"],"summary":"Chat With Agent","description":"Send a text message to an agent and get a response.\n\nThis endpoint allows REST API-based interactions with agents,\nuseful for:\n- Web chat interfaces\n- API integrations\n- Testing agent behavior\n- Non-voice applications\n\nExample:\n```json\n{\n  \"query\": \"What is your refund policy?\",\n  \"conversation_id\": \"conv-123\",  // Optional, for follow-up\n  \"top_k\": 5\n}\n```\n\nResponse:\n```json\n{\n  \"response\": \"Our refund policy allows...\",\n  \"payload\": null,\n  \"selected_tool\": null,\n  \"conversation_id\": \"conv-123\",\n  \"trace_id\": \"trace-abc\",\n  \"execution_time_ms\": 850,\n  \"versions\": {\"kb_v\": \"1.0\", \"policy_v\": \"1.0\", \"tools_v\": \"1.0\"}\n}\n```","operationId":"chat_with_agent_agents__agent_id__chat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"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"}}}}}}},"/agents/{agent_id}_old":{"put":{"tags":["agents"],"summary":"Update Agent Old","description":"Update agent (old implementation - deprecated).","operationId":"update_agent_old_agents__agent_id__old_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/legacy":{"delete":{"tags":["agents"],"summary":"Delete Agent Legacy","description":"Delete agent from local database.\n\n**Use DELETE /{agent_id} instead - it provides more comprehensive cleanup.**\n\nThis legacy endpoint:\n- Delete agent from local database\n- Delete all associated data (sessions, knowledge base, etc.)","operationId":"delete_agent_legacy","deprecated":true,"security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools/available":{"get":{"tags":["agents"],"summary":"Get Available Tools","description":"Get available tools for an agent.","operationId":"get_available_tools_agents__agent_id__tools_available_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ToolRegistryItem"},"title":"Response Get Available Tools Agents  Agent Id  Tools Available Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools/{tool_key}/enable":{"post":{"tags":["agents"],"summary":"Enable Tool For Agent","description":"Enable a tool for an agent.","operationId":"enable_tool_for_agent_agents__agent_id__tools__tool_key__enable_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Config"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools/{tool_key}/disable":{"post":{"tags":["agents"],"summary":"Disable Tool For Agent","description":"Disable a tool for an agent.","operationId":"disable_tool_for_agent_agents__agent_id__tools__tool_key__disable_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/test":{"post":{"tags":["agent-management"],"summary":"Test Agent Configuration","description":"Test agent configuration with sample input.","operationId":"test_agent_configuration_agents__agent_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Test Input"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/conversations":{"get":{"tags":["agent-sessions"],"summary":"List Agent Conversations","description":"List all conversation sessions for an agent.\n\nReturns a paginated list of conversations with summary information.\nUse this to:\n- View conversation history\n- Audit agent interactions\n- Find specific conversations\n- Track agent usage\n\nExample response:\n```json\n{\n  \"sessions\": [\n    {\n      \"conversation_id\": \"conv-123\",\n      \"created_at\": \"2025-11-25T10:00:00Z\",\n      \"updated_at\": \"2025-11-25T10:05:00Z\",\n      \"message_count\": 12,\n      \"last_message_preview\": \"Thank you for your help!\"\n    }\n  ],\n  \"total\": 45,\n  \"limit\": 10,\n  \"offset\": 0\n}\n```","operationId":"list_agent_conversations_agents__agent_id__conversations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of sessions to return","default":10,"title":"Limit"},"description":"Number of sessions to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination","default":0,"title":"Offset"},"description":"Offset for pagination"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/conversations/{conversation_id}":{"get":{"tags":["agent-sessions"],"summary":"Get Conversation Detail","description":"Get full conversation history with all messages.\n\nReturns complete conversation transcript including:\n- All user messages\n- All agent responses\n- Tool executions\n- Timestamps\n- Metadata\n\nUse this for:\n- Reviewing agent performance\n- Debugging conversations\n- Customer service audits\n- Training data collection\n\nExample response:\n```json\n{\n  \"conversation_id\": \"conv-123\",\n  \"agent_id\": \"agent-456\",\n  \"created_at\": \"2025-11-25T10:00:00Z\",\n  \"updated_at\": \"2025-11-25T10:05:00Z\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"What is your refund policy?\",\n      \"timestamp\": \"2025-11-25T10:00:00Z\"\n    },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"Our refund policy...\",\n      \"timestamp\": \"2025-11-25T10:00:02Z\",\n      \"metadata\": {\"selected_tool\": null, \"execution_time_ms\": 850}\n    }\n  ]\n}\n```","operationId":"get_conversation_detail_agents__agent_id__conversations__conversation_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-sessions"],"summary":"Delete Conversation","description":"Delete a conversation and all its messages.\n\nUse this to:\n- Remove sensitive conversations\n- Clean up test data\n- Comply with data deletion requests\n\nWarning: This action is irreversible.","operationId":"delete_conversation_agents__agent_id__conversations__conversation_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/sessions":{"get":{"tags":["agent-sessions"],"summary":"List Agent Sessions","description":"List all chat sessions for an agent (alias for /conversations).\n\nReturns a paginated list of sessions including:\n- Session ID\n- Start/end timestamps\n- Message counts\n- Status\n\nUse this to track conversations during live text chat.","operationId":"list_agent_sessions_agents__agent_id__sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of sessions to return","default":10,"title":"Limit"},"description":"Number of sessions to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination","default":0,"title":"Offset"},"description":"Offset for pagination"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/sessions/{session_id}":{"get":{"tags":["agent-sessions"],"summary":"Get Session Detail","description":"Get session detail (alias for /conversations/{conversation_id}).\n\nReturns full conversation history for a session.","operationId":"get_session_detail_agents__agent_id__sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"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"}}}}}}},"/agents/{agent_id}/documents/upload":{"post":{"tags":["agent-knowledge"],"summary":"Upload Documents","description":"Upload PDF/document files to an agent's knowledge base.\n\n**PHASE 3 MIGRATION**: Now uses local vector store (FAISS) instead of external factory.\n\nThis endpoint:\n- Accepts multiple PDF/document files\n- Processes them locally (extract text, chunk, embed)\n- Stores embeddings in local FAISS vector index\n- Makes documents immediately searchable for RAG\n\nSupported formats: PDF, TXT, DOCX, MD\nMax file size: 10MB per file","operationId":"upload_documents_agents__agent_id__documents_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_documents_agents__agent_id__documents_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadDocumentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/tasks/{task_id}":{"get":{"tags":["agent-knowledge"],"summary":"Get Task Status","description":"Get the status of a background task.\n\nUse this to track:\n- Knowledge base processing\n- Document uploads\n- URL ingestion\n\nStatus values:\n- `pending`: Task queued but not started\n- `running`: Task is currently processing\n- `completed`: Task finished successfully\n- `failed`: Task encountered an error\n\nExample:\n```\nGET /agents/tasks/task_abc123\n```","operationId":"get_task_status_agents_tasks__task_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/knowledge/stats":{"get":{"tags":["agent-knowledge"],"summary":"Get Knowledge Base Stats","description":"Get knowledge base statistics for an agent (Local System).\n\nReturns:\n- Total chunk count\n- Current KB version\n- Processing status\n- Document count\n\nUse this to:\n- Monitor KB size and capacity\n- Check processing status\n- Debug KB issues","operationId":"get_knowledge_base_stats_agents__agent_id__knowledge_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/knowledge/reindex":{"post":{"tags":["agent-knowledge"],"summary":"Reindex Knowledge Base","description":"Trigger knowledge base reindexing (Local System).\n\nUse this to:\n- Fix broken/corrupted KB\n- Update embeddings after changes\n- Refresh stale data\n\nIn the local system, this rebuilds the FAISS index from stored documents.","operationId":"reindex_knowledge_base_agents__agent_id__knowledge_reindex_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/documents/{document_id}":{"delete":{"tags":["agent-knowledge"],"summary":"Delete Document","description":"Delete a specific document from the knowledge base.\n\nThis will:\n- Remove the document file\n- Delete all associated chunks\n- Update the knowledge base index\n\nWarning: This action is irreversible.","operationId":"delete_document_agents__agent_id__documents__document_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools":{"post":{"tags":["Agent Tools"],"summary":"Create Agent Tool","description":"Add a tool *instance* to an agent.\n\nMultiple instances of the same tool_key are allowed as long as their\n`instance_name` differs. The `instance_name` is the function name the LLM\nwill use when calling the tool, so it must be unique per agent and a\nvalid identifier (letters/digits/underscore/hyphen).","operationId":"create_agent_tool_agents__agent_id__tools_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Agent Tools"],"summary":"List Agent Tools","description":"List all tool instances configured for an agent.","operationId":"list_agent_tools_agents__agent_id__tools_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ToolResponse"},"title":"Response List Agent Tools Agents  Agent Id  Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools/{instance_name}":{"get":{"tags":["Agent Tools"],"summary":"Get Agent Tool","description":"Get a specific tool instance by instance_name.","operationId":"get_agent_tool_agents__agent_id__tools__instance_name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"instance_name","in":"path","required":true,"schema":{"type":"string","title":"Instance Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Agent Tools"],"summary":"Update Agent Tool","description":"Patch a specific tool instance.","operationId":"update_agent_tool_agents__agent_id__tools__instance_name__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"instance_name","in":"path","required":true,"schema":{"type":"string","title":"Instance Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agent Tools"],"summary":"Delete Agent Tool","description":"Soft-delete a tool instance (hard_delete=true to permanently remove).","operationId":"delete_agent_tool_agents__agent_id__tools__instance_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"instance_name","in":"path","required":true,"schema":{"type":"string","title":"Instance Name"}},{"name":"hard_delete","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Hard Delete"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools/{instance_name}/execute":{"post":{"tags":["Agent Tools"],"summary":"Execute Agent Tool","description":"Execute a tool instance manually (for testing/direct invocation).","operationId":"execute_agent_tool_agents__agent_id__tools__instance_name__execute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"instance_name","in":"path","required":true,"schema":{"type":"string","title":"Instance Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__controllers__agent_tools__ToolExecuteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/tools/registry/available":{"get":{"tags":["Agent Tools"],"summary":"List Available Tools","description":"List all tool *types* from the registry (one entry per tool_key).","operationId":"list_available_tools_agents__agent_id__tools_registry_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Available Tools Agents  Agent Id  Tools Registry Available Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/transfer-targets":{"post":{"tags":["transfer-targets"],"summary":"Create Transfer Target","operationId":"create_transfer_target_transfer_targets_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferTargetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferTargetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["transfer-targets"],"summary":"List Transfer Targets","operationId":"list_transfer_targets_transfer_targets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransferTargetResponse"},"title":"Response List Transfer Targets Transfer Targets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/transfer-targets/{target_id}":{"get":{"tags":["transfer-targets"],"summary":"Get Transfer Target","operationId":"get_transfer_target_transfer_targets__target_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferTargetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["transfer-targets"],"summary":"Update Transfer Target","operationId":"update_transfer_target_transfer_targets__target_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferTargetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferTargetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["transfer-targets"],"summary":"Delete Transfer Target","operationId":"delete_transfer_target_transfer_targets__target_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/personas":{"post":{"tags":["personas"],"summary":"Create Persona","operationId":"create_persona_personas_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["personas"],"summary":"List Personas","operationId":"list_personas_personas_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PersonaResponse"},"title":"Response List Personas Personas Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/personas/by-type/{specialist_type}":{"get":{"tags":["personas"],"summary":"Get Persona By Type","description":"Resolve a specialist_type slug → persona row (for handoff resolution).","operationId":"get_persona_by_type_personas_by_type__specialist_type__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"specialist_type","in":"path","required":true,"schema":{"type":"string","title":"Specialist Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/personas/{persona_id}":{"get":{"tags":["personas"],"summary":"Get Persona","operationId":"get_persona_personas__persona_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Persona Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["personas"],"summary":"Update Persona","operationId":"update_persona_personas__persona_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Persona Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["personas"],"summary":"Delete Persona","operationId":"delete_persona_personas__persona_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"persona_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Persona Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/bootstrap":{"get":{"tags":["agent-bootstrap"],"summary":"Bootstrap Agent","description":"Aggregate a full snapshot of an agent's runtime configuration.\n\nReturns: agent record fields, the attached workflow (if any), every tool\n*instance* with its full config, every centralized transfer_target the\nowner has, the tenant's handoff persona registry joined to the backing\nagents (`available_specialists`), and tool_connection identifiers\n(auth_payload is redacted so this is safe to ship to a voice worker).","operationId":"bootstrap_agent_agents__agent_id__bootstrap_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"post":{"tags":["mcp"],"summary":"Mcp Jsonrpc","description":"Single MCP endpoint — dispatches `tools/list`, `tools/call`, `ping`.","operationId":"mcp_jsonrpc_mcp_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mcp Jsonrpc Mcp Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/manifest":{"get":{"tags":["mcp"],"summary":"Mcp Manifest","description":"Public discovery manifest — no auth required.","operationId":"mcp_manifest_mcp_manifest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mcp Manifest Mcp Manifest Get"}}}}}}},"/config/providers/available":{"get":{"tags":["agent-configuration"],"summary":"Get Available Providers","description":"Get available providers for model, voice, and transcription.","operationId":"get_available_providers_config_providers_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/config/templates":{"get":{"tags":["agent-configuration"],"summary":"Get Use Case Templates","description":"Get all available templates (system built-in + user-created + public).\n\nReturns both hardcoded templates and custom templates from database.","operationId":"get_use_case_templates_config_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["agent-configuration"],"summary":"Create Template","description":"Create a custom agent template.\n\nAllows users to create their own reusable templates for agent creation.","operationId":"create_template_config_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/config/agents/{agent_id}/configure":{"post":{"tags":["agent-configuration"],"summary":"Configure Agent","description":"Update agent configuration with enhanced settings.","operationId":"configure_agent_config_agents__agent_id__configure_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__controllers__agent_config__AgentConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/agents/{agent_id}/apply-template":{"post":{"tags":["agent-configuration"],"summary":"Apply Use Case Template","description":"Apply a use case template to an agent.","operationId":"apply_use_case_template_config_agents__agent_id__apply_template_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UseCaseTemplate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/agents/{agent_id}/validate":{"get":{"tags":["agent-configuration"],"summary":"Validate Agent Configuration","description":"Validate agent configuration and get optimization suggestions.","operationId":"validate_agent_configuration_config_agents__agent_id__validate_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/voices":{"get":{"tags":["agent-configuration"],"summary":"Get All Voices With Previews","description":"Get all available voices from all TTS providers with preview URLs stored in MinIO.\n\nThis endpoint:\n1. Fetches all voices from provider APIs (when configured)\n2. Generates preview audio for all voices (pre-generated at startup)\n3. Stores all previews in MinIO object storage\n4. Returns MinIO URLs for all previews\n\n**Comprehensive Filtering:**\n- Provider: Filter by TTS provider\n- Gender: male, female, neutral\n- Language: Single language code (e.g., 'en', 'ta', 'hi')\n- Languages: Multiple languages (comma-separated, e.g., 'en,es,fr')\n- Accent: american, british, spanish, french, german, indian, etc.\n- Age: young, middle_aged, old\n- Tone: warm, professional, friendly, authoritative, energetic, etc.\n- Use Case: voice_agents, customer_service, narration, marketing, etc.\n- Recommended: Filter for recommended voices only\n- Multilingual: Filter for multilingual voices only\n- Region: africa, asia, europe, middle_east, oceania, global\n- Primary Language: Filter by voice's primary language\n\n**All previews are stored in MinIO and pre-generated at startup for fast access.**","operationId":"get_all_voices_with_previews_config_voices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by provider: elevenlabs, openai, cartesia, deepgram","title":"Provider"},"description":"Filter by provider: elevenlabs, openai, cartesia, deepgram"},{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by gender: male, female, neutral","title":"Gender"},"description":"Filter by gender: male, female, neutral"},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by language code (e.g., 'en', 'es', 'fr', 'ta', 'hi')","title":"Language"},"description":"Filter by language code (e.g., 'en', 'es', 'fr', 'ta', 'hi')"},{"name":"languages","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by multiple languages (comma-separated, e.g., 'en,es,fr')","title":"Languages"},"description":"Filter by multiple languages (comma-separated, e.g., 'en,es,fr')"},{"name":"accent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by accent: american, british, australian, spanish, french, german, indian, etc.","title":"Accent"},"description":"Filter by accent: american, british, australian, spanish, french, german, indian, etc."},{"name":"age","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by age: young, middle_aged, old","title":"Age"},"description":"Filter by age: young, middle_aged, old"},{"name":"tone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by tone: warm, professional, friendly, authoritative, energetic, etc.","title":"Tone"},"description":"Filter by tone: warm, professional, friendly, authoritative, energetic, etc."},{"name":"use_case","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by use case: voice_agents, customer_service, narration, marketing, etc.","title":"Use Case"},"description":"Filter by use case: voice_agents, customer_service, narration, marketing, etc."},{"name":"recommended","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter for recommended voices only","title":"Recommended"},"description":"Filter for recommended voices only"},{"name":"multilingual","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter for multilingual voices only","title":"Multilingual"},"description":"Filter for multilingual voices only"},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by region: africa, asia, europe, middle_east, oceania, global","title":"Region"},"description":"Filter by region: africa, asia, europe, middle_east, oceania, global"},{"name":"primary_language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by primary language of the voice","title":"Primary Language"},"description":"Filter by primary language of the voice"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/voices/filters":{"get":{"tags":["agent-configuration"],"summary":"Get Voice Filter Metadata","description":"Get available filter options and metadata for voice selection.\n\n**Frontend Usage:**\nUse this endpoint to:\n1. Build filter UI components (dropdowns, checkboxes, etc.)\n2. Know which filters are available per provider\n3. Understand filter types and their options\n\n**Returns:**\n- All available filter options\n- Filter options per provider\n- Filter descriptions and types\n- Example filter combinations","operationId":"get_voice_filter_metadata_config_voices_filters_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get filters for specific provider","title":"Provider"},"description":"Get filters for specific provider"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/voices/refresh-urls":{"post":{"tags":["agent-configuration"],"summary":"Refresh Voice Preview Urls","description":"Force refresh of all voice preview URLs.\n\nThis clears the cached preview URLs and regenerates them with correct public URLs.\nUse this if preview URLs are returning internal/unreachable addresses.\n\n**Admin/Debug endpoint** - typically only needed after server configuration changes.","operationId":"refresh_voice_preview_urls_config_voices_refresh_urls_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/config/agents/{agent_id}/voices":{"get":{"tags":["agent-configuration"],"summary":"Get Available Voices","description":"Get available voices for an agent based on its language configuration.","operationId":"get_available_voices_config_agents__agent_id__voices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Voice provider to filter by","title":"Provider"},"description":"Voice provider to filter by"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/agents/{agent_id}/estimate-costs":{"post":{"tags":["agent-configuration"],"summary":"Estimate Agent Costs","description":"Estimate costs for an agent based on configuration and projected usage.","operationId":"estimate_agent_costs_config_agents__agent_id__estimate_costs_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Usage Projection"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/config/templates/{template_id}":{"get":{"tags":["agent-configuration"],"summary":"Get Template","description":"Get a specific template by ID.","operationId":"get_template_config_templates__template_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-configuration"],"summary":"Update Template","description":"Update a custom template.","operationId":"update_template_config_templates__template_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-configuration"],"summary":"Delete Template","description":"Delete a custom template.","operationId":"delete_template_config_templates__template_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/configuration":{"get":{"tags":["agent-management"],"summary":"Get Agent Configuration","description":"Get complete agent configuration.","operationId":"get_agent_configuration_agents__agent_id__configuration_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__controllers__agent_management__AgentConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/stats":{"get":{"tags":["agent-management"],"summary":"Get Agent Statistics","description":"Get agent performance statistics.","operationId":"get_agent_statistics_agents__agent_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"period_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Period in days","default":30,"title":"Period Days"},"description":"Period in days"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/clone":{"post":{"tags":["agent-management"],"summary":"Clone Agent","description":"Clone an existing agent with modifications.","operationId":"clone_agent_agents__agent_id__clone_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Clone Config"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/activate":{"post":{"tags":["agent-management"],"summary":"Activate Agent","description":"Activate an agent (move from draft to active).","operationId":"activate_agent_agents__agent_id__activate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/deactivate":{"post":{"tags":["agent-management"],"summary":"Deactivate Agent","description":"Deactivate an agent (pause operations).","operationId":"deactivate_agent_agents__agent_id__deactivate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/versions":{"get":{"tags":["agent-management"],"summary":"List Agent Versions","description":"List all versions of an agent.","operationId":"list_agent_versions_agents__agent_id__versions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/status":{"get":{"tags":["agent-management"],"summary":"Get Agent Status","description":"Get agent status (Local Agent System).\n\nReturns comprehensive status including configuration,\nknowledge base, tools, and operational metrics.","operationId":"get_agent_status_agents__agent_id__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/unified/agents/{agent_id}/config":{"get":{"tags":["unified-agent-config","unified-agent-config"],"summary":"Get Agent Configuration","description":"Get comprehensive agent configuration.","operationId":"get_agent_configuration_unified_agents__agent_id__config_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__controllers__unified_agent_config__AgentConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["unified-agent-config","unified-agent-config"],"summary":"Update Agent Configuration","description":"Update comprehensive agent configuration.","operationId":"update_agent_configuration_unified_agents__agent_id__config_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__controllers__unified_agent_config__AgentConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__controllers__unified_agent_config__AgentConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/unified/agents/{agent_id}/tools":{"post":{"tags":["unified-agent-config","unified-agent-config"],"summary":"Update Agent Tools","description":"Update agent tools configuration.","operationId":"update_agent_tools_unified_agents__agent_id__tools_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ToolConfigUpdate"},"title":"Tools Update"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Agent Tools Unified Agents  Agent Id  Tools Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/unified/agents/{agent_id}/workflow":{"post":{"tags":["unified-agent-config","unified-agent-config"],"summary":"Associate Workflow","description":"Associate a workflow with an agent.\n\nValidation checks:\n- Agent exists and user owns it\n- Workflow exists and user owns it\n- Workflow belongs to same tenant as agent\n- Workflow is active (not archived)\n- Workflow tools are available to agent (optional)","operationId":"associate_workflow_unified_agents__agent_id__workflow_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"workflow_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}},{"name":"validate_tools","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Validate Tools"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Associate Workflow Unified Agents  Agent Id  Workflow Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["unified-agent-config","unified-agent-config"],"summary":"Disassociate Workflow","description":"Disassociate workflow from an agent.","operationId":"disassociate_workflow_unified_agents__agent_id__workflow_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Disassociate Workflow Unified Agents  Agent Id  Workflow Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/phone-numbers":{"post":{"tags":["agent-phone-numbers"],"summary":"Register Phone Number","description":"Register a phone number for an agent.\n\nTwo modes of operation:\n\n1. **LiveKit Phone Numbers** (provider='livekit'):\n   - For numbers already purchased through LiveKit Cloud dashboard\n   - No SIP trunk configuration needed\n   - Simplified setup - just provide the phone number\n   - LiveKit automatically manages the infrastructure\n\n2. **External SIP Providers** (twilio, vonage, telnyx, etc.):\n   - You must already own the phone number\n   - Creates SIP dispatch rule in LiveKit\n   - Returns SIP URI to configure in provider's dashboard\n   - Supports both inbound and outbound calling","operationId":"register_phone_number_agents__agent_id__phone_numbers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterPhoneNumberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-phone-numbers"],"summary":"List Phone Numbers","description":"List all phone numbers registered for an agent.","operationId":"list_phone_numbers_agents__agent_id__phone_numbers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/supported-providers":{"get":{"tags":["agent-phone-numbers"],"summary":"Get Supported Providers","description":"Get list of supported SIP providers with their default outbound addresses.\n\nUse this endpoint to populate a dropdown in the frontend for provider selection.\nEach provider includes:\n- id: Provider identifier (e.g., 'twilio', 'vonage-eu')\n- name: Display name\n- default_sip_address: Default SIP server address for outbound calls\n- regions: Available regional variants\n- notes: Additional information\n\nUsers can always override the SIP address by providing a custom `outbound_address`\nwhen registering a phone number.","operationId":"get_supported_providers_agents_supported_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Get Supported Providers Agents Supported Providers Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/agents/provider-sip-address/{provider}":{"get":{"tags":["agent-phone-numbers"],"summary":"Get Provider Sip Address","description":"Get the default SIP address for a specific provider.\n\nArgs:\n    provider: Provider name (e.g., 'twilio', 'vonage-eu', 'telnyx')\n\nReturns:\n    Default SIP address for the provider, or null if not recognized.\n    \nNote: For providers not in our list, you must provide a custom `outbound_address`\nwhen registering a phone number with enable_outbound=true.","operationId":"get_provider_sip_address_agents_provider_sip_address__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/phone-numbers/{phone_number}":{"delete":{"tags":["agent-phone-numbers"],"summary":"Delete Phone Number","description":"Delete a phone number registration for an agent.\n\nFor LiveKit-managed numbers:\n- Releases the phone number from LiveKit (you're still billed for the month)\n- Deletes the dispatch rule\n- Removes from database\n\nFor external provider numbers:\n- Deletes the dispatch rule from LiveKit\n- Removes from database\n- You must manually remove the SIP URI from your provider's dashboard","operationId":"delete_phone_number_agents__agent_id__phone_numbers__phone_number__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-phone-numbers"],"summary":"Get Phone Number","description":"Get a specific phone number configuration.\n\nReturns complete phone number details including:\n- SIP URI for provider configuration\n- LiveKit dispatch rule ID\n- Provider-specific setup instructions\n- Outbound calling status","operationId":"get_phone_number_agents__agent_id__phone_numbers__phone_number__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["agent-phone-numbers"],"summary":"Update Phone Number","description":"Update phone number configuration.\n\nSupports partial updates:\n- enable_outbound: Enable/disable outbound calling\n- status: Change status (active, inactive, suspended)\n- provider_config: Update provider-specific configuration\n- metadata: Update metadata\n\n**Note:** Changing core SIP settings (trunk IDs, dispatch rules) requires \ndeleting and re-registering the phone number.\n\n**LiveKit Sync:** Status changes are reflected in LiveKit metadata, \nbut dispatch rules remain active. To fully remove from LiveKit, use DELETE.","operationId":"update_phone_number_agents__agent_id__phone_numbers__phone_number__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/phone-numbers/{phone_number}/health-check":{"post":{"tags":["agent-phone-numbers"],"summary":"Check Phone Number Health","description":"Check phone number health and LiveKit sync status.\n\nVerifies:\n- Phone number exists in database\n- Dispatch rule exists in LiveKit\n- SIP trunk is healthy\n- Configuration is valid\n\nReturns:\n{\n    \"phone_number\": \"+15551234567\",\n    \"status\": \"healthy\",\n    \"checks\": {\n        \"database\": true,\n        \"dispatch_rule\": true,\n        \"sip_trunk\": true,\n        \"livekit_sync\": true\n    },\n    \"issues\": []\n}","operationId":"check_phone_number_health_agents__agent_id__phone_numbers__phone_number__health_check_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/phone-numbers/bulk-upload":{"post":{"tags":["agent-phone-numbers"],"summary":"Bulk Upload Phone Numbers","description":"Bulk upload phone numbers from CSV file.\n\nCSV Format:\nphone_number,provider,enable_outbound,outbound_address,outbound_transport,destination_country,media_encryption,krisp_enabled,auth_username,auth_password\n\nExample CSV:\n```\nphone_number,provider,enable_outbound,outbound_address,outbound_transport,destination_country,media_encryption,krisp_enabled\n+15551234567,twilio,true,sip.twilio.com,TCP,US,ALLOW,true\n+15559876543,vonage,true,sip.nexmo.com,TLS,US,ALLOW,true\n+918012345678,plivo,true,sip.plivo.com,TLS,IN,REQUIRE,true\n```\n\nThis endpoint processes the CSV file and registers all phone numbers in bulk.\nEach row is processed independently - partial success is possible.","operationId":"bulk_upload_phone_numbers_agents__agent_id__phone_numbers_bulk_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_bulk_upload_phone_numbers_agents__agent_id__phone_numbers_bulk_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/sip/diagnose/{phone_number}":{"get":{"tags":["agent-phone-numbers"],"summary":"Diagnose Sip Trunk","description":"Diagnose SIP trunk configuration for a phone number.\n\nReturns detailed information about:\n- Whether a trunk exists in LiveKit\n- Configured allowed_addresses (IP allowlist)\n- Whether a dispatch rule exists\n- Issues and recommendations\n\nUse this to troubleshoot inbound calls not reaching LiveKit.","operationId":"diagnose_sip_trunk_agents_sip_diagnose__phone_number__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Diagnose Sip Trunk Agents Sip Diagnose  Phone Number  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/sip/list-trunks":{"get":{"tags":["agent-phone-numbers"],"summary":"List Sip Trunks","description":"List all SIP inbound trunks from LiveKit.\n\nReturns trunk details including:\n- Trunk ID and name\n- Phone numbers on each trunk\n- Allowed addresses (IP allowlist)\n- Authentication status\n\nUse this to see what's configured in LiveKit.","operationId":"list_sip_trunks_agents_sip_list_trunks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Sip Trunks Agents Sip List Trunks Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/agents/sip/fix-trunk/{phone_number}":{"post":{"tags":["agent-phone-numbers"],"summary":"Fix Sip Trunk","description":"Fix SIP trunk by deleting and recreating with correct IP allowlist.\n\nUse this when inbound calls aren't reaching LiveKit due to IP allowlist issues.\n\n**CAUTION**: This will:\n1. Delete the existing trunk\n2. Create a new trunk with correct provider IPs\n3. The trunk_id will change\n4. You may need to re-register the phone number to recreate dispatch rules\n\nArgs:\n    phone_number: The phone number to fix (E.164 format)\n    provider: SIP provider (telnyx, twilio, vonage, plivo, etc.)","operationId":"fix_sip_trunk_agents_sip_fix_trunk__phone_number__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","default":"telnyx","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fix Sip Trunk Agents Sip Fix Trunk  Phone Number  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/transcripts":{"get":{"tags":["agent-transcripts"],"summary":"List Transcripts","description":"List all transcripts for an agent.\n\nReturns a paginated list of conversation transcripts with summary information.","operationId":"list_transcripts_agents__agent_id__transcripts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of transcripts to return","default":50,"title":"Limit"},"description":"Number of transcripts to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of transcripts to skip","default":0,"title":"Offset"},"description":"Number of transcripts to skip"},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by channel: web, sip","title":"Channel"},"description":"Filter by channel: web, sip"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: completed, active, ended","title":"Status"},"description":"Filter by status: completed, active, ended"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/transcripts/{session_id}":{"get":{"tags":["agent-transcripts"],"summary":"Get Transcript","description":"Get full transcript for a specific session.\n\nReturns the complete conversation history with all messages,\nmetadata, and AI-generated summary/analysis.\n\nThe `ai_summary` field contains:\n- **summary**: Concise overview of the conversation\n- **sentiment**: Sentiment analysis with score (-1.0 to 1.0)\n- **topics**: Main topics discussed\n- **action_items**: Any follow-up actions identified\n- **key_moments**: Important turning points\n- **outcome**: How the call concluded (resolved, escalated, etc.)\n- **call_type**: Type of call (support, sales, inquiry, etc.)\n\nSet `include_ai_summary=false` to skip AI analysis and reduce latency.","operationId":"get_transcript_agents__agent_id__transcripts__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}},{"name":"include_ai_summary","in":"query","required":false,"schema":{"type":"boolean","description":"Generate AI summary using OpenAI (adds ~1-2s latency)","default":true,"title":"Include Ai Summary"},"description":"Generate AI summary using OpenAI (adds ~1-2s latency)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/transcripts/{session_id}/summarize":{"post":{"tags":["agent-transcripts"],"summary":"Summarize Transcript","description":"Generate or regenerate AI summary for a transcript.\n\nUse this endpoint to:\n- Get a fresh summary with custom parameters\n- Regenerate a summary with different options\n- Generate summary for transcripts that didn't have one\n\n**Cost note**: Each call uses OpenAI API tokens.","operationId":"summarize_transcript_agents__agent_id__transcripts__session_id__summarize_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}},{"name":"include_sentiment","in":"query","required":false,"schema":{"type":"boolean","description":"Include sentiment analysis","default":true,"title":"Include Sentiment"},"description":"Include sentiment analysis"},{"name":"include_topics","in":"query","required":false,"schema":{"type":"boolean","description":"Extract main topics","default":true,"title":"Include Topics"},"description":"Extract main topics"},{"name":"include_action_items","in":"query","required":false,"schema":{"type":"boolean","description":"Extract action items","default":true,"title":"Include Action Items"},"description":"Extract action items"},{"name":"max_summary_length","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":50,"description":"Maximum summary length in words","default":300,"title":"Max Summary Length"},"description":"Maximum summary length in words"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AITranscriptSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/transcripts/{session_id}/export":{"get":{"tags":["agent-transcripts"],"summary":"Export Transcript","description":"Export transcript in various formats.\n\nSupports JSON, plain text, and CSV formats.","operationId":"export_transcript_agents__agent_id__transcripts__session_id__export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"Export format: json, txt, csv","default":"json","title":"Format"},"description":"Export format: json, txt, csv"},{"name":"include_ai_summary","in":"query","required":false,"schema":{"type":"boolean","description":"Include AI summary in export","default":true,"title":"Include Ai Summary"},"description":"Include AI summary in export"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/recordings":{"get":{"tags":["recordings"],"summary":"List Agent Recordings","description":"List all call recordings for an agent.\n\n**Restriction**: Recording must be enabled for the agent in agent configuration.\n\nReturns a paginated list of recordings with metadata.\nEach recording includes file information, status, and timestamps.","operationId":"list_agent_recordings_agents__agent_id__recordings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of recordings to return","default":50,"title":"Limit"},"description":"Number of recordings to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of recordings to skip","default":0,"title":"Offset"},"description":"Number of recordings to skip"},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: recording, processing, completed, failed","title":"Status Filter"},"description":"Filter by status: recording, processing, completed, failed"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/recordings/{recording_id}":{"get":{"tags":["recordings"],"summary":"Get Recording","description":"Get a specific recording with download URL.\n\nReturns full recording details including a presigned download URL.\nThe URL is time-limited and expires after the specified duration.\n\n**Restriction**: Recording must be enabled for the agent in agent configuration.\n\n**Security**: URL expires after `url_expires` seconds (default: 1 hour).","operationId":"get_recording_agents__agent_id__recordings__recording_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"recording_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Recording Id"}},{"name":"url_expires","in":"query","required":false,"schema":{"type":"integer","maximum":86400,"minimum":60,"description":"URL expiration time in seconds (1 min - 24 hours)","default":3600,"title":"Url Expires"},"description":"URL expiration time in seconds (1 min - 24 hours)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["recordings"],"summary":"Delete Recording","description":"Delete a call recording.\n\nThis removes the recording from both MinIO storage and the database.\n\n**Warning**: This action is irreversible.","operationId":"delete_recording_agents__agent_id__recordings__recording_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"recording_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Recording Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/recordings/{recording_id}/download-url":{"get":{"tags":["recordings"],"summary":"Get Recording Download Url","description":"Get a fresh download URL for a recording.\n\nGenerates a new presigned URL with custom expiration time.\nUseful for refreshing expired URLs without fetching full recording details.\n\n**Restriction**: Recording must be enabled for the agent in agent configuration.","operationId":"get_recording_download_url_agents__agent_id__recordings__recording_id__download_url_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"recording_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Recording Id"}},{"name":"expires","in":"query","required":false,"schema":{"type":"integer","maximum":86400,"minimum":60,"description":"URL expiration in seconds","default":3600,"title":"Expires"},"description":"URL expiration in seconds"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/llm":{"get":{"tags":["admin-providers"],"summary":"Get All Llm Providers","description":"Get all available LLM providers with their models and languages.\n\nReturns comprehensive list for frontend dropdown/selection.\nIncludes configured status, models, and language support.","operationId":"get_all_llm_providers_admin_providers_llm_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/llm/{provider}":{"get":{"tags":["admin-providers"],"summary":"Get Llm Provider Details","description":"Get detailed information about a specific LLM provider.","operationId":"get_llm_provider_details_admin_providers_llm__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/tts":{"get":{"tags":["admin-providers"],"summary":"Get All Tts Providers","description":"Get all available TTS providers with their voices and languages.\n\nReturns comprehensive list for frontend voice selection.\nIncludes language support for each provider.","operationId":"get_all_tts_providers_admin_providers_tts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/stt":{"get":{"tags":["admin-providers"],"summary":"Get All Stt Providers","description":"Get all available STT providers with their models and languages.\n\nReturns comprehensive list for frontend transcription selection.\nIncludes language support and auto-detection capabilities.","operationId":"get_all_stt_providers_admin_providers_stt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/all":{"get":{"tags":["admin-providers"],"summary":"Get All Providers Summary","description":"Get summary of all providers (LLM, TTS, STT) with language support.\n\nComprehensive endpoint for frontend to populate all dropdowns.\nIncludes language support for each provider.","operationId":"get_all_providers_summary_admin_providers_all_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/configured":{"get":{"tags":["admin-providers"],"summary":"Get Configured Providers","description":"Get currently configured service providers.\n\nVoice processing is now handled by LiveKit voice worker with AgentFactory.\nThis endpoint returns the available providers from AgentFactory's registry.","operationId":"get_configured_providers_admin_providers_configured_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/languages":{"get":{"tags":["admin-providers"],"summary":"Get Supported Languages","description":"Get all supported languages across all providers.\n\nReturns language codes with provider support info.\nUseful for filtering providers by language.","operationId":"get_supported_languages_admin_providers_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/by-language/{language}":{"get":{"tags":["admin-providers"],"summary":"Get Providers By Language","description":"Get all providers that support a specific language.\n\nArgs:\n    language: Language code (e.g., \"en\", \"es\", \"fr\", \"de\", \"zh\", \"ja\")\n\nReturns providers filtered by language support.","operationId":"get_providers_by_language_admin_providers_by_language__language__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"language","in":"path","required":true,"schema":{"type":"string","title":"Language"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/available":{"get":{"tags":["admin-providers"],"summary":"Get Available Providers","description":"Get all available service providers with real capabilities from APIs.","operationId":"get_available_providers_admin_providers_available_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ServiceType"},{"type":"null"}],"title":"Service Type"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/test-connection":{"post":{"tags":["admin-providers"],"summary":"Test Provider Connection","description":"Test connection to a service provider.","operationId":"test_provider_connection_admin_providers_test_connection_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderConfig"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/recommendations":{"get":{"tags":["admin-providers"],"summary":"Get Provider Recommendations","description":"Get provider recommendations based on use case and requirements.","operationId":"get_provider_recommendations_admin_providers_recommendations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"use_case","in":"query","required":false,"schema":{"type":"string","default":"general","title":"Use Case"}},{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"en","title":"Language"}},{"name":"budget_level","in":"query","required":false,"schema":{"type":"string","default":"medium","title":"Budget Level"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/bulk-configure":{"post":{"tags":["admin-providers"],"summary":"Bulk Configure Providers","description":"Configure multiple providers at once.","operationId":"bulk_configure_providers_admin_providers_bulk_configure_post","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProviderConfig"},"type":"array","title":"Provider Configs"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/cost-comparison":{"get":{"tags":["admin-providers"],"summary":"Get Provider Cost Comparison","description":"Compare costs across different providers.","operationId":"get_provider_cost_comparison_admin_providers_cost_comparison_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"monthly_calls","in":"query","required":false,"schema":{"type":"integer","default":1000,"title":"Monthly Calls"}},{"name":"avg_duration_minutes","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Avg Duration Minutes"}},{"name":"avg_response_chars","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Avg Response Chars"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/setup-guide/{provider}":{"get":{"tags":["admin-providers"],"summary":"Get Provider Setup Guide","description":"Get detailed setup guide for a specific provider.","operationId":"get_provider_setup_guide_admin_providers_setup_guide__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"service_type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ServiceType"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/languages/{provider}":{"get":{"tags":["admin-providers"],"summary":"Get Provider Languages","description":"Get real supported languages for a specific provider.","operationId":"get_provider_languages_admin_providers_languages__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"service_type","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ServiceType"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/tts-providers":{"get":{"tags":["admin-providers"],"summary":"Get All Tts Providers","description":"Get all available TTS providers with their voice options.\nUpdated with official LiveKit plugin configurations.","operationId":"get_all_tts_providers_admin_providers_tts_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/voices/{provider}":{"get":{"tags":["admin-providers"],"summary":"Get Provider Voices","description":"Get available voices for a provider and language.","operationId":"get_provider_voices_admin_providers_voices__provider__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"en","title":"Language"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/providers/refresh-capabilities":{"post":{"tags":["admin-providers"],"summary":"Refresh Provider Capabilities","description":"Force refresh of provider capabilities from APIs.","operationId":"refresh_provider_capabilities_admin_providers_refresh_capabilities_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/validate":{"post":{"tags":["admin-providers"],"summary":"Validate Provider Configuration","description":"Validate provider configurations before creating or updating an agent.\n\nThis endpoint checks:\n- API key validity for each provider\n- Voice ID existence (for TTS providers like ElevenLabs, Cartesia)\n- Model availability (for STT/LLM providers)\n- Account quota status (where applicable)\n\nUse this to pre-validate configurations before agent creation.","operationId":"validate_provider_configuration_admin_providers_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderValidationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/validate/tts":{"post":{"tags":["admin-providers"],"summary":"Validate Tts Provider","description":"Validate a single TTS provider configuration.\n\nChecks:\n- API key validity\n- Voice ID existence and accessibility\n- Account quota (for ElevenLabs)","operationId":"validate_tts_provider_admin_providers_validate_tts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleProviderValidationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/validate/stt":{"post":{"tags":["admin-providers"],"summary":"Validate Stt Provider","description":"Validate a single STT provider configuration.\n\nChecks:\n- API key validity\n- Model availability","operationId":"validate_stt_provider_admin_providers_validate_stt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleProviderValidationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/validate/llm":{"post":{"tags":["admin-providers"],"summary":"Validate Llm Provider","description":"Validate a single LLM provider configuration.\n\nChecks:\n- API key validity\n- Model availability","operationId":"validate_llm_provider_admin_providers_validate_llm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleProviderValidationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/providers/validate/voice/{provider}/{voice_id}":{"get":{"tags":["admin-providers"],"summary":"Validate Voice Id","description":"Quick validation of a specific voice ID for a TTS provider.\n\nExample:\n    GET /providers/validate/voice/elevenlabs/EXAVITQu4vr4xnSDxMaL","operationId":"validate_voice_id_admin_providers_validate_voice__provider___voice_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/livekit/regions":{"get":{"tags":["voice"],"summary":"Get Livekit Regions","description":"Get available LiveKit Cloud regions for web calls.\n\nThis endpoint proxies the LiveKit Cloud API to retrieve available regions.\nUse this during web call setup to:\n- Display available regions to users\n- Configure which LiveKit region to use for WebRTC connections\n- Optimize latency by selecting the closest region\n\n**Frontend Usage:**\nInstead of calling LiveKit Cloud directly (which requires API keys), use this endpoint:\n```\nGET /api/v1/voice/livekit/regions\n```\n\n**Response:** Returns LiveKit Cloud regions data including region codes, names, and endpoints.","operationId":"get_livekit_regions_voice_livekit_regions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/voice/tokens":{"post":{"tags":["voice"],"summary":"Create Voice Token","description":"Create LiveKit token for voice session.","operationId":"create_voice_token_voice_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/voice/sessions/{session_id}/start":{"post":{"tags":["voice"],"summary":"Start Voice Session","description":"Start a voice session.","operationId":"start_voice_session_voice_sessions__session_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/sessions/{session_id}/end":{"post":{"tags":["voice"],"summary":"End Voice Session","description":"End a voice session.","operationId":"end_voice_session_voice_sessions__session_id__end_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/agents/run":{"post":{"tags":["voice"],"summary":"Run Agent Turn","description":"Run an agent turn (internal endpoint for orchestrator).","operationId":"run_agent_turn_voice_agents_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/sessions/{session_id}/state":{"get":{"tags":["voice"],"summary":"Get Session State","description":"Get current session state with tool results.","operationId":"get_session_state_voice_sessions__session_id__state_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/sessions/{session_id}/trace":{"get":{"tags":["voice"],"summary":"Get Session Trace","description":"Get diagnostic trace for a voice session (audio→ASR→LLM→TTS pipeline).","operationId":"get_session_trace_voice_sessions__session_id__trace_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/sessions/{session_id}/events":{"get":{"tags":["voice"],"summary":"Session Events Sse","description":"Server-Sent Events (SSE) endpoint for real-time session updates.\n\nProvides live updates for:\n- transcript.partial: Partial transcription results\n- transcript.final: Final transcription results\n- tool.confirm: Tool confirmation requests\n- tool.result: Tool execution results\n- session.ended: Session termination\n- language.detected: Language detection events\n- agent.thinking: Agent processing indicator\n- agent.speaking: Agent voice output","operationId":"session_events_sse_voice_sessions__session_id__events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/outbound":{"post":{"tags":["calls"],"summary":"Initiate Outbound Call","description":"Initiate an outbound call from an agent.","operationId":"initiate_outbound_call_calls_outbound_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundCallRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/calls/{call_id}":{"get":{"tags":["calls"],"summary":"Get Call Status","description":"Get call status and details.","operationId":"get_call_status_calls__call_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/end":{"post":{"tags":["calls"],"summary":"End Call","description":"End a call.","operationId":"end_call_calls__call_id__end_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}},{"name":"reason","in":"query","required":false,"schema":{"type":"string","default":"completed","title":"Reason"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/transfer":{"post":{"tags":["calls"],"summary":"Transfer Call","description":"Transfer a call to another number or SIP endpoint.\n\nSupports two transfer types:\n- cold: Direct transfer, agent disconnects immediately\n- warm: Agent provides context before connecting (requires additional orchestration)\n\nThe transfer_to parameter must be in one of these formats:\n- tel:+15105550100 (phone number)\n- sip:user@domain.com (SIP endpoint)\n- sip:+15105550100@sip.telnyx.com (phone via SIP URI)","operationId":"transfer_call_calls__call_id__transfer_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/agent/{agent_id}/calls":{"get":{"tags":["calls"],"summary":"List Agent Calls","description":"List all calls for a specific agent with filtering and pagination.\n\n**Returns:**\n- Actual call records from the database\n- Proper to/from phone numbers\n- Correct inbound/outbound direction\n- Recording information if available","operationId":"list_agent_calls_calls_agent__agent_id__calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Number of calls to return","default":100,"title":"Limit"},"description":"Number of calls to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of calls to skip","default":0,"title":"Offset"},"description":"Number of calls to skip"},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by direction: inbound, outbound","title":"Direction"},"description":"Filter by direction: inbound, outbound"},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: initiated, ringing, answered, ended, failed","title":"Status Filter"},"description":"Filter by status: initiated, ringing, answered, ended, failed"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter calls after this date","title":"Start Date"},"description":"Filter calls after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter calls before this date","title":"End Date"},"description":"Filter calls before this date"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/recording":{"get":{"tags":["calls"],"summary":"Get Call Recording","description":"Get call recording information and download URL from MinIO storage.\n\n**Restriction**: Recording must be enabled for the agent in agent configuration.","operationId":"get_call_recording_calls__call_id__recording_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}},{"name":"url_expires","in":"query","required":false,"schema":{"type":"integer","maximum":86400,"minimum":60,"description":"URL expiration time in seconds","default":3600,"title":"Url Expires"},"description":"URL expiration time in seconds"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/transfer/simple":{"post":{"tags":["calls"],"summary":"Transfer Call Simple","description":"[DEPRECATED] Simple call transfer endpoint.\n\n**Use POST /{call_id}/transfer instead - it provides full implementation.**\n\nThis is a placeholder implementation that returns a mock transfer ID.","operationId":"transfer_call_simple","deprecated":true,"security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}},{"name":"transfer_to","in":"query","required":true,"schema":{"type":"string","title":"Transfer To"}},{"name":"transfer_type","in":"query","required":false,"schema":{"type":"string","default":"warm","title":"Transfer Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/mute":{"post":{"tags":["calls"],"summary":"Mute Call","description":"Mute/unmute call participant.","operationId":"mute_call_calls__call_id__mute_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}},{"name":"mute_participant","in":"query","required":true,"schema":{"type":"string","title":"Mute Participant"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/agent/{agent_id}/active":{"get":{"tags":["calls"],"summary":"Get Active Calls","description":"Get currently active calls for a specific agent.\n\n**Returns:**\n- All calls with status 'initiated', 'ringing', or 'answered' (not ended)\n- Real-time call information\n- Recording status","operationId":"get_active_calls_calls_agent__agent_id__active_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/control":{"post":{"tags":["calls"],"summary":"Control Call","description":"Real-time call control using LiveKit room and participant APIs.","operationId":"control_call_calls__call_id__control_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Control Action"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/artifact":{"get":{"tags":["calls"],"summary":"Get Call Artifact","description":"Get call artifacts from LiveKit Egress recordings and transcripts.","operationId":"get_call_artifact_calls__call_id__artifact_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/campaigns":{"post":{"tags":["campaigns"],"summary":"Create Campaign","description":"Create an outbound calling campaign.\n\nThis allows you to:\n- Call multiple numbers in sequence or parallel\n- Schedule calls for a specific time\n- Set concurrent call limits\n- Retry failed calls automatically\n- Track campaign progress\n\n# ============================================\n# QUOTA ENFORCEMENT\n# ============================================","operationId":"create_campaign_campaigns_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["campaigns"],"summary":"List Campaigns","description":"List all campaigns for the current user.\n\nReturns paginated list of campaigns with filtering by status.","operationId":"list_campaigns_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"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"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CampaignResponse"},"title":"Response List Campaigns Campaigns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/campaigns/{campaign_id}":{"get":{"tags":["campaigns"],"summary":"Get Campaign Status","description":"Get campaign status and progress.","operationId":"get_campaign_status_campaigns__campaign_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/outbound/agents/{agent_id}/outbound-config":{"post":{"tags":["outbound-config"],"summary":"Configure Outbound Calling","description":"Configure outbound calling for an agent.\n\nThis allows you to:\n- Set multiple outbound phone numbers (caller IDs)\n- Define calling schedules with time windows\n- Set daily call limits\n- Configure timezone-aware calling hours\n- Set concurrent call limits\n\n# ============================================\n# QUOTA ENFORCEMENT\n# ============================================","operationId":"configure_outbound_calling_outbound_agents__agent_id__outbound_config_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConfiguration"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["outbound-config"],"summary":"Get Outbound Config","description":"Get outbound calling configuration for an agent.","operationId":"get_outbound_config_outbound_agents__agent_id__outbound_config_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/outbound/agents/{agent_id}/can-call":{"get":{"tags":["outbound-config"],"summary":"Check Can Call","description":"Check if agent can make an outbound call right now.\n\nThis checks:\n- Current time against calling schedules\n- Daily call limits\n- Concurrent call limits\n- Do Not Call lists (if enabled)\n- Recipient timezone (if enabled)","operationId":"check_can_call_outbound_agents__agent_id__can_call_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"to_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallPermissionCheck"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squad-calls/squads/{squad_id}/outbound-campaign":{"post":{"tags":["squad-calls"],"summary":"Create Squad Outbound Campaign","description":"Create an outbound calling campaign using a squad.\n\nThe campaign will be distributed across squad members based on:\n- Agent availability\n- Agent calling schedules  \n- Agent daily limits\n- Squad routing strategy\n\nExample:\n```json\n{\n  \"squad_id\": \"squad-uuid\",\n  \"name\": \"Q4 Sales Campaign\",\n  \"targets\": [\n    {\"to_number\": \"+1234567890\", \"context\": {\"customer_id\": \"123\"}},\n    {\"to_number\": \"+0987654321\", \"context\": {\"customer_id\": \"456\"}}\n  ],\n  \"routing_strategy\": \"load_based\",\n  \"concurrent_calls_per_agent\": 2\n}\n```","operationId":"create_squad_outbound_campaign_squad_calls_squads__squad_id__outbound_campaign_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SquadOutboundCampaignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squad-calls/squads/{squad_id}/call-stats":{"get":{"tags":["squad-calls"],"summary":"Get Squad Call Stats","description":"Get call statistics for a squad.\n\nReturns total calls and breakdown by agent for the specified date.","operationId":"get_squad_call_stats_squad_calls_squads__squad_id__call_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SquadCallStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squad-calls/squads/{squad_id}/route-inbound":{"post":{"tags":["squad-calls"],"summary":"Route Inbound Call To Squad","description":"Route an inbound call to a squad member.\n\nThis endpoint is typically called by LiveKit webhooks or SIP providers.\nNo authentication required for webhooks.","operationId":"route_inbound_call_to_squad_squad_calls_squads__squad_id__route_inbound_post","parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Call Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/execute":{"post":{"tags":["tools"],"summary":"Execute Tool","description":"Execute a tool.","operationId":"execute_tool_tools_execute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__models__schemas__ToolExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Execute Tool Tools Execute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/tools/executions/{execution_id}":{"get":{"tags":["tools"],"summary":"Get Execution Status","description":"Get tool execution status.","operationId":"get_execution_status_tools_executions__execution_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/executions/{execution_id}/retry":{"post":{"tags":["tools"],"summary":"Retry Execution","description":"Retry a failed tool execution.","operationId":"retry_execution_tools_executions__execution_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Execution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/registry":{"get":{"tags":["tools"],"summary":"List Available Tools","description":"List all available tools in registry.","operationId":"list_available_tools_tools_registry_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/tools/connections/{tool_key}":{"post":{"tags":["tools"],"summary":"Connect Tool","description":"Connect a tool for the current user.","operationId":"connect_tool_tools_connections__tool_key__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Connection Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Connect Tool Tools Connections  Tool Key  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tools"],"summary":"Disconnect Tool","description":"Disconnect a tool for the current user.","operationId":"disconnect_tool_tools_connections__tool_key__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/executions/{execution_id}/confirm":{"post":{"tags":["tools"],"summary":"Confirm Tool Execution","description":"Confirm or reject a tool execution that requires user approval.","operationId":"confirm_tool_execution_tools_executions__execution_id__confirm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"execution_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Execution Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Confirmation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/agents/{agent_id}/add-tool":{"post":{"tags":["tools"],"summary":"Add Tool To Agent","description":"Add and configure a tool for a specific agent.\n\n**Multi-Level Configuration:**\n- **Tenant Level**: API keys, OAuth tokens (shared across all agents)\n- **Agent Level**: Tool-specific settings (different per agent)\n\n**How It Works:**\n1. Tool connection created at tenant level (if needed)\n2. Agent-specific configuration stored separately\n3. Different agents can use same tool with different configs\n\n**Example: Google Sheets Tool**\n```json\n{\n  \"tool_key\": \"google_sheets_tool\",\n  \"enabled\": true,\n  \"config\": {\n    \"access_token\": \"ya29.xxx\",        // Tenant level (shared)\n    \"refresh_token\": \"1//xxx\",         // Tenant level (shared)\n    \"spreadsheetId\": \"1BxiMVxxx\",     // Agent level (unique per agent)\n    \"range\": \"Sheet1!A:Z\"              // Agent level (unique per agent)\n  }\n}\n```\n\n**Example: Slack Tool**\n```json\n{\n  \"tool_key\": \"slack_send_message_tool\",\n  \"enabled\": true,\n  \"config\": {\n    \"bot_token\": \"xoxb-xxx\",           // Tenant level (shared)\n    \"channel\": \"#agent1-notifications\" // Agent level (unique per agent)\n  }\n}\n```\n\n**Result:**\n- Agent 1 can log to \"Sheet1\" with \"#support\" channel\n- Agent 2 can log to \"Sheet2\" with \"#sales\" channel  \n- Both use same tenant OAuth token","operationId":"add_tool_to_agent_tools_agents__agent_id__add_tool_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Tool Config"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/custom":{"post":{"tags":["tools"],"summary":"Create Custom Tool","description":"Create or update custom tool with upsert logic.","operationId":"create_custom_tool_tools_custom_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Tool Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/tools/{tool_key}/configure":{"post":{"tags":["tools"],"summary":"Configure Tool","description":"Configure tool-specific parameters (Google Sheets spreadsheet ID, Slack channel, etc.).\n\nThis creates a user-level tool connection with configuration.","operationId":"configure_tool_tools__tool_key__configure_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Config Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/{tool_key}/schema":{"get":{"tags":["tools"],"summary":"Get Tool Schema","description":"Get tool configuration schema for frontend forms.\nReturns field definitions, types, validation rules.","operationId":"get_tool_schema_tools__tool_key__schema_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/{tool_key}/requirements":{"get":{"tags":["tools"],"summary":"Get Tool Requirements","description":"Get full configuration requirements for a tool.\n\nThis is intended for frontend use to guide users through:\n- Tenant-level setup (API keys / OAuth tokens)\n- Agent-level setup (per-agent settings)\n\nResponse includes:\n- Registry metadata (display_name, requires_connection, scopes, ui_manifest)\n- Configuration guide from ToolConfigurationService:\n  - tenant vs agent required/optional fields\n  - auth_type\n  - example configuration payload\n  - setup notes","operationId":"get_tool_requirements_tools__tool_key__requirements_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/{tool_key}/config":{"get":{"tags":["tools"],"summary":"Get Tool Config","description":"Get current tool configuration for the user.\nReturns configured values (with sensitive fields masked).","operationId":"get_tool_config_tools__tool_key__config_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows":{"post":{"tags":["workflows"],"summary":"Create Workflow","description":"Create a new workflow for agent conversation flow.","operationId":"create_workflow_workflows_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["workflows"],"summary":"List Workflows","description":"List workflows for the current user.","operationId":"list_workflows_workflows_get","security":[{"HTTPBearer":[]}],"parameters":[{"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"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Workflow"},"title":"Response List Workflows Workflows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}":{"get":{"tags":["workflows"],"summary":"Get Workflow","description":"Get a specific workflow.","operationId":"get_workflow_workflows__workflow_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["workflows"],"summary":"Update Workflow","description":"Update a workflow.","operationId":"update_workflow_workflows__workflow_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["workflows"],"summary":"Delete Workflow","description":"Delete a workflow with validation.\n\nArgs:\n    workflow_id: Workflow to delete\n    force: If True, removes workflow from all agents before deleting\n\nBehavior:\n    - If no agents using workflow: Deletes immediately\n    - If agents using workflow and force=False: Returns error with agent list\n    - If agents using workflow and force=True: Removes from agents then deletes","operationId":"delete_workflow_workflows__workflow_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/validate":{"post":{"tags":["workflows"],"summary":"Validate Workflow","description":"Validate workflow structure and node connections.","operationId":"validate_workflow_workflows__workflow_id__validate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/export-json":{"get":{"tags":["workflows"],"summary":"Export Workflow Json","description":"Export workflow as JSON.","operationId":"export_workflow_json_workflows__workflow_id__export_json_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/import-json":{"post":{"tags":["workflows"],"summary":"Import Workflow Json","description":"Import workflow from JSON.","operationId":"import_workflow_json_workflows_import_json_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Workflow Json"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/workflows/{workflow_id}/download-json":{"get":{"tags":["workflows"],"summary":"Download Workflow Json","description":"Download workflow JSON file.","operationId":"download_workflow_json_workflows__workflow_id__download_json_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/nodes/{node_id}/tools":{"get":{"tags":["workflows"],"summary":"List Node Tool Attachments","description":"List the `agent_tools` instance attachments on a workflow node.","operationId":"list_node_tool_attachments_workflows__workflow_id__nodes__node_id__tools_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Node Tool Attachments Workflows  Workflow Id  Nodes  Node Id  Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["workflows"],"summary":"Attach Tool To Node","description":"Attach a CONFIGURED tool *instance* to a workflow node.\n\nWorkflow nodes never reference tool *types* (registry keys) directly —\nthey only reference instances that already exist in `agent_tools`. The\nrule: a user cannot attach `cold_transfer` to a node; they must first\ncreate a configured instance like `transfer_to_billing` (with its\nsip_trunk_id, target_number, etc.) on an agent, then attach that\ninstance_name here.\n\nValidation:\n  - If `?agent_id=` is provided, the (agent_id, instance_name) pair\n    MUST exist in `agent_tools` (active + enabled). Strict.\n  - Otherwise, the instance_name MUST exist on at least one agent\n    currently using this workflow (i.e. `agents.workflow_id == this`).\n  - If the workflow is not yet attached to any agent, the request is\n    rejected with 422 — bind the workflow to an agent first, then\n    attach instances. (Avoids accumulating dangling string refs that\n    only fail at runtime.)","operationId":"attach_tool_to_node_workflows__workflow_id__nodes__node_id__tools_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeToolAttachRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflows/{workflow_id}/nodes/{node_id}/tools/{instance_name}":{"delete":{"tags":["workflows"],"summary":"Detach Tool From Node","description":"Detach a tool instance from a workflow node.","operationId":"detach_tool_from_node_workflows__workflow_id__nodes__node_id__tools__instance_name__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}},{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"instance_name","in":"path","required":true,"schema":{"type":"string","title":"Instance Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sip/tenants/{tenant_id}/sip-trunks/outbound":{"post":{"tags":["sip"],"summary":"Create Outbound Trunk","description":"⚠️ **DEPRECATED ENDPOINT** - This endpoint is no longer supported.\n\n**Use Instead:** `POST /agents/{agent_id}/phone-numbers`\n\n**Why Deprecated:**\n- This endpoint used an incorrect SIP architecture\n- It doesn't properly integrate with LiveKit dispatch rules\n- Phone numbers should be registered at agent level, not tenant level\n\n**Migration Guide:**\n1. Use `POST /agents/{agent_id}/phone-numbers` to register phone numbers\n2. See `CORRECT_PHONE_NUMBER_SETUP.md` for complete setup instructions\n3. See `MULTI_AGENT_ARCHITECTURE_PLAN.md` for migration details\n\n**Correct Endpoint:**\n```\nPOST /agents/{agent_id}/phone-numbers\n{\n    \"phone_number\": \"+15551234567\",\n    \"provider\": \"twilio\",\n    \"enable_outbound\": true,\n    \"outbound_address\": \"sip.twilio.com\"\n}\n```","operationId":"create_outbound_trunk_sip_tenants__tenant_id__sip_trunks_outbound_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SIPTrunkCreate"}}}},"responses":{"410":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sip/tenants/{tenant_id}/sip-trunks":{"get":{"tags":["sip"],"summary":"List Sip Trunks","description":"⚠️ **DEPRECATED ENDPOINT** - This endpoint is no longer supported.\n\n**Use Instead:** `GET /agents/{agent_id}/phone-numbers`\n\n**For listing all phone numbers across agents:**\n- Use `GET /phone-numbers/all` (admin endpoint)\n- Or iterate through agents: `GET /agents/{agent_id}/phone-numbers` for each agent","operationId":"list_sip_trunks_sip_tenants__tenant_id__sip_trunks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"trunk_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trunk Type"}}],"responses":{"410":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sip/tenants/{tenant_id}/sip-trunks/{trunk_id}":{"get":{"tags":["sip"],"summary":"Get Sip Trunk","description":"Get SIP trunk by ID.","operationId":"get_sip_trunk_sip_tenants__tenant_id__sip_trunks__trunk_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trunk Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SIPTrunk"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["sip"],"summary":"Update Sip Trunk","description":"Update SIP trunk.","operationId":"update_sip_trunk_sip_tenants__tenant_id__sip_trunks__trunk_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trunk Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SIPTrunkUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SIPTrunk"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["sip"],"summary":"Delete Sip Trunk","description":"Delete SIP trunk.","operationId":"delete_sip_trunk_sip_tenants__tenant_id__sip_trunks__trunk_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trunk Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sip/tenants/{tenant_id}/sip-trunks/{trunk_id}/health-check":{"post":{"tags":["sip"],"summary":"Health Check Sip Trunk","description":"Perform health check on SIP trunk.","operationId":"health_check_sip_trunk_sip_tenants__tenant_id__sip_trunks__trunk_id__health_check_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"trunk_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trunk Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sip/agents/{agent_id}/phone-numbers-summary":{"get":{"tags":["sip"],"summary":"Get Agent Phone Numbers Summary","description":"Get a summary of agent's phone numbers and SIP configuration.\n\n**Simpler Alternative:** Use `GET /api/v1/agents/{agent_id}/phone-numbers` for just the phone list\n\n**What this returns:**\n- All registered phone numbers with SIP URIs\n- LiveKit SIP domain configuration\n- Setup guide for new phone registration\n\n**Use Cases:**\n- Dashboard overview of agent's phone configuration\n- Debugging SIP setup\n- Migration from legacy trunk system","operationId":"get_agent_phone_numbers_summary_sip_agents__agent_id__phone_numbers_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sip/tenants/{tenant_id}/sip-config":{"get":{"tags":["sip"],"summary":"Get Sip Configuration Docs","description":"Get SIP configuration documentation for a tenant.","operationId":"get_sip_configuration_docs_sip_tenants__tenant_id__sip_config_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/quota":{"get":{"tags":["analytics"],"summary":"Get Tenant Quota","description":"Get quota and remaining calls information for tenant.\n\nReturns:\n- Monthly call limit and remaining calls\n- Concurrent call limit and available slots\n- Total minutes used\n- Quota exceeded status","operationId":"get_tenant_quota_analytics_tenants__tenant_id__quota_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/metrics/real-time":{"get":{"tags":["analytics"],"summary":"Get Realtime Metrics","description":"Get real-time metrics for current tenant.\n\nReturns current system state:\n- Active calls\n- Active participants\n- Active agents\n\nUpdates every 60 seconds (configurable).","operationId":"get_realtime_metrics_analytics_tenants__tenant_id__metrics_real_time_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RealTimeMetrics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/calls":{"get":{"tags":["analytics"],"summary":"Get Call Statistics","description":"Get call statistics for a time period.\n\nStatistics include:\n- Total calls\n- Success rate\n- Average duration\n- Failed calls\n\nCan be filtered by specific agent.","operationId":"get_call_statistics_analytics_tenants__tenant_id__calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"description":"Time period in hours (1-168)","default":24,"title":"Hours"},"description":"Time period in hours (1-168)"},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by specific agent","title":"Agent Id"},"description":"Filter by specific agent"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallStatistics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/agents/performance":{"get":{"tags":["analytics"],"summary":"Get Agent Performance","description":"Get performance metrics for a specific agent.\n\nMetrics include:\n- Call volume and success rate\n- Average call duration\n- Tool execution statistics\n- Performance trends","operationId":"get_agent_performance_analytics_tenants__tenant_id__agents_performance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"description":"Time period in hours (1-168)","default":24,"title":"Hours"},"description":"Time period in hours (1-168)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPerformance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/capacity":{"get":{"tags":["analytics"],"summary":"Get Capacity Metrics","description":"Get system capacity and utilization metrics.\n\nShows:\n- Current active calls\n- Total system capacity\n- Utilization percentage\n- Available capacity\n- Number of agents","operationId":"get_capacity_metrics_analytics_capacity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapacityMetrics"}}}}},"security":[{"HTTPBearer":[]}]}},"/analytics/tenants/{tenant_id}/dashboard":{"get":{"tags":["analytics"],"summary":"Get Dashboard Analytics","description":"Get comprehensive analytics for tenant dashboard.\n\nThis is the main endpoint for dashboard rendering.\nReturns all metrics in one response:\n- Real-time metrics\n- Call statistics\n- Capacity metrics\n- Per-agent performance\n\nUse this endpoint to populate the main dashboard view.\n\nExample Response:\n```json\n{\n  \"tenant_id\": \"...\",\n  \"generated_at\": \"2025-12-04T10:00:00Z\",\n  \"period_hours\": 24,\n  \"real_time\": {\n    \"active_calls\": 5,\n    \"active_participants\": 10,\n    \"active_agents\": 5\n  },\n  \"call_statistics\": {\n    \"total_calls\": 150,\n    \"success_rate\": 95.5,\n    \"avg_duration_seconds\": 180\n  },\n  \"capacity\": {\n    \"current_active_calls\": 5,\n    \"total_capacity\": 50,\n    \"utilization_percentage\": 10.0\n  },\n  \"agents\": [\n    {\n      \"agent_id\": \"...\",\n      \"agent_name\": \"Customer Support Agent\",\n      \"calls\": {...},\n      \"tools\": {...}\n    }\n  ]\n}\n```","operationId":"get_dashboard_analytics_analytics_tenants__tenant_id__dashboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"description":"Time period in hours (1-168)","default":24,"title":"Hours"},"description":"Time period in hours (1-168)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardAnalytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/reports/generate":{"post":{"tags":["analytics"],"summary":"Generate Report","description":"Generate analytics report for tenant.","operationId":"generate_report_analytics_tenants__tenant_id__reports_generate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Report Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/export/calls":{"get":{"tags":["analytics"],"summary":"Export Calls","description":"Export call data for tenant.","operationId":"export_calls_analytics_tenants__tenant_id__export_calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/tenants/{tenant_id}/calls/by-region":{"get":{"tags":["analytics"],"summary":"Calls By Region","description":"Worldwide call distribution — calls aggregated by caller country.\n\nPowers the dashboard's \"calls by region\" map (choropleth keyed on ISO-2\ncountry codes). Country is derived from the caller's E.164 number at\ncall-creation time via libphonenumber.\n\n**Response shape:**\n```json\n{\n  \"tenant_id\": \"...\",\n  \"period\": {\"start\": \"2026-03-18T00:00:00Z\", \"end\": \"2026-04-17T23:59:59Z\"},\n  \"regions\": [\n    {\"country_code\": \"US\", \"country_name\": \"United States\",\n     \"call_count\": 1423, \"total_minutes\": 8921.5,\n     \"avg_duration_sec\": 376, \"inbound\": 1200, \"outbound\": 223}\n  ],\n  \"total_calls\": 1735,\n  \"countries_count\": 47,\n  \"calls_without_country\": 12\n}\n```\n\nSorted by `call_count` DESC. `country_code` uses ISO 3166-1 alpha-2.\nCalls with no parseable phone number (web sessions, anonymous calls)\nare reported as `calls_without_country`.","operationId":"calls_by_region_analytics_tenants__tenant_id__calls_by_region_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO start date (defaults to 30 days ago)","title":"Start Date"},"description":"ISO start date (defaults to 30 days ago)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO end date (defaults to now)","title":"End Date"},"description":"ISO end date (defaults to now)"},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(inbound|outbound)$"},{"type":"null"}],"description":"Filter by call direction","title":"Direction"},"description":"Filter by call direction"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/health":{"get":{"tags":["analytics"],"summary":"Analytics Health","description":"Check analytics service health.\n\nReturns:\n- Service enabled status\n- LiveKit connectivity\n- Redis connectivity","operationId":"analytics_health_analytics_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/services/health":{"get":{"tags":["admin-services"],"summary":"Get Services Health","description":"Get health status of all voice processing services.\n\nVoice processing is handled by the LiveKit voice worker using AgentFactory.\nThis endpoint returns the status of configured providers.","operationId":"get_services_health_admin_services_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Services Health Admin Services Health Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/services/models/available":{"get":{"tags":["admin-services"],"summary":"Get Available Models","description":"Get available models for ASR, TTS, and LLM services from AgentFactory.","operationId":"get_available_models_admin_services_models_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/services/test":{"post":{"tags":["admin-services"],"summary":"Test Voice Processing","description":"Test voice processing services.\n\nNote: Actual voice processing is handled by the LiveKit voice worker.\nThis endpoint validates configuration only.","operationId":"test_voice_processing_admin_services_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProcessingTest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/services/configuration":{"get":{"tags":["admin-services"],"summary":"Get Service Configuration","description":"Get current service configuration from AgentFactory.","operationId":"get_service_configuration_admin_services_configuration_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/services/languages/supported":{"get":{"tags":["admin-services"],"summary":"Get Supported Languages","description":"Get supported languages across all services.","operationId":"get_supported_languages_admin_services_languages_supported_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/services/providers/summary":{"get":{"tags":["admin-services"],"summary":"Get Providers Summary","description":"Get summary of all available providers from AgentFactory.","operationId":"get_providers_summary_admin_services_providers_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/stats":{"get":{"tags":["admin"],"summary":"Get Platform Statistics","description":"Get platform-wide statistics for admin dashboard.\n\n**Returns:**\n- Total/active/blocked tenants\n- Total/active users\n- Total/active agents\n- Call statistics (today, month, all-time)\n- Active sessions\n- Revenue data\n\n**Use for:**\n- Admin dashboard overview\n- Platform health monitoring\n- Billing reports","operationId":"get_platform_statistics_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStatistics"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/tenants":{"get":{"tags":["admin"],"summary":"List All Tenants","description":"List all tenants with summary statistics.\n\n**For billing system integration - returns all tenants with:**\n- Tenant details (name, type, plan, status)\n- Usage counts (agents, calls)\n- Quota status (exceeded or not)\n\n**Filters:**\n- `tenant_type`: business, developer, admin\n- `status_filter`: active, blocked, suspended","operationId":"list_all_tenants_admin_tenants_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"tenant_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type: business, developer, admin","title":"Tenant Type"},"description":"Filter by type: business, developer, admin"},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status: active, blocked, suspended","title":"Status Filter"},"description":"Filter by status: active, blocked, suspended"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantSummary"},"title":"Response List All Tenants Admin Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}":{"get":{"tags":["admin"],"summary":"Get Tenant Details","description":"Get detailed statistics for a specific tenant.\n\n**Returns complete tenant profile including:**\n- All tenant details\n- Current usage (agents, calls, minutes)\n- Quota configuration and status\n- Billing information\n- Last activity timestamp","operationId":"get_tenant_details_admin_tenants__tenant_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantStatistics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/block":{"post":{"tags":["admin"],"summary":"Block Tenant","description":"Block or unblock a tenant from accessing services.\n\n**Use when:**\n- Tenant exceeds quota\n- Payment issues\n- Terms of service violations\n- Manual suspension needed\n\n**Block services:**\n- `calls`: Block making/receiving calls\n- `agents`: Block creating new agents\n- `sip`: Block SIP/phone features\n- `recordings`: Block recording access\n- `analytics`: Block analytics access","operationId":"block_tenant_admin_tenants__tenant_id__block_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockTenantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/quota":{"put":{"tags":["admin"],"summary":"Update Tenant Quota","description":"Update tenant quota limits (tenure).\n\n**Adjustable quotas:**\n- `max_agents`: Maximum number of agents allowed\n- `max_squads`: Maximum number of squads allowed\n- `max_calls_per_month`: Monthly call limit\n- `max_concurrent_calls`: Concurrent call limit\n- `max_minutes_per_month`: Monthly minutes limit\n- `max_campaigns`: Maximum campaigns allowed\n- `max_recordings_gb`: Recording storage limit\n- `max_files_gb`: File storage limit\n- `max_file_size_mb`: Maximum single file size","operationId":"update_tenant_quota_admin_tenants__tenant_id__quota_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuotaRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/type":{"put":{"tags":["admin"],"summary":"Update Tenant Type","description":"Change tenant type (business/developer/admin).\n\n**Tenant Types:**\n- `business`: Uses platform API keys (default)\n- `developer`: Can bring their own API keys (BYOK)\n- `admin`: Internal admin access","operationId":"update_tenant_type_admin_tenants__tenant_id__type_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}},{"name":"tenant_type","in":"query","required":true,"schema":{"type":"string","description":"New type: business, developer, admin","title":"Tenant Type"},"description":"New type: business, developer, admin"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"List All Users","description":"List all users with tenant information.\n\n**Returns:**\n- User details (username, email, role)\n- Associated tenant info\n- Account status (active, verified)","operationId":"list_all_users_admin_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by role: business, developer, admin","title":"Role"},"description":"Filter by role: business, developer, admin"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"},"title":"Response List All Users Admin Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/agents":{"get":{"tags":["admin"],"summary":"List All Agents Stats","description":"List all agents across all tenants with statistics.\n\n**Returns per agent:**\n- Agent details\n- Call counts and minutes\n- Average call duration\n- Average sentiment score\n- Last activity","operationId":"list_all_agents_stats_admin_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by tenant","title":"Tenant Id"},"description":"Filter by tenant"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentStatistics"},"title":"Response List All Agents Stats Admin Agents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/billing/summary":{"get":{"tags":["admin"],"summary":"Get Billing Summary","description":"Get billing summary for all tenants.\n\n**For invoicing system - returns:**\n- Per-tenant usage and charges\n- Total platform revenue\n- Breakdown by tenant type","operationId":"get_billing_summary_admin_billing_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"description":"Month (1-12), default: current","title":"Month"},"description":"Month (1-12), default: current"},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2030,"minimum":2020},{"type":"null"}],"description":"Year, default: current","title":"Year"},"description":"Year, default: current"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/billing/reset-usage/{tenant_id}":{"post":{"tags":["admin"],"summary":"Reset Tenant Usage","description":"Reset tenant monthly usage counters (after billing cycle).","operationId":"reset_tenant_usage_admin_billing_reset_usage__tenant_id__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api-keys/list":{"get":{"tags":["Admin - API Keys"],"summary":"List all API keys","description":"Get complete list of all API keys needed for the platform with their configuration status. **Requires admin authentication.**","operationId":"list_all_api_keys_admin_api_keys_list_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type: llm, tts, stt","title":"Type Filter"},"description":"Filter by type: llm, tts, stt"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api-keys/required":{"get":{"tags":["Admin - API Keys"],"summary":"List required API keys","description":"Get the complete list of environment variables needed for all providers. **Requires admin authentication.**","operationId":"list_required_api_keys_admin_api_keys_required_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/api-keys/validate/{provider_id}":{"get":{"tags":["Admin - API Keys"],"summary":"Validate single provider","description":"Validate API key for a specific provider. **Requires admin authentication.**","operationId":"validate_provider_admin_api_keys_validate__provider_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api-keys/validate":{"get":{"tags":["Admin - API Keys"],"summary":"Validate all providers","description":"Validate API keys for all configured providers. **Requires admin authentication.**","operationId":"validate_all_providers_admin_api_keys_validate_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by type: llm, tts, stt","title":"Type Filter"},"description":"Filter by type: llm, tts, stt"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/api-keys/issues":{"get":{"tags":["Admin - API Keys"],"summary":"Get API key issues","description":"Get list of all current API key issues that need admin attention. **Requires admin authentication.**","operationId":"get_api_key_issues_admin_api_keys_issues_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/api-keys/notifications":{"get":{"tags":["Admin - API Keys"],"summary":"Get admin notifications","description":"Get admin notifications for API key issues with recommended actions. **Requires admin authentication.**","operationId":"get_admin_notifications_admin_api_keys_notifications_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminNotification"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/api-keys/health":{"get":{"tags":["Admin - API Keys"],"summary":"API keys health check","description":"Quick health check of all API keys. **Requires admin authentication.**","operationId":"api_keys_health_check_admin_api_keys_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/api-keys/refresh-validation":{"post":{"tags":["Admin - API Keys"],"summary":"Refresh validation cache","description":"Force re-validation of all API keys. **Requires admin authentication.**","operationId":"refresh_validation_admin_api_keys_refresh_validation_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/api-keys/provider/{provider_id}/config":{"get":{"tags":["Admin - API Keys"],"summary":"Get provider configuration requirements","description":"Get configuration requirements for a specific provider. **Requires admin authentication.**","operationId":"get_provider_config_admin_api_keys_provider__provider_id__config_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/system/health/comprehensive":{"get":{"tags":["system"],"summary":"Comprehensive Health Check","description":"Comprehensive health check for all system components.","operationId":"comprehensive_health_check_system_health_comprehensive_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/system/api/validation":{"get":{"tags":["system"],"summary":"Validate Api Completeness","description":"Validate that all required APIs are available and properly configured.","operationId":"validate_api_completeness_system_api_validation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/system/configuration/summary":{"get":{"tags":["system"],"summary":"Get Configuration Summary","description":"Get complete system configuration summary.","operationId":"get_configuration_summary_system_configuration_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/system/user-flows/validation":{"get":{"tags":["system"],"summary":"Validate User Flows","description":"Validate that all user flows are properly implemented.","operationId":"validate_user_flows_system_user_flows_validation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/system/deployment/readiness":{"get":{"tags":["system"],"summary":"Check Deployment Readiness","description":"Check if system is ready for production deployment.","operationId":"check_deployment_readiness_system_deployment_readiness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/system/features/validation":{"get":{"tags":["system"],"summary":"Validate System Features","description":"Validate all system features and integrations.","operationId":"validate_system_features_system_features_validation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/system/services/health":{"get":{"tags":["system"],"summary":"Get Services Health","description":"Get health status of all external services.","operationId":"get_services_health_system_services_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/system/services/registry":{"get":{"tags":["system"],"summary":"Get Services Registry","description":"Get information about all registered services.","operationId":"get_services_registry_system_services_registry_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/integrations":{"post":{"tags":["integrations","integrations"],"summary":"Create Integration","description":"Create a new integration.","operationId":"create_integration_integrations_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["integrations","integrations"],"summary":"List Integrations","description":"List integrations for the current tenant.","operationId":"list_integrations_integrations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Integration"},"title":"Response List Integrations Integrations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integrations/{integration_id}":{"get":{"tags":["integrations","integrations"],"summary":"Get Integration","description":"Get a specific integration.","operationId":"get_integration_integrations__integration_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["integrations","integrations"],"summary":"Update Integration","description":"Update an integration.","operationId":"update_integration_integrations__integration_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["integrations","integrations"],"summary":"Delete Integration","description":"Delete an integration.","operationId":"delete_integration_integrations__integration_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integrations/{integration_id}/test":{"post":{"tags":["integrations","integrations"],"summary":"Test Integration","description":"Test an integration connection by making a test API call.","operationId":"test_integration_integrations__integration_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integrations/available/providers":{"get":{"tags":["integrations","integrations"],"summary":"Get Available Providers","description":"Get available integration providers.","operationId":"get_available_providers_integrations_available_providers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squads":{"post":{"tags":["squads","squads"],"summary":"Create Squad","description":"Create a new squad with intelligent routing.\n\nSupports:\n- Multiple agents with specialized roles\n- Intelligent transfer rules (context-aware, sentiment-based)\n- Warm transfers with conversation context\n- Load balancing and skill-based routing","operationId":"create_squad_squads_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SquadCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Squad"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["squads","squads"],"summary":"List Squads","description":"List squads for the current tenant.","operationId":"list_squads_squads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Squad"},"title":"Response List Squads Squads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squads/{squad_id}":{"get":{"tags":["squads","squads"],"summary":"Get Squad","description":"Get a specific squad.","operationId":"get_squad_squads__squad_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Squad"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["squads","squads"],"summary":"Update Squad","description":"Update a squad with intelligent routing configuration.","operationId":"update_squad_squads__squad_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SquadUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Squad"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["squads","squads"],"summary":"Delete Squad","description":"Delete a squad.","operationId":"delete_squad_squads__squad_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squads/{squad_id}/transfer":{"post":{"tags":["squads","squads"],"summary":"Transfer To Squad","description":"Transfer a call to a squad member with intelligent routing.\n\nSupports:\n- Context-aware routing\n- Sentiment-based routing  \n- Keyword/intent-based routing\n- Warm transfers with conversation summary\n- Load balancing\n- Skill matching","operationId":"transfer_to_squad_squads__squad_id__transfer_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Transfer Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squads/{squad_id}/agents":{"get":{"tags":["squads","squads"],"summary":"Get Squad Agents","description":"Get agents in a squad.","operationId":"get_squad_agents_squads__squad_id__agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/squads/{squad_id}/sessions":{"get":{"tags":["squads","squads"],"summary":"Get Squad Sessions","description":"Get active and recent Squad sessions.\n\nShows conversation sessions being handled by Squad members.","operationId":"get_squad_sessions_squads__squad_id__sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"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"}}}}}}},"/squads/{squad_id}/analytics":{"get":{"tags":["squads","squads"],"summary":"Get Squad Analytics","description":"Get Squad analytics and performance metrics.\n\nIncludes:\n- Transfer statistics\n- Member utilization\n- Routing strategy performance\n- Session distribution","operationId":"get_squad_analytics_squads__squad_id__analytics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}},{"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"}}}}}}},"/squads/{squad_id}/reload":{"post":{"tags":["squads","squads"],"summary":"Reload Squad Cache","description":"Reload Squad configuration in all agent caches.\n\nUse this after updating Squad members or routing rules\nto ensure active agents pick up changes.","operationId":"reload_squad_cache_squads__squad_id__reload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"squad_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Squad Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/upload":{"post":{"tags":["files"],"summary":"Upload File","description":"Upload a file to the knowledge base.","operationId":"upload_file_files_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_files_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files":{"get":{"tags":["files"],"summary":"List Files","description":"List files for the current user/tenant.","operationId":"list_files_files_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FileResponse"},"title":"Response List Files Files Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}":{"get":{"tags":["files"],"summary":"Get File","description":"Get a specific file.","operationId":"get_file_files__file_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["files"],"summary":"Delete File","description":"Delete a file from storage and database.","operationId":"delete_file_files__file_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}/download":{"get":{"tags":["files"],"summary":"Download File","description":"Download a file with presigned URL.","operationId":"download_file_files__file_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}/sync":{"post":{"tags":["files"],"summary":"Sync File To Agent","description":"Sync a file to an agent's knowledge base.","operationId":"sync_file_to_agent_files__file_id__sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}},{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}/status":{"get":{"tags":["files"],"summary":"Get File Status","description":"Get file processing status.","operationId":"get_file_status_files__file_id__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}/sync-status":{"get":{"tags":["files"],"summary":"Get Sync Status","description":"Get detailed sync status including external agent task status.","operationId":"get_sync_status_files__file_id__sync_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/calls":{"get":{"tags":["logs"],"summary":"Get Call Logs","description":"Get call logs.","operationId":"get_call_logs_logs_calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start date for filtering","title":"Start Date"},"description":"Start date for filtering"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End date for filtering","title":"End Date"},"description":"End date for filtering"},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by agent ID","title":"Agent Id"},"description":"Filter by agent ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of records","default":100,"title":"Limit"},"description":"Maximum number of records"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"title":"Response Get Call Logs Logs Calls Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/chats":{"get":{"tags":["logs"],"summary":"Get Chat Logs","description":"Get chat logs.","operationId":"get_chat_logs_logs_chats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start date for filtering","title":"Start Date"},"description":"Start date for filtering"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End date for filtering","title":"End Date"},"description":"End date for filtering"},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by agent ID","title":"Agent Id"},"description":"Filter by agent ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of records","default":100,"title":"Limit"},"description":"Maximum number of records"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"title":"Response Get Chat Logs Logs Chats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/sessions":{"get":{"tags":["logs"],"summary":"Get Session Logs","description":"Get session logs.","operationId":"get_session_logs_logs_sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start date for filtering","title":"Start Date"},"description":"Start date for filtering"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End date for filtering","title":"End Date"},"description":"End date for filtering"},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by agent ID","title":"Agent Id"},"description":"Filter by agent ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of records","default":100,"title":"Limit"},"description":"Maximum number of records"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"title":"Response Get Session Logs Logs Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/sessions/{session_id}":{"get":{"tags":["logs"],"summary":"Get Session Logs Detailed","description":"Get detailed logs for a specific session.","operationId":"get_session_logs_detailed_logs_sessions__session_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"title":"Response Get Session Logs Detailed Logs Sessions  Session Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/calls/{call_id}":{"get":{"tags":["logs"],"summary":"Get Call Logs Detailed","description":"Get detailed logs for a specific call.","operationId":"get_call_logs_detailed_logs_calls__call_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"title":"Response Get Call Logs Detailed Logs Calls  Call Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/system":{"get":{"tags":["logs"],"summary":"Get System Logs","description":"Get system logs.","operationId":"get_system_logs_logs_system_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start date for filtering","title":"Start Date"},"description":"Start date for filtering"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End date for filtering","title":"End Date"},"description":"End date for filtering"},{"name":"log_level","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by log level","title":"Log Level"},"description":"Filter by log level"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Maximum number of records","default":100,"title":"Limit"},"description":"Maximum number of records"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogResponse"},"title":"Response Get System Logs Logs System Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/{log_id}":{"delete":{"tags":["logs"],"summary":"Delete Log","description":"Delete a log entry.","operationId":"delete_log_logs__log_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/cleanup":{"post":{"tags":["logs"],"summary":"Cleanup Old Logs","description":"Clean up old logs based on retention policy.","operationId":"cleanup_old_logs_logs_cleanup_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"retention_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Number of days to retain logs","default":90,"title":"Retention Days"},"description":"Number of days to retain logs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logs/export/{log_type}":{"get":{"tags":["logs"],"summary":"Export Logs","description":"Export logs in various formats (JSON, CSV, or Excel).","operationId":"export_logs_logs_export__log_type__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"log_type","in":"path","required":true,"schema":{"type":"string","title":"Log Type"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv|xlsx)$","default":"json","title":"Format"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"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"}}}}}}},"/testing/tools/test-all":{"get":{"tags":["testing"],"summary":"Test All Tools","description":"Test all agent tools to verify they are working correctly.\n\nThis endpoint runs non-destructive tests on all available tools\nto ensure they can be executed properly by agents.\n\nNote: This endpoint does not require authentication for testing purposes.","operationId":"test_all_tools_testing_tools_test_all_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/testing/tools/{tool_key}/test":{"post":{"tags":["testing"],"summary":"Test Single Tool","description":"Test a single tool with custom arguments.\n\nThis allows testing specific tools with custom parameters\nto validate their functionality.\n\nNote: This endpoint does not require authentication for testing purposes.","operationId":"test_single_tool_testing_tools__tool_key__test_post","parameters":[{"name":"tool_key","in":"path","required":true,"schema":{"type":"string","title":"Tool Key"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Test Args"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/testing/tools/registry/list":{"get":{"tags":["testing"],"summary":"List All Tools","description":"List all available tools in the registry with their configurations.\n\nNote: This endpoint does not require authentication for testing purposes.","operationId":"list_all_tools_testing_tools_registry_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/testing/tools/registry/seed":{"post":{"tags":["testing"],"summary":"Seed Tools","description":"Seed the tool registry with all 14 default agent tools.\n\nThis endpoint populates the database with the standard set of tools.\nNote: This endpoint does not require authentication for testing purposes.","operationId":"seed_tools_testing_tools_registry_seed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/testing/tools/integration-check":{"get":{"tags":["testing"],"summary":"Check Tool Integration","description":"Comprehensive integration check for all tools with LiveKit Cloud and External Agent Factory.\n\nThis endpoint verifies:\n1. Tool configuration is properly structured for external agent factory\n2. LiveKit-dependent tools (DTMF, Handoff) have correct parameters\n3. API keys are properly configured\n4. JSON payload format matches external agent factory expectations\n\nReturns detailed report on integration readiness.","operationId":"check_tool_integration_testing_tools_integration_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/testing/workflows/validate":{"post":{"tags":["testing"],"summary":"Validate Workflow","description":"Validate a workflow configuration before saving.\n\nChecks:\n- Node structure and types\n- Edge connections\n- Required fields\n- Tool availability\n- Circular dependencies","operationId":"validate_workflow_testing_workflows_validate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Workflow Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/testing/sessions/simulate":{"post":{"tags":["testing"],"summary":"Simulate Session","description":"Simulate a conversation session for testing.\n\nSimulates user inputs and agent responses without actually\ncreating a live session.","operationId":"simulate_session_testing_sessions_simulate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Simulation Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/testing/agents/{agent_id}/validate":{"post":{"tags":["testing"],"summary":"Validate Agent","description":"Validate an agent configuration.\n\nChecks:\n- Agent exists and is accessible\n- Required configuration fields\n- Tool configurations\n- Workflow assignments\n- Provider settings","operationId":"validate_agent_testing_agents__agent_id__validate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/storage/voice-previews/{provider}/{voice_id}/{filename}":{"get":{"tags":["storage"],"summary":"Serve Voice Preview","description":"Serve voice preview files from MinIO.\n\nThis endpoint proxies requests to MinIO, allowing frontend applications\nto access voice previews without direct MinIO access.\n\nPath format: /storage/voice-previews/{provider}/{voice_id}/{filename}\nExample: /storage/voice-previews/openai/coral/preview.mp3","operationId":"serve_voice_preview_storage_voice_previews__provider___voice_id___filename__get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}},{"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"}}}}}}},"/storage/call-recordings/{path}":{"get":{"tags":["storage"],"summary":"Serve Call Recording","description":"Serve call recording files from MinIO (AUTHENTICATED).\n\nThis endpoint requires authentication and verifies the user has access\nto the recording based on tenant ownership.\n\nPath format: /storage/call-recordings/{tenant_id}/calls/{call_id}/{filename}\nExample: /storage/call-recordings/8a18c5c3-f449-46ae-bb71-5e813b0ebb44/calls/67403062-3f47-45cb-9f6b-cd92c07c92bc/recording.mp4","operationId":"serve_call_recording_storage_call_recordings__path__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/storage/{bucket}/{path}":{"get":{"tags":["storage"],"summary":"Serve Storage File","description":"Generic endpoint to serve files from any MinIO bucket.\n\nThis endpoint can be used to serve files from any bucket, but voice-previews\nand call-recordings should use the dedicated endpoints above.\n\nPath format: /storage/{bucket}/{path}","operationId":"serve_storage_file_storage__bucket___path__get","parameters":[{"name":"bucket","in":"path","required":true,"schema":{"type":"string","title":"Bucket"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"expires","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"URL expiration in seconds (for presigned URLs)","title":"Expires"},"description":"URL expiration in seconds (for presigned URLs)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/caller-profiles":{"get":{"tags":["caller-profiles"],"summary":"List Caller Profiles","description":"List caller profiles for the current tenant. Most recently active first.","operationId":"list_caller_profiles_caller_profiles_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by agent","title":"Agent Id"},"description":"Filter by agent"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by phone or name","title":"Search"},"description":"Search by phone or name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerProfileListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/caller-profiles/agents/{agent_id}/{phone}":{"get":{"tags":["caller-profiles"],"summary":"Get Caller Profile","description":"Get a single caller profile for a specific (agent, phone) pair.","operationId":"get_caller_profile_caller_profiles_agents__agent_id___phone__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["caller-profiles"],"summary":"Update Caller Profile","description":"Update name / notes / language on a caller profile.","operationId":"update_caller_profile_caller_profiles_agents__agent_id___phone__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["caller-profiles"],"summary":"Delete Caller Profile","description":"Delete (forget) a caller profile. Past call records are preserved.\nThe next call from this number will be treated as a first-time call.","operationId":"delete_caller_profile_caller_profiles_agents__agent_id___phone__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/caller-profiles/agents/{agent_id}/{phone}/calls":{"get":{"tags":["caller-profiles"],"summary":"Get Caller Calls","description":"List past calls for a caller with this agent.","operationId":"get_caller_calls_caller_profiles_agents__agent_id___phone__calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CallerCallSummary"},"title":"Response Get Caller Calls Caller Profiles Agents  Agent Id   Phone  Calls Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/livekit":{"post":{"summary":"Handle Livekit Webhook","operationId":"handle_livekit_webhook_webhooks_livekit_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/live":{"get":{"summary":"Liveness Check","description":"Kubernetes liveness probe - checks if app is running.","operationId":"liveness_check_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"summary":"Readiness Check","description":"Kubernetes readiness probe - checks if app is ready to serve traffic.","operationId":"readiness_check_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metrics":{"get":{"summary":"Metrics","description":"Prometheus metrics endpoint.","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AITranscriptSummary":{"properties":{"summary":{"type":"string","title":"Summary","description":"Concise summary of the conversation"},"sentiment":{"anyOf":[{"$ref":"#/components/schemas/SentimentAnalysis"},{"type":"null"}],"description":"Sentiment analysis"},"topics":{"items":{"type":"string"},"type":"array","title":"Topics","description":"Main topics discussed"},"action_items":{"items":{"type":"string"},"type":"array","title":"Action Items","description":"Follow-up actions identified"},"key_moments":{"items":{"type":"string"},"type":"array","title":"Key Moments","description":"Key moments in the conversation"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Call outcome: resolved, escalated, etc."},"call_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Type","description":"Type of call: support, sales, inquiry, etc."}},"type":"object","required":["summary"],"title":"AITranscriptSummary","description":"AI-generated transcript summary and analysis.","example":{"action_items":["Send confirmation email"],"call_type":"support","key_moments":["Agent offered a 10% credit which resolved the issue"],"outcome":"resolved","sentiment":{"agent_performance":"Agent handled the situation professionally","customer_satisfaction":"Customer was satisfied with the resolution","overall":"positive","score":0.7},"summary":"Customer called about a billing issue. Agent resolved it by applying a credit.","topics":["billing","account credit"]}},"AddKnowledgeUrlsRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Urls","description":"List of URLs to add to knowledge base"}},"type":"object","required":["urls"],"title":"AddKnowledgeUrlsRequest","description":"Request to add knowledge base URLs to an agent."},"AddKnowledgeUrlsResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"urls_added":{"type":"integer","title":"Urls Added"},"task_id":{"type":"string","title":"Task Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["agent_id","urls_added","task_id","message"],"title":"AddKnowledgeUrlsResponse","description":"Response from adding knowledge URLs."},"AdminNotification":{"properties":{"has_issues":{"type":"boolean","title":"Has Issues"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"total_issues":{"type":"integer","title":"Total Issues","default":0},"critical_count":{"type":"integer","title":"Critical Count","default":0},"warning_count":{"type":"integer","title":"Warning Count","default":0},"message":{"type":"string","title":"Message"},"critical_issues":{"items":{},"type":"array","title":"Critical Issues","default":[]},"warning_issues":{"items":{},"type":"array","title":"Warning Issues","default":[]},"recommended_actions":{"items":{},"type":"array","title":"Recommended Actions","default":[]}},"type":"object","required":["has_issues","message"],"title":"AdminNotification","description":"Admin notification for API key issues."},"Agent":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_user_lang":{"type":"string","maxLength":10,"minLength":2,"title":"Default User Lang"},"thinking_lang":{"type":"string","maxLength":10,"minLength":2,"title":"Thinking Lang"},"default_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Voice Id"},"interruptions_enabled":{"type":"boolean","title":"Interruptions Enabled","default":true},"escalation_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation Policy"},"model_provider":{"type":"string","pattern":"^(openai|azure_openai|anthropic|google|groq|cerebras|deepseek|xai|perplexity|together|amazon_bedrock|anyscale|openrouter|deepinfra)$","title":"Model Provider","default":"openai"},"model_name":{"type":"string","maxLength":100,"minLength":1,"title":"Model Name","default":"gpt-4o-mini"},"temperature":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Temperature","default":0.7},"max_tokens":{"type":"integer","maximum":1000.0,"minimum":50.0,"title":"Max Tokens","default":150},"system_prompt":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"System Prompt","description":"Full system prompt defining the agent's role, behavior, and instructions. Falls back to description if not set."},"persona":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Persona","description":"Short character/personality descriptor (e.g. 'Friendly British accountant'). Renders as 'Personality: ...' in the system prompt."},"first_message_mode":{"type":"string","pattern":"^(assistant-speaks-first|wait-for-user|assistant-speaks-first-with-model-generated-message)$","title":"First Message Mode","default":"assistant-speaks-first"},"first_message_script":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"First Message Script"},"voice_provider":{"type":"string","pattern":"^(elevenlabs|cartesia|openai|deepgram|google|azure|rime|lmnt)$","title":"Voice Provider","default":"elevenlabs"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"background_sound_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Background Sound Url"},"input_min_characters":{"type":"integer","maximum":100.0,"minimum":10.0,"title":"Input Min Characters","default":30},"transcriber_provider":{"type":"string","pattern":"^(deepgram|openai|assemblyai|google|azure)$","title":"Transcriber Provider","default":"deepgram"},"transcriber_model":{"type":"string","maxLength":100,"minLength":1,"title":"Transcriber Model","default":"nova-3"},"background_denoising":{"type":"boolean","title":"Background Denoising","default":true},"confidence_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence Threshold","default":0.4},"multilingual_enabled":{"type":"boolean","title":"Multilingual Enabled","description":"Enable automatic language detection for multilingual conversations","default":false},"supported_languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Languages","description":"List of language codes the agent supports (e.g., ['en', 'es', 'fr']). If multilingual_enabled=true and this is empty, all languages are supported."},"language_detection_provider":{"type":"string","pattern":"^(auto|deepgram|whisper)$","title":"Language Detection Provider","description":"Provider for language detection: 'auto' uses STT provider's built-in detection","default":"auto"},"respond_in_user_language":{"type":"boolean","title":"Respond In User Language","description":"When true, agent responds in the detected user language. When false, always responds in default_user_lang.","default":true},"wait_seconds":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Wait Seconds","default":0.4},"smart_endpointing":{"type":"boolean","title":"Smart Endpointing","default":true},"interruption_words":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Interruption Words","default":3},"punctuation_boundary_ms":{"type":"integer","maximum":500.0,"minimum":50.0,"title":"Punctuation Boundary Ms","default":100},"no_punctuation_boundary_ms":{"type":"integer","maximum":3000.0,"minimum":800.0,"title":"No Punctuation Boundary Ms","default":1500},"silence_timeout_seconds":{"type":"integer","maximum":120.0,"minimum":10.0,"title":"Silence Timeout Seconds","default":30},"max_duration_seconds":{"type":"integer","maximum":1800.0,"minimum":180.0,"title":"Max Duration Seconds","default":600},"idle_messages_enabled":{"type":"boolean","title":"Idle Messages Enabled","default":true},"max_idle_messages":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Idle Messages","default":3},"idle_timeout_seconds":{"type":"number","maximum":60.0,"minimum":5.0,"title":"Idle Timeout Seconds","default":7.5},"analysis_prompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Analysis Prompt"},"analysis_timeout_sec":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Analysis Timeout Sec","default":10},"min_messages_for_analysis":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Min Messages For Analysis","default":2},"voicemail_detection_enabled":{"type":"boolean","title":"Voicemail Detection Enabled","default":true},"voicemail_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Voicemail Message"},"end_call_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"End Call Message"},"keypad_input_enabled":{"type":"boolean","title":"Keypad Input Enabled","default":false},"keypad_timeout_seconds":{"type":"integer","maximum":6.0,"minimum":1.0,"title":"Keypad Timeout Seconds","default":2},"keypad_delimiters":{"type":"string","pattern":"^[#*]+$","title":"Keypad Delimiters","default":"#"},"sip_enabled":{"type":"boolean","title":"Sip Enabled","description":"Enable SIP/phone calling for this agent","default":false},"recording_enabled":{"type":"boolean","title":"Recording Enabled","description":"Enable call recording for this agent","default":true},"analytics_enabled":{"type":"boolean","title":"Analytics Enabled","description":"Enable analytics tracking for this agent","default":true},"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"status":{"$ref":"#/components/schemas/AgentStatus"},"meta_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta Data"},"workflow_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workflow Id"}},"type":"object","required":["created_at","name","default_user_lang","thinking_lang","id","owner_id","status"],"title":"Agent","description":"Agent response model."},"AgentCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_user_lang":{"type":"string","maxLength":10,"minLength":2,"title":"Default User Lang"},"thinking_lang":{"type":"string","maxLength":10,"minLength":2,"title":"Thinking Lang"},"default_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Voice Id"},"interruptions_enabled":{"type":"boolean","title":"Interruptions Enabled","default":true},"escalation_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation Policy"},"model_provider":{"type":"string","pattern":"^(openai|azure_openai|anthropic|google|groq|cerebras|deepseek|xai|perplexity|together|amazon_bedrock|anyscale|openrouter|deepinfra)$","title":"Model Provider","default":"openai"},"model_name":{"type":"string","maxLength":100,"minLength":1,"title":"Model Name","default":"gpt-4o-mini"},"temperature":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Temperature","default":0.7},"max_tokens":{"type":"integer","maximum":1000.0,"minimum":50.0,"title":"Max Tokens","default":150},"system_prompt":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"System Prompt","description":"Full system prompt defining the agent's role, behavior, and instructions. Falls back to description if not set."},"persona":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Persona","description":"Short character/personality descriptor (e.g. 'Friendly British accountant'). Renders as 'Personality: ...' in the system prompt."},"first_message_mode":{"type":"string","pattern":"^(assistant-speaks-first|wait-for-user|assistant-speaks-first-with-model-generated-message)$","title":"First Message Mode","default":"assistant-speaks-first"},"first_message_script":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"First Message Script"},"voice_provider":{"type":"string","pattern":"^(elevenlabs|cartesia|openai|deepgram|google|azure|rime|lmnt)$","title":"Voice Provider","default":"elevenlabs"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"background_sound_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Background Sound Url"},"input_min_characters":{"type":"integer","maximum":100.0,"minimum":10.0,"title":"Input Min Characters","default":30},"transcriber_provider":{"type":"string","pattern":"^(deepgram|openai|assemblyai|google|azure)$","title":"Transcriber Provider","default":"deepgram"},"transcriber_model":{"type":"string","maxLength":100,"minLength":1,"title":"Transcriber Model","default":"nova-3"},"background_denoising":{"type":"boolean","title":"Background Denoising","default":true},"confidence_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence Threshold","default":0.4},"multilingual_enabled":{"type":"boolean","title":"Multilingual Enabled","description":"Enable automatic language detection for multilingual conversations","default":false},"supported_languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Languages","description":"List of language codes the agent supports (e.g., ['en', 'es', 'fr']). If multilingual_enabled=true and this is empty, all languages are supported."},"language_detection_provider":{"type":"string","pattern":"^(auto|deepgram|whisper)$","title":"Language Detection Provider","description":"Provider for language detection: 'auto' uses STT provider's built-in detection","default":"auto"},"respond_in_user_language":{"type":"boolean","title":"Respond In User Language","description":"When true, agent responds in the detected user language. When false, always responds in default_user_lang.","default":true},"wait_seconds":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Wait Seconds","default":0.4},"smart_endpointing":{"type":"boolean","title":"Smart Endpointing","default":true},"interruption_words":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Interruption Words","default":3},"punctuation_boundary_ms":{"type":"integer","maximum":500.0,"minimum":50.0,"title":"Punctuation Boundary Ms","default":100},"no_punctuation_boundary_ms":{"type":"integer","maximum":3000.0,"minimum":800.0,"title":"No Punctuation Boundary Ms","default":1500},"silence_timeout_seconds":{"type":"integer","maximum":120.0,"minimum":10.0,"title":"Silence Timeout Seconds","default":30},"max_duration_seconds":{"type":"integer","maximum":1800.0,"minimum":180.0,"title":"Max Duration Seconds","default":600},"idle_messages_enabled":{"type":"boolean","title":"Idle Messages Enabled","default":true},"max_idle_messages":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Idle Messages","default":3},"idle_timeout_seconds":{"type":"number","maximum":60.0,"minimum":5.0,"title":"Idle Timeout Seconds","default":7.5},"analysis_prompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Analysis Prompt"},"analysis_timeout_sec":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Analysis Timeout Sec","default":10},"min_messages_for_analysis":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Min Messages For Analysis","default":2},"voicemail_detection_enabled":{"type":"boolean","title":"Voicemail Detection Enabled","default":true},"voicemail_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Voicemail Message"},"end_call_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"End Call Message"},"keypad_input_enabled":{"type":"boolean","title":"Keypad Input Enabled","default":false},"keypad_timeout_seconds":{"type":"integer","maximum":6.0,"minimum":1.0,"title":"Keypad Timeout Seconds","default":2},"keypad_delimiters":{"type":"string","pattern":"^[#*]+$","title":"Keypad Delimiters","default":"#"},"sip_enabled":{"type":"boolean","title":"Sip Enabled","description":"Enable SIP/phone calling for this agent","default":false},"recording_enabled":{"type":"boolean","title":"Recording Enabled","description":"Enable call recording for this agent","default":true},"analytics_enabled":{"type":"boolean","title":"Analytics Enabled","description":"Enable analytics tracking for this agent","default":true},"knowledge":{"anyOf":[{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Knowledge"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"channels":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Channels"}},"type":"object","required":["name","default_user_lang","thinking_lang"],"title":"AgentCreate","description":"Agent creation model."},"AgentCreateResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"version":{"type":"integer","title":"Version"},"livekit":{"additionalProperties":true,"type":"object","title":"Livekit"},"embed":{"additionalProperties":{"type":"string"},"type":"object","title":"Embed"},"sip":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sip"},"capabilities":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Capabilities"},"tools":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tools","default":[]},"workflow":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Workflow"},"client_messages":{"items":{"type":"string"},"type":"array","title":"Client Messages","default":["conversation-update","tool-calls","transcript.partial","transcript.final"]}},"type":"object","required":["agent_id","version","livekit","embed"],"title":"AgentCreateResponse","description":"Agent creation response model."},"AgentPerformance":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"tenant_id":{"type":"string","title":"Tenant Id"},"period_hours":{"type":"integer","title":"Period Hours"},"calls":{"additionalProperties":true,"type":"object","title":"Calls"},"tools":{"additionalProperties":true,"type":"object","title":"Tools"}},"type":"object","required":["agent_id","tenant_id","period_hours","calls","tools"],"title":"AgentPerformance","description":"Agent performance metrics."},"AgentRunRequest":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"conversation_id":{"type":"string","title":"Conversation Id"},"text":{"type":"string","title":"Text"},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["agent_id","conversation_id","text","context"],"title":"AgentRunRequest","description":"Agent run request model."},"AgentRunResponse":{"properties":{"response_text":{"type":"string","title":"Response Text"},"tool_invocations":{"items":{"$ref":"#/components/schemas/ToolInvocation"},"type":"array","title":"Tool Invocations","default":[]}},"type":"object","required":["response_text"],"title":"AgentRunResponse","description":"Agent run response model."},"AgentStatistics":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"status":{"type":"string","title":"Status"},"total_calls":{"type":"integer","title":"Total Calls"},"total_minutes":{"type":"number","title":"Total Minutes"},"avg_call_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Call Duration"},"avg_sentiment":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Sentiment"},"last_call_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Call At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["agent_id","agent_name","tenant_id","tenant_name","status","total_calls","total_minutes","avg_call_duration","avg_sentiment","last_call_at","created_at"],"title":"AgentStatistics","description":"Agent statistics for admin view."},"AgentStats":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"total_calls":{"type":"integer","title":"Total Calls"},"total_sessions":{"type":"integer","title":"Total Sessions"},"avg_call_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Call Duration"},"avg_sentiment_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Sentiment Score"},"success_rate":{"type":"number","title":"Success Rate"},"last_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call At"},"cost_this_month":{"type":"number","title":"Cost This Month"},"calls_today":{"type":"integer","title":"Calls Today"}},"type":"object","required":["agent_id","total_calls","total_sessions","avg_call_duration","avg_sentiment_score","success_rate","last_call_at","cost_this_month","calls_today"],"title":"AgentStats","description":"Agent statistics and performance metrics."},"AgentStatus":{"type":"string","enum":["draft","active","paused"],"title":"AgentStatus","description":"Agent status enumeration."},"AgentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"default_user_lang":{"anyOf":[{"type":"string","maxLength":10,"minLength":2},{"type":"null"}],"title":"Default User Lang"},"thinking_lang":{"anyOf":[{"type":"string","maxLength":10,"minLength":2},{"type":"null"}],"title":"Thinking Lang"},"default_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Voice Id"},"interruptions_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interruptions Enabled"},"escalation_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation Policy"},"status":{"anyOf":[{"$ref":"#/components/schemas/AgentStatus"},{"type":"null"}]},"model_provider":{"anyOf":[{"type":"string","pattern":"^(openai|azure_openai|anthropic|google|groq|cerebras|deepseek|xai|perplexity|together|amazon_bedrock|anyscale|openrouter|deepinfra)$"},{"type":"null"}],"title":"Model Provider"},"model_name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Model Name"},"temperature":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"max_tokens":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":50.0},{"type":"null"}],"title":"Max Tokens"},"system_prompt":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"System Prompt","description":"System prompt defining role/behavior. Send empty string to clear."},"persona":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Persona","description":"Short character/personality. Send empty string to clear."},"first_message_mode":{"anyOf":[{"type":"string","pattern":"^(assistant-speaks-first|wait-for-user|assistant-speaks-first-with-model-generated-message)$"},{"type":"null"}],"title":"First Message Mode"},"first_message_script":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"First Message Script"},"voice_provider":{"anyOf":[{"type":"string","pattern":"^(elevenlabs|cartesia|openai|deepgram|google|azure|rime|lmnt)$"},{"type":"null"}],"title":"Voice Provider"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"background_sound_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Background Sound Url"},"input_min_characters":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":10.0},{"type":"null"}],"title":"Input Min Characters"},"transcriber_provider":{"anyOf":[{"type":"string","pattern":"^(deepgram|openai|assemblyai|google|azure)$"},{"type":"null"}],"title":"Transcriber Provider"},"transcriber_model":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Transcriber Model"},"background_denoising":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Background Denoising"},"confidence_threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence Threshold"},"multilingual_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Multilingual Enabled"},"supported_languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Languages"},"language_detection_provider":{"anyOf":[{"type":"string","pattern":"^(auto|deepgram|whisper)$"},{"type":"null"}],"title":"Language Detection Provider"},"respond_in_user_language":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Respond In User Language"},"wait_seconds":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.1},{"type":"null"}],"title":"Wait Seconds"},"smart_endpointing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Smart Endpointing"},"interruption_words":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Interruption Words"},"punctuation_boundary_ms":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":50.0},{"type":"null"}],"title":"Punctuation Boundary Ms"},"no_punctuation_boundary_ms":{"anyOf":[{"type":"integer","maximum":3000.0,"minimum":800.0},{"type":"null"}],"title":"No Punctuation Boundary Ms"},"silence_timeout_seconds":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":10.0},{"type":"null"}],"title":"Silence Timeout Seconds"},"max_duration_seconds":{"anyOf":[{"type":"integer","maximum":1800.0,"minimum":180.0},{"type":"null"}],"title":"Max Duration Seconds"},"idle_messages_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Idle Messages Enabled"},"max_idle_messages":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Max Idle Messages"},"idle_timeout_seconds":{"anyOf":[{"type":"number","maximum":60.0,"minimum":5.0},{"type":"null"}],"title":"Idle Timeout Seconds"},"analysis_prompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Analysis Prompt"},"analysis_timeout_sec":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":1.0},{"type":"null"}],"title":"Analysis Timeout Sec"},"min_messages_for_analysis":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Min Messages For Analysis"},"voicemail_detection_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Voicemail Detection Enabled"},"voicemail_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Voicemail Message"},"end_call_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"End Call Message"},"keypad_input_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Keypad Input Enabled"},"keypad_timeout_seconds":{"anyOf":[{"type":"integer","maximum":6.0,"minimum":1.0},{"type":"null"}],"title":"Keypad Timeout Seconds"},"keypad_delimiters":{"anyOf":[{"type":"string","pattern":"^[#*]+$"},{"type":"null"}],"title":"Keypad Delimiters"},"sip_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sip Enabled","description":"Enable SIP/phone calling for this agent"},"recording_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recording Enabled","description":"Enable call recording for this agent"},"analytics_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Analytics Enabled","description":"Enable analytics tracking for this agent"}},"type":"object","title":"AgentUpdate","description":"Agent update model - all fields optional for partial updates."},"AnalysisConfig":{"properties":{"analysis_prompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Analysis Prompt"},"analysis_timeout_sec":{"type":"integer","maximum":60.0,"minimum":1.0,"title":"Analysis Timeout Sec","default":10},"min_messages_for_analysis":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Min Messages For Analysis","default":2}},"type":"object","title":"AnalysisConfig","description":"Call analysis configuration."},"BlockTenantRequest":{"properties":{"blocked":{"type":"boolean","title":"Blocked","description":"True to block, False to unblock"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for blocking"},"block_services":{"items":{"type":"string"},"type":"array","title":"Block Services","description":"Services to block: calls, agents, sip, recordings, analytics","default":["calls","agents"]}},"type":"object","required":["blocked"],"title":"BlockTenantRequest","description":"Request to block/unblock a tenant."},"Body_bulk_upload_phone_numbers_agents__agent_id__phone_numbers_bulk_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file with phone numbers"}},"type":"object","required":["file"],"title":"Body_bulk_upload_phone_numbers_agents__agent_id__phone_numbers_bulk_upload_post"},"Body_create_agent_with_documents_agents_multipart_post":{"properties":{"agent_data":{"type":"string","title":"Agent Data","description":"JSON string of AgentCreate model"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","required":["agent_data"],"title":"Body_create_agent_with_documents_agents_multipart_post"},"Body_upload_documents_agents__agent_id__documents_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_upload_documents_agents__agent_id__documents_post"},"Body_upload_documents_agents__agent_id__documents_upload_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"PDF or document files to upload"}},"type":"object","required":["files"],"title":"Body_upload_documents_agents__agent_id__documents_upload_post"},"Body_upload_file_files_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_file_files_upload_post"},"BootstrapResponse":{"properties":{"etag":{"type":"string","title":"Etag"},"snapshot_at":{"type":"string","format":"date-time","title":"Snapshot At"},"agent":{"additionalProperties":true,"type":"object","title":"Agent"},"workflow":{"anyOf":[{"$ref":"#/components/schemas/BootstrapWorkflow"},{"type":"null"}]},"tools":{"items":{"$ref":"#/components/schemas/BootstrapToolInstance"},"type":"array","title":"Tools"},"transfer_targets":{"items":{"$ref":"#/components/schemas/BootstrapTransferTarget"},"type":"array","title":"Transfer Targets"},"available_specialists":{"items":{"$ref":"#/components/schemas/BootstrapSpecialist"},"type":"array","title":"Available Specialists"},"tool_connections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tool Connections"}},"type":"object","required":["etag","snapshot_at","agent","workflow","tools","transfer_targets","available_specialists","tool_connections"],"title":"BootstrapResponse","description":"Read-only snapshot of an agent's full runtime configuration."},"BootstrapSpecialist":{"properties":{"persona_id":{"type":"string","title":"Persona Id"},"specialist_type":{"type":"string","title":"Specialist Type"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"config_overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Overrides"}},"type":"object","required":["persona_id","specialist_type","display_name","description","agent_id","agent_name","config_overrides"],"title":"BootstrapSpecialist","description":"One row of the tenant's persona handoff registry, joined to the backing agent."},"BootstrapToolInstance":{"properties":{"id":{"type":"string","title":"Id"},"tool_key":{"type":"string","title":"Tool Key"},"instance_name":{"type":"string","title":"Instance Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"enabled":{"type":"boolean","title":"Enabled"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tool_type":{"type":"string","title":"Tool Type"},"version":{"type":"integer","title":"Version"}},"type":"object","required":["id","tool_key","instance_name","display_name","enabled","config","description","tool_type","version"],"title":"BootstrapToolInstance"},"BootstrapTransferTarget":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"target":{"type":"string","title":"Target"},"mode":{"type":"string","title":"Mode"},"sip_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Trunk Id"},"sip_headers":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sip Headers"},"briefing_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefing Prompt"},"transfer_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Announcement"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["id","name","target","mode","sip_trunk_id","sip_headers","briefing_prompt","transfer_announcement","tags"],"title":"BootstrapTransferTarget"},"BootstrapWorkflow":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"nodes":{"title":"Nodes"},"edges":{"title":"Edges"},"global_nodes":{"anyOf":[{},{"type":"null"}],"title":"Global Nodes"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","name","description","nodes","edges","global_nodes","status"],"title":"BootstrapWorkflow"},"BulkUploadResponse":{"properties":{"total_uploaded":{"type":"integer","title":"Total Uploaded"},"successful":{"type":"integer","title":"Successful"},"failed":{"type":"integer","title":"Failed"},"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Results"}},"type":"object","required":["total_uploaded","successful","failed","results"],"title":"BulkUploadResponse","description":"Response for bulk phone number upload."},"CallPermissionCheck":{"properties":{"can_call":{"type":"boolean","title":"Can Call"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"next_available_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Available Time"},"current_schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Schedule"},"calls_today":{"type":"integer","title":"Calls Today"},"calls_remaining":{"type":"integer","title":"Calls Remaining"}},"type":"object","required":["can_call","calls_today","calls_remaining"],"title":"CallPermissionCheck","description":"Check if agent can make a call now."},"CallResponse":{"properties":{"call_id":{"type":"string","format":"uuid","title":"Call Id"},"session_id":{"type":"string","format":"uuid","title":"Session Id"},"room_name":{"type":"string","title":"Room Name"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"direction":{"type":"string","title":"Direction"},"from_number":{"type":"string","title":"From Number"},"to_number":{"type":"string","title":"To Number"},"status":{"type":"string","title":"Status"},"recording":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recording"}},"type":"object","required":["call_id","session_id","room_name","agent_id","direction","from_number","to_number","status"],"title":"CallResponse","description":"Call response model."},"CallStatistics":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"period":{"additionalProperties":true,"type":"object","title":"Period"},"total_calls":{"type":"integer","title":"Total Calls"},"completed_calls":{"type":"integer","title":"Completed Calls"},"failed_calls":{"type":"integer","title":"Failed Calls"},"success_rate":{"type":"number","title":"Success Rate"},"avg_duration_seconds":{"type":"number","title":"Avg Duration Seconds"},"total_duration_minutes":{"type":"number","title":"Total Duration Minutes"},"quota":{"anyOf":[{"$ref":"#/components/schemas/QuotaInfo"},{"type":"null"}],"description":"Quota and remaining calls info"}},"type":"object","required":["tenant_id","period","total_calls","completed_calls","failed_calls","success_rate","avg_duration_seconds","total_duration_minutes"],"title":"CallStatistics","description":"Call statistics for a period."},"CallStatus":{"properties":{"call_id":{"type":"string","format":"uuid","title":"Call Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"direction":{"type":"string","title":"Direction"},"from_number":{"type":"string","title":"From Number"},"to_number":{"type":"string","title":"To Number"},"status":{"type":"string","title":"Status"},"disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"sentiment_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sentiment Score"},"language_detected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Detected"},"started_at":{"type":"string","title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ended At"}},"type":"object","required":["call_id","agent_id","tenant_id","direction","from_number","to_number","status","started_at"],"title":"CallStatus","description":"Call status model."},"CallTarget":{"properties":{"to_number":{"type":"string","maxLength":32,"minLength":2,"title":"To Number"},"from_number":{"anyOf":[{"type":"string","maxLength":32,"minLength":2},{"type":"null"}],"title":"From Number"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"}},"type":"object","required":["to_number"],"title":"CallTarget","description":"Single call target in a campaign."},"CallTimeout":{"properties":{"silence_timeout_seconds":{"type":"integer","maximum":120.0,"minimum":10.0,"title":"Silence Timeout Seconds","default":30},"max_duration_seconds":{"type":"integer","maximum":1800.0,"minimum":180.0,"title":"Max Duration Seconds","default":600},"idle_messages_enabled":{"type":"boolean","title":"Idle Messages Enabled","default":true},"max_idle_messages":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Idle Messages","default":3},"idle_timeout_seconds":{"type":"number","maximum":60.0,"minimum":5.0,"title":"Idle Timeout Seconds","default":7.5}},"type":"object","title":"CallTimeout","description":"Call timeout and duration settings."},"CallerCallSummary":{"properties":{"call_id":{"type":"string","title":"Call Id"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"direction":{"type":"string","title":"Direction"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"}},"type":"object","required":["call_id","direction"],"title":"CallerCallSummary"},"CallerProfileListResponse":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/CallerProfileResponse"},"type":"array","title":"Profiles"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["profiles","total"],"title":"CallerProfileListResponse"},"CallerProfileResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"phone_number":{"type":"string","title":"Phone Number"},"total_calls":{"type":"integer","title":"Total Calls"},"first_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Seen At"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At"},"last_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call Id"},"last_call_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call Summary"},"last_call_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call Outcome"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"preferred_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Language"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"notes":{"additionalProperties":true,"type":"object","title":"Notes"}},"type":"object","required":["id","tenant_id","agent_id","phone_number","total_calls"],"title":"CallerProfileResponse"},"CallerProfileUpdate":{"properties":{"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"preferred_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Language"},"notes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"CallerProfileUpdate"},"CallingSchedule":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"enabled":{"type":"boolean","title":"Enabled","default":true},"time_windows":{"items":{"$ref":"#/components/schemas/TimeWindow"},"type":"array","minItems":1,"title":"Time Windows"},"max_concurrent_calls":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Max Concurrent Calls","default":1},"call_interval_seconds":{"type":"integer","maximum":3600.0,"minimum":0.0,"title":"Call Interval Seconds","description":"Minimum seconds between calls","default":0},"respect_dnc":{"type":"boolean","title":"Respect Dnc","description":"Respect Do Not Call lists","default":true},"respect_timezone":{"type":"boolean","title":"Respect Timezone","description":"Respect recipient's timezone","default":true}},"type":"object","required":["name","time_windows"],"title":"CallingSchedule","description":"Calling schedule configuration."},"CampaignRequest":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"targets":{"items":{"$ref":"#/components/schemas/CallTarget"},"type":"array","maxItems":1000,"minItems":1,"title":"Targets"},"schedule_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Schedule At"},"concurrent_calls":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Concurrent Calls","default":1},"retry_failed":{"type":"boolean","title":"Retry Failed","default":false},"retry_attempts":{"type":"integer","maximum":3.0,"minimum":0.0,"title":"Retry Attempts","default":0},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"URL for campaign progress webhooks"},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret","description":"Secret for webhook signature verification"},"notify_on_call_complete":{"type":"boolean","title":"Notify On Call Complete","description":"Send webhook for each call completion","default":false}},"type":"object","required":["agent_id","name","targets"],"title":"CampaignRequest","description":"Campaign/batch calling request."},"CampaignResponse":{"properties":{"campaign_id":{"type":"string","title":"Campaign Id"},"agent_id":{"type":"string","title":"Agent Id"},"name":{"type":"string","title":"Name"},"total_targets":{"type":"integer","title":"Total Targets"},"status":{"type":"string","title":"Status"},"scheduled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"calls_initiated":{"type":"integer","title":"Calls Initiated"},"calls_completed":{"type":"integer","title":"Calls Completed"},"calls_failed":{"type":"integer","title":"Calls Failed"}},"type":"object","required":["campaign_id","agent_id","name","total_targets","status","scheduled_at","started_at","calls_initiated","calls_completed","calls_failed"],"title":"CampaignResponse","description":"Campaign response."},"CampaignStatus":{"properties":{"campaign_id":{"type":"string","title":"Campaign Id"},"status":{"type":"string","title":"Status"},"progress":{"type":"number","title":"Progress"},"calls_initiated":{"type":"integer","title":"Calls Initiated"},"calls_completed":{"type":"integer","title":"Calls Completed"},"calls_failed":{"type":"integer","title":"Calls Failed"},"calls_pending":{"type":"integer","title":"Calls Pending"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"estimated_completion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Estimated Completion"},"target_errors":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Target Errors"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["campaign_id","status","progress","calls_initiated","calls_completed","calls_failed","calls_pending","started_at","completed_at","estimated_completion"],"title":"CampaignStatus","description":"Campaign status response."},"CapacityMetrics":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"current_active_calls":{"type":"integer","title":"Current Active Calls"},"total_capacity":{"type":"integer","title":"Total Capacity"},"utilization_percentage":{"type":"number","title":"Utilization Percentage"},"available_capacity":{"type":"integer","title":"Available Capacity"},"agents_count":{"type":"integer","title":"Agents Count"}},"type":"object","required":["tenant_id","current_active_calls","total_capacity","utilization_percentage","available_capacity","agents_count"],"title":"CapacityMetrics","description":"System capacity metrics."},"ChatRequest":{"properties":{"query":{"type":"string","maxLength":2000,"minLength":1,"title":"Query","description":"User's message/query"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"Existing conversation ID to continue"},"context_overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context Overrides","description":"Additional context for this query"},"top_k":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Top K","description":"Number of knowledge chunks to retrieve","default":5}},"type":"object","required":["query"],"title":"ChatRequest","description":"Request to chat with an agent via text."},"ChatResponse":{"properties":{"response":{"type":"string","title":"Response","description":"Agent's text response"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload","description":"Tool output payload if applicable"},"selected_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Tool","description":"Tool that was executed"},"conversation_id":{"type":"string","title":"Conversation Id","description":"Conversation ID for follow-up messages"},"trace_id":{"type":"string","title":"Trace Id","description":"Trace ID for debugging"},"execution_time_ms":{"type":"integer","title":"Execution Time Ms","description":"Execution time in milliseconds"},"outcome_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Label","description":"Outcome classification"},"versions":{"additionalProperties":{"type":"string"},"type":"object","title":"Versions","description":"Version information (kb, policy, tools)"}},"type":"object","required":["response","conversation_id","trace_id","execution_time_ms","versions"],"title":"ChatResponse","description":"Response from agent chat."},"ConversationControl":{"properties":{"wait_seconds":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Wait Seconds","default":0.4},"smart_endpointing":{"type":"boolean","title":"Smart Endpointing","default":true},"interruption_words":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Interruption Words","default":3},"punctuation_boundary_ms":{"type":"integer","maximum":500.0,"minimum":50.0,"title":"Punctuation Boundary Ms","default":100},"no_punctuation_boundary_ms":{"type":"integer","maximum":3000.0,"minimum":800.0,"title":"No Punctuation Boundary Ms","default":1500}},"type":"object","title":"ConversationControl","description":"Conversation control settings."},"ConversationDetail":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"agent_id":{"type":"string","title":"Agent Id"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"messages":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Messages"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["conversation_id","agent_id","created_at","updated_at","messages"],"title":"ConversationDetail","description":"Full conversation with all messages."},"DashboardAnalytics":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"generated_at":{"type":"string","title":"Generated At"},"period_hours":{"type":"integer","title":"Period Hours"},"real_time":{"additionalProperties":true,"type":"object","title":"Real Time"},"call_statistics":{"additionalProperties":true,"type":"object","title":"Call Statistics"},"capacity":{"additionalProperties":true,"type":"object","title":"Capacity"},"agents":{"items":{},"type":"array","title":"Agents"},"quota":{"anyOf":[{"$ref":"#/components/schemas/QuotaInfo"},{"type":"null"}],"description":"Quota and remaining calls info"}},"type":"object","required":["tenant_id","generated_at","period_hours","real_time","call_statistics","capacity","agents"],"title":"DashboardAnalytics","description":"Complete dashboard analytics."},"DocumentListResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"documents":{"items":{"$ref":"#/components/schemas/DocumentMetadata"},"type":"array","title":"Documents"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["agent_id","documents","total"],"title":"DocumentListResponse","description":"Response for document list."},"DocumentMetadata":{"properties":{"document_id":{"type":"string","title":"Document Id"},"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"},"checksum":{"type":"string","title":"Checksum"},"created_at":{"type":"string","title":"Created At"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"}},"type":"object","required":["document_id","filename","content_type","checksum","created_at"],"title":"DocumentMetadata","description":"Metadata for a document in knowledge base."},"FileResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"filename":{"type":"string","title":"Filename"},"original_filename":{"type":"string","title":"Original Filename"},"file_type":{"type":"string","title":"File Type"},"file_size":{"type":"integer","title":"File Size"},"mime_type":{"type":"string","title":"Mime Type"},"status":{"type":"string","title":"Status"},"public_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Url"},"sync_status":{"type":"string","title":"Sync Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","filename","original_filename","file_type","file_size","mime_type","status","sync_status","created_at","updated_at"],"title":"FileResponse","description":"File response model."},"GenerateSystemPromptRequest":{"properties":{"brief":{"type":"string","maxLength":2000,"minLength":10,"title":"Brief","description":"Short description of the agent's purpose, role, and context."},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name","description":"Agent name (used in the prompt's identity section)."},"language":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Language","description":"Primary language code, e.g. 'en'.","default":"en"},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company","description":"Company / organization the agent represents."},"industry":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Industry","description":"Industry or vertical, e.g. 'telecom', 'healthcare'."},"tone":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Tone","description":"Tone or personality, e.g. 'friendly and professional'."},"additional_context":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Additional Context","description":"Optional extra notes — common questions, escalation rules, what to avoid, etc."}},"type":"object","required":["brief"],"title":"GenerateSystemPromptRequest","description":"Brief description the user wants expanded into a full system prompt."},"GenerateSystemPromptResponse":{"properties":{"system_prompt":{"type":"string","title":"System Prompt","description":"The full generated system prompt."},"char_count":{"type":"integer","title":"Char Count","description":"Character count of the generated prompt."},"model":{"type":"string","title":"Model","description":"Model that produced the prompt."},"provider":{"type":"string","title":"Provider","description":"LLM provider used."},"tokens_used":{"type":"integer","title":"Tokens Used","description":"Total tokens consumed for generation.","default":0}},"type":"object","required":["system_prompt","char_count","model","provider"],"title":"GenerateSystemPromptResponse","description":"Generated system prompt ready to drop into agent create/update."},"GlobalNodePlan":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true},"enterCondition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entercondition"}},"type":"object","title":"GlobalNodePlan","description":"Global node configuration."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HttpWebhookAuthConfig":{"properties":{"type":{"anyOf":[{"type":"string","enum":["none","bearer","basic","api_key"]},{"type":"null"}],"title":"Type","default":"none"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"api_key_header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Header","default":"X-API-Key"},"api_key_value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Value"}},"type":"object","title":"HttpWebhookAuthConfig"},"Integration":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"provider":{"type":"string","title":"Provider"},"service_type":{"type":"string","title":"Service Type"},"enabled":{"type":"boolean","title":"Enabled"},"status":{"type":"string","title":"Status"},"health_status":{"type":"string","title":"Health Status"},"last_health_check":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Health Check"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","tenant_id","provider","service_type","enabled","status","health_status","created_at","updated_at"],"title":"Integration","description":"Integration response model."},"IntegrationCreate":{"properties":{"provider":{"type":"string","maxLength":50,"minLength":1,"title":"Provider"},"service_type":{"type":"string","pattern":"^(llm|asr|tts|mt|sip|tool)$","title":"Service Type"},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"API keys and configuration"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["provider","service_type","config"],"title":"IntegrationCreate","description":"Integration creation model."},"IntegrationUpdate":{"properties":{"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"IntegrationUpdate","description":"Integration update model."},"KeypadConfig":{"properties":{"keypad_input_enabled":{"type":"boolean","title":"Keypad Input Enabled","default":false},"keypad_timeout_seconds":{"type":"integer","maximum":6.0,"minimum":1.0,"title":"Keypad Timeout Seconds","default":2},"keypad_delimiters":{"type":"string","pattern":"^[#*]+$","title":"Keypad Delimiters","default":"#"}},"type":"object","title":"KeypadConfig","description":"Keypad input configuration."},"KnowledgeBaseStatsResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"current_kb_version":{"type":"string","title":"Current Kb Version"},"chunk_count":{"type":"integer","title":"Chunk Count"},"status":{"type":"string","title":"Status"},"document_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Count"},"last_updated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Updated"}},"type":"object","required":["agent_id","current_kb_version","chunk_count","status"],"title":"KnowledgeBaseStatsResponse","description":"Response for knowledge base statistics."},"LogResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"session_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Session Id"},"call_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Call Id"},"log_type":{"type":"string","title":"Log Type"},"log_level":{"type":"string","title":"Log Level"},"message":{"type":"string","title":"Message"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trace Id"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["id","tenant_id","log_type","log_level","message","timestamp"],"title":"LogResponse","description":"Log response model."},"Message":{"properties":{"role":{"type":"string","title":"Role","description":"'user' or 'assistant'"},"content":{"type":"string","title":"Content"},"timestamp":{"type":"string","title":"Timestamp"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["role","content","timestamp"],"title":"Message","description":"Single message in a conversation."},"MessagePlan":{"properties":{"firstMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firstmessage"},"idleMessages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Idlemessages"},"idleMessageMaxSpokenCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Idlemessagemaxspokencount"}},"type":"object","title":"MessagePlan","description":"Message plan for first messages."},"ModelConfig":{"properties":{"provider":{"type":"string","pattern":"^(openai|azure_openai|anthropic|google|groq|cerebras|deepseek|xai|perplexity|together|amazon_bedrock|anyscale|openrouter|deepinfra)$","title":"Provider","default":"openai"},"model_name":{"type":"string","maxLength":100,"minLength":1,"title":"Model Name","default":"gpt-4o-mini"},"temperature":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Temperature","default":0.7},"max_tokens":{"type":"integer","maximum":1000.0,"minimum":50.0,"title":"Max Tokens","default":150},"first_message_mode":{"type":"boolean","title":"First Message Mode","default":true},"first_message_script":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"First Message Script"}},"type":"object","title":"ModelConfig","description":"Model configuration for agents."},"NodeToolAttachRequest":{"properties":{"instance_name":{"type":"string","maxLength":120,"minLength":1,"title":"Instance Name"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["instance_name"],"title":"NodeToolAttachRequest","description":"Body for POST /workflows/{wf}/nodes/{node}/tools."},"OAuthAuthorizeResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"provider":{"type":"string","title":"Provider"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorization_url","provider","state"],"title":"OAuthAuthorizeResponse"},"OutboundCallRequest":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"to_number":{"type":"string","title":"To Number","description":"Destination phone number (E.164 format, spaces auto-stripped)"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number","description":"Caller ID (E.164 format, spaces auto-stripped)"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Additional call context/metadata"},"priority":{"type":"string","pattern":"^(low|normal|high|urgent)$","title":"Priority","description":"Call priority level","default":"normal"},"krisp_enabled":{"type":"boolean","title":"Krisp Enabled","description":"Enable Krisp noise cancellation for this call","default":true},"wait_until_answered":{"type":"boolean","title":"Wait Until Answered","description":"Wait for call to be answered before returning","default":false},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Custom caller ID display name"},"dtmf":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dtmf","description":"DTMF tones to send after call connects (e.g., '*123#ww456')"},"play_dialtone":{"type":"boolean","title":"Play Dialtone","description":"Play dial tone while call is connecting","default":false},"media_encryption":{"type":"string","pattern":"^(DISABLE|ALLOW|REQUIRE)$","title":"Media Encryption","description":"Media encryption level","default":"ALLOW"},"ringing_timeout_seconds":{"type":"integer","maximum":80.0,"minimum":1.0,"title":"Ringing Timeout Seconds","description":"Max time to wait for answer (1-80 seconds)","default":80},"max_call_duration_seconds":{"type":"integer","maximum":86400.0,"minimum":60.0,"title":"Max Call Duration Seconds","description":"Maximum call duration","default":3600},"hide_phone_number":{"type":"boolean","title":"Hide Phone Number","description":"Hide phone number from participant attributes","default":false},"custom_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Custom Headers","description":"Custom SIP X-* headers"}},"type":"object","required":["agent_id","to_number"],"title":"OutboundCallRequest","description":"Outbound call request model with full LiveKit SIP support."},"OutboundConfigResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"phone_numbers":{"items":{"$ref":"#/components/schemas/OutboundPhoneNumber"},"type":"array","title":"Phone Numbers"},"schedules":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Schedules"},"default_schedule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Schedule Id"},"total_calls_today":{"type":"integer","title":"Total Calls Today"},"calls_remaining_today":{"type":"integer","title":"Calls Remaining Today"},"can_call_now":{"type":"boolean","title":"Can Call Now"},"next_available_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Available Time"}},"type":"object","required":["agent_id","phone_numbers","schedules","default_schedule_id","total_calls_today","calls_remaining_today","can_call_now","next_available_time"],"title":"OutboundConfigResponse","description":"Outbound configuration response."},"OutboundConfiguration":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"phone_numbers":{"items":{"$ref":"#/components/schemas/OutboundPhoneNumber"},"type":"array","minItems":1,"title":"Phone Numbers"},"schedules":{"items":{"$ref":"#/components/schemas/CallingSchedule"},"type":"array","minItems":1,"title":"Schedules"},"default_schedule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Schedule Id"}},"type":"object","required":["agent_id","phone_numbers","schedules"],"title":"OutboundConfiguration","description":"Complete outbound calling configuration."},"OutboundPhoneNumber":{"properties":{"phone_number":{"type":"string","pattern":"^\\+?[1-9]\\d{1,14}$","title":"Phone Number","description":"E.164 format"},"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"},"is_default":{"type":"boolean","title":"Is Default","description":"Use as default caller ID","default":false},"enabled":{"type":"boolean","title":"Enabled","default":true},"daily_limit":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Daily Limit","description":"Max calls per day"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["phone_number"],"title":"OutboundPhoneNumber","description":"Outbound phone number configuration."},"PasswordChange":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","maxLength":72,"minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"PasswordChange","description":"Password change model."},"PasswordResetConfirm":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","maxLength":100,"minLength":8,"title":"New Password"}},"type":"object","required":["token","new_password"],"title":"PasswordResetConfirm","description":"Password reset confirmation model."},"PasswordResetRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"PasswordResetRequest","description":"Password reset request model."},"PersonaCreate":{"properties":{"specialist_type":{"type":"string","title":"Specialist Type","description":"Stable slug the LLM uses (e.g. 'billing'). Lowercase, dashes/underscores ok."},"agent_id":{"type":"string","format":"uuid","title":"Agent Id","description":"UUID of the backing agent this persona points at."},"display_name":{"type":"string","maxLength":160,"minLength":1,"title":"Display Name","description":"Human-friendly UI label (e.g. 'Billing')."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"config_overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Overrides","description":"Reserved for future per-persona overrides on top of the backing agent's config. Empty/null in Phase 1–3."},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["specialist_type","agent_id","display_name"],"title":"PersonaCreate"},"PersonaResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"specialist_type":{"type":"string","title":"Specialist Type"},"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"config_overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Overrides"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","specialist_type","agent_id","display_name","description","config_overrides","tags","enabled","created_at","updated_at"],"title":"PersonaResponse"},"PersonaUpdate":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"config_overrides":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Overrides"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"PersonaUpdate"},"PhoneNumberListResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"phone_numbers":{"items":{"$ref":"#/components/schemas/PhoneNumberResponse"},"type":"array","title":"Phone Numbers"}},"type":"object","required":["agent_id","phone_numbers"],"title":"PhoneNumberListResponse","description":"Response for listing agent phone numbers."},"PhoneNumberResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"phone_number":{"type":"string","title":"Phone Number"},"provider":{"type":"string","title":"Provider"},"sip_uri":{"type":"string","title":"Sip Uri"},"dispatch_rule_id":{"type":"string","title":"Dispatch Rule Id"},"outbound_enabled":{"type":"boolean","title":"Outbound Enabled"},"outbound_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outbound Trunk Id","description":"LiveKit outbound trunk ID if outbound is enabled"},"outbound_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outbound Address","description":"SIP address used for outbound calls (e.g., sip.telnyx.com)"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"instructions":{"additionalProperties":true,"type":"object","title":"Instructions"},"provider_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Config"},"room_pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room Pattern","description":"LiveKit room naming pattern for this agent's calls"},"livekit_sip_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Livekit Sip Domain","description":"LiveKit SIP domain for this deployment"},"inbound_addresses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Inbound Addresses","description":"LiveKit inbound SIP server addresses"},"supported_providers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Supported Providers","description":"List of supported SIP providers with default addresses"}},"type":"object","required":["agent_id","phone_number","provider","sip_uri","dispatch_rule_id","outbound_enabled","status","created_at","instructions"],"title":"PhoneNumberResponse","description":"Response for phone number registration."},"PhoneNumberUpdate":{"properties":{"enable_outbound":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Outbound"},"status":{"anyOf":[{"type":"string","pattern":"^(active|inactive|suspended)$"},{"type":"null"}],"title":"Status"},"provider_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Config"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"PhoneNumberUpdate","description":"Schema for updating phone number configuration."},"PlatformStatistics":{"properties":{"total_tenants":{"type":"integer","title":"Total Tenants"},"active_tenants":{"type":"integer","title":"Active Tenants"},"blocked_tenants":{"type":"integer","title":"Blocked Tenants"},"total_users":{"type":"integer","title":"Total Users"},"active_users":{"type":"integer","title":"Active Users"},"total_agents":{"type":"integer","title":"Total Agents"},"active_agents":{"type":"integer","title":"Active Agents"},"total_calls_today":{"type":"integer","title":"Total Calls Today"},"total_calls_this_month":{"type":"integer","title":"Total Calls This Month"},"total_calls_all_time":{"type":"integer","title":"Total Calls All Time"},"total_minutes_today":{"type":"number","title":"Total Minutes Today"},"total_minutes_this_month":{"type":"number","title":"Total Minutes This Month"},"active_sessions":{"type":"integer","title":"Active Sessions"},"business_tenants":{"type":"integer","title":"Business Tenants"},"developer_tenants":{"type":"integer","title":"Developer Tenants"},"admin_tenants":{"type":"integer","title":"Admin Tenants"},"total_revenue_cents":{"type":"integer","title":"Total Revenue Cents"}},"type":"object","required":["total_tenants","active_tenants","blocked_tenants","total_users","active_users","total_agents","active_agents","total_calls_today","total_calls_this_month","total_calls_all_time","total_minutes_today","total_minutes_this_month","active_sessions","business_tenants","developer_tenants","admin_tenants","total_revenue_cents"],"title":"PlatformStatistics","description":"Platform-wide statistics for admin dashboard."},"ProviderConfig":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"service_type":{"$ref":"#/components/schemas/ServiceType"},"url":{"type":"string","maxLength":500,"minLength":1,"title":"Url"},"api_key":{"type":"string","minLength":1,"title":"Api Key"},"enabled":{"type":"boolean","title":"Enabled","default":true},"priority":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Priority","default":1},"timeout_seconds":{"type":"integer","maximum":120.0,"minimum":5.0,"title":"Timeout Seconds","default":30},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["name","service_type","url","api_key"],"title":"ProviderConfig","description":"Provider configuration model."},"ProviderValidationRequest":{"properties":{"voice_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Provider","description":"TTS provider name","default":"elevenlabs"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id","description":"Voice ID to validate"},"transcriber_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcriber Provider","description":"STT provider name","default":"deepgram"},"transcriber_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcriber Model","description":"STT model to validate"},"model_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Provider","description":"LLM provider name","default":"openai"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name","description":"LLM model to validate"}},"type":"object","title":"ProviderValidationRequest","description":"Request model for provider validation."},"QuotaInfo":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"monthly_call_limit":{"type":"integer","title":"Monthly Call Limit","description":"Maximum calls allowed per month"},"calls_used_this_month":{"type":"integer","title":"Calls Used This Month","description":"Calls made this month"},"calls_remaining":{"type":"integer","title":"Calls Remaining","description":"Calls remaining this month"},"calls_usage_percentage":{"type":"number","title":"Calls Usage Percentage","description":"Percentage of monthly call quota used"},"max_concurrent_calls":{"type":"integer","title":"Max Concurrent Calls","description":"Maximum concurrent calls allowed"},"current_active_calls":{"type":"integer","title":"Current Active Calls","description":"Currently active calls"},"concurrent_calls_remaining":{"type":"integer","title":"Concurrent Calls Remaining","description":"Available concurrent call slots"},"concurrent_usage_percentage":{"type":"number","title":"Concurrent Usage Percentage","description":"Percentage of concurrent capacity used"},"total_minutes_used":{"type":"number","title":"Total Minutes Used","description":"Total minutes used all-time"},"quota_exceeded":{"type":"boolean","title":"Quota Exceeded","description":"Whether quota has been exceeded"},"status":{"type":"string","title":"Status","description":"Tenant status (active, blocked, etc.)"}},"type":"object","required":["tenant_id","monthly_call_limit","calls_used_this_month","calls_remaining","calls_usage_percentage","max_concurrent_calls","current_active_calls","concurrent_calls_remaining","concurrent_usage_percentage","total_minutes_used","quota_exceeded","status"],"title":"QuotaInfo","description":"Tenant quota and usage information."},"RealTimeMetrics":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"tenant_id":{"type":"string","title":"Tenant Id"},"active_calls":{"type":"integer","title":"Active Calls"},"active_participants":{"type":"integer","title":"Active Participants"},"active_agents":{"type":"integer","title":"Active Agents"}},"type":"object","required":["timestamp","tenant_id","active_calls","active_participants","active_agents"],"title":"RealTimeMetrics","description":"Real-time system metrics."},"RecordingListItem":{"properties":{"id":{"type":"string","title":"Id"},"call_id":{"type":"string","title":"Call Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"filename":{"type":"string","title":"Filename"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"format":{"type":"string","title":"Format"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","call_id","filename","format","status","created_at"],"title":"RecordingListItem","description":"Recording list item (summary)."},"RecordingListResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"total":{"type":"integer","title":"Total"},"recordings":{"items":{"$ref":"#/components/schemas/RecordingListItem"},"type":"array","title":"Recordings"}},"type":"object","required":["agent_id","total","recordings"],"title":"RecordingListResponse","description":"List of recordings."},"RecordingResponse":{"properties":{"id":{"type":"string","title":"Id"},"call_id":{"type":"string","title":"Call Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"livekit_egress_id":{"type":"string","title":"Livekit Egress Id"},"filename":{"type":"string","title":"Filename"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"format":{"type":"string","title":"Format"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"processing_started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Started At"},"processing_completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Completed At"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"},"expires_in_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Seconds"}},"type":"object","required":["id","call_id","livekit_egress_id","filename","format","status","created_at"],"title":"RecordingResponse","description":"Single recording details.","example":{"call_id":"call-789","created_at":"2025-12-05T10:00:00Z","download_url":"https://minio.example.com/presigned-url","duration_seconds":180,"expires_in_seconds":3600,"file_size_bytes":5242880,"filename":"recording.mp4","format":"mp4","id":"abc-123-def-456","livekit_egress_id":"egress-xyz","processing_completed_at":"2025-12-05T10:03:15Z","session_id":"session-012","status":"completed"}},"RefreshTokenRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshTokenRequest","description":"Refresh token request model."},"RegisterPhoneNumberRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number","description":"E.164 format phone number (e.g., +15551234567)"},"provider":{"type":"string","title":"Provider","description":"SIP provider: livekit, twilio, vonage, telnyx, bandwidth, or custom"},"trunk_numbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Trunk Numbers","description":"Phone numbers on this trunk (defaults to [phone_number])"},"allowed_addresses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Addresses","description":"Allowed IP addresses (empty = allow all)"},"allowed_numbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Numbers","description":"Allowed caller numbers (empty = allow all)"},"auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Username","description":"SIP authentication username (REQUIRED for Vonage outbound)"},"auth_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Password","description":"SIP authentication password (REQUIRED for Vonage outbound)"},"enable_outbound":{"type":"boolean","title":"Enable Outbound","description":"Enable outbound calling (frontend may also send as 'outbound_enabled')","default":false},"outbound_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outbound Address","description":"Provider's SIP termination URI for outbound calls. REQUIRED for outbound calling. Get this from your provider's dashboard. Examples: - Vonage: sip-us.vonage.com - Twilio: pstn.twilio.com - Telnyx: sip.telnyx.com"},"outbound_numbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outbound Numbers","description":"Phone numbers for outbound caller ID"},"outbound_transport":{"type":"string","pattern":"^(AUTO|UDP|TCP|TLS)$","title":"Outbound Transport","description":"SIP transport protocol: AUTO, UDP, TCP, or TLS","default":"AUTO"},"destination_country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"Destination Country","description":"Two-letter country code (e.g., 'US', 'IN'). Required for India compliance."},"media_encryption":{"type":"string","pattern":"^(DISABLE|ALLOW|REQUIRE)$","title":"Media Encryption","description":"Media encryption: DISABLE, ALLOW, or REQUIRE (ALLOW recommended)","default":"ALLOW"},"krisp_enabled":{"type":"boolean","title":"Krisp Enabled","description":"Enable Krisp noise cancellation for better call quality","default":true},"ringing_timeout_seconds":{"type":"integer","maximum":300.0,"minimum":1.0,"title":"Ringing Timeout Seconds","description":"Maximum time for call to ring (1-300 seconds)","default":30},"max_call_duration_seconds":{"type":"integer","maximum":86400.0,"minimum":60.0,"title":"Max Call Duration Seconds","description":"Maximum call duration (60-86400 seconds)","default":3600},"hide_phone_number":{"type":"boolean","title":"Hide Phone Number","description":"Hide caller phone number from participant attributes for privacy","default":false},"custom_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Custom Headers","description":"Custom SIP X-* headers to include in requests"},"headers_to_attributes":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers To Attributes","description":"Map SIP headers to participant attributes"},"dtmf_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dtmf Config","description":"DTMF and IVR configuration","example":{"auto_navigate_ivr":true,"dtmf_sequence":"*123#ww456","dtmf_timeout":30,"ivr_detection":true}},"transfer_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Transfer Config","description":"Call transfer configuration","example":{"allowed_destinations":["tel:+15105550100"],"cold_transfer_enabled":true,"requires_confirmation":true,"supervisor_phone":"tel:+15105550100","warm_transfer_enabled":false}},"agent_features":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Agent Features","description":"Agent-specific telephony features","example":{"call_screening":false,"recording_enabled":true,"sentiment_analysis":true,"transcription_enabled":true}},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional metadata"},"provider_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Config","description":"Provider-specific configuration (stored in database as JSON)"}},"type":"object","required":["phone_number","provider"],"title":"RegisterPhoneNumberRequest","description":"Request to register a phone number for an agent.\n\nProvide phone number and trunk details - LiveKit handles the SIP infrastructure.\n\nFor LiveKit phone numbers (provider='livekit'):\n- Purchase your number through LiveKit Cloud dashboard first\n- No trunk configuration needed - LiveKit manages the infrastructure\n- Just provide the phone number and it will be configured automatically\n\nFor external providers (twilio, vonage, etc.):\n- You must own the number already\n- SIP trunk configuration is required\n- You'll receive a SIP URI to configure in provider's dashboard\n\n**IMPORTANT FOR VONAGE USERS:**\nVonage Elastic SIP Trunking requires your trunk domain in the outbound_address.\nFormat: {your-trunk-domain}.sip-{region}.vonage.com\nExample: mrassistant-developer.sip-us.vonage.com\nFind this in Vonage Dashboard → SIP Trunks → Your Trunk → Outbound Calling section."},"SIPTrunk":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"trunk_type":{"type":"string","pattern":"^(inbound|outbound)$","title":"Trunk Type"},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"sip_uri":{"type":"string","title":"Sip Uri"},"livekit_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Livekit Trunk Id"},"dispatch_rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dispatch Rule Id"},"status":{"type":"string","title":"Status"},"last_health_check":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Health Check"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","trunk_type","id","tenant_id","sip_uri","status","created_at","updated_at"],"title":"SIPTrunk","description":"SIP trunk response model."},"SIPTrunkCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"trunk_type":{"type":"string","pattern":"^(inbound|outbound)$","title":"Trunk Type"},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"sip_uri":{"type":"string","minLength":1,"title":"Sip Uri"},"auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Username"},"auth_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Password"},"provider_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Config"}},"type":"object","required":["name","trunk_type","sip_uri"],"title":"SIPTrunkCreate","description":"SIP trunk creation model."},"SIPTrunkUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"phone_numbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Phone Numbers"},"auth_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Username"},"auth_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Password"},"provider_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provider Config"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"SIPTrunkUpdate","description":"SIP trunk update model."},"SentimentAnalysis":{"properties":{"overall":{"type":"string","title":"Overall","description":"Overall sentiment: positive, neutral, negative, mixed"},"score":{"type":"number","title":"Score","description":"Sentiment score from -1.0 (negative) to 1.0 (positive)"},"customer_satisfaction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Satisfaction","description":"Assessment of customer satisfaction"},"agent_performance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Performance","description":"Assessment of agent handling"}},"type":"object","required":["overall","score"],"title":"SentimentAnalysis","description":"AI-generated sentiment analysis."},"ServiceType":{"type":"string","enum":["asr","tts","mt","llm"],"title":"ServiceType","description":"Service type enumeration."},"SessionCreate":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"session_meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Session Meta"}},"type":"object","required":["agent_id"],"title":"SessionCreate","description":"Session creation model."},"SessionListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SessionSummary"},"type":"array","title":"Sessions"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["sessions","total","limit","offset"],"title":"SessionListResponse","description":"List of conversation sessions."},"SessionSummary":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"message_count":{"type":"integer","title":"Message Count"},"last_message_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Preview"}},"type":"object","required":["conversation_id","created_at","updated_at","message_count"],"title":"SessionSummary","description":"Summary of a conversation session."},"SessionTokenResponse":{"properties":{"room":{"type":"string","title":"Room"},"token":{"type":"string","title":"Token"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"livekit_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Livekit Url"},"workflow":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Workflow"},"workflow_state":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Workflow State"}},"type":"object","required":["room","token"],"title":"SessionTokenResponse","description":"Session token response model for LiveKit room access."},"SetPasswordRequest":{"properties":{"new_password":{"type":"string","maxLength":72,"minLength":8,"title":"New Password"}},"type":"object","required":["new_password"],"title":"SetPasswordRequest","description":"Set password for OAuth users who don't have one."},"SignUpRequest":{"properties":{"username":{"type":"string","maxLength":50,"minLength":3,"title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":72,"minLength":8,"title":"Password"},"role":{"$ref":"#/components/schemas/UserRole","default":"business"}},"type":"object","required":["username","email","password"],"title":"SignUpRequest","description":"Sign up request model."},"SignUpResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"},"role":{"$ref":"#/components/schemas/UserRole"},"message":{"type":"string","title":"Message"}},"type":"object","required":["user_id","username","email","role","message"],"title":"SignUpResponse","description":"Sign up response model."},"SingleProviderValidationRequest":{"properties":{"provider":{"type":"string","title":"Provider","description":"Provider name (e.g., 'elevenlabs', 'deepgram')"},"provider_type":{"type":"string","title":"Provider Type","description":"Provider type: 'tts', 'stt', or 'llm'"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id","description":"Voice ID (for TTS)"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model name (for STT/LLM)"}},"type":"object","required":["provider","provider_type"],"title":"SingleProviderValidationRequest","description":"Request model for single provider validation."},"Squad":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"agents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Agents"},"transfer_rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Transfer Rules"},"routing_strategy":{"type":"string","title":"Routing Strategy"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","name","agents","routing_strategy","status","created_at","updated_at"],"title":"Squad","description":"Squad response model."},"SquadCallStatsResponse":{"properties":{"squad_id":{"type":"string","title":"Squad Id"},"date":{"type":"string","title":"Date"},"total_calls":{"type":"integer","title":"Total Calls"},"by_agent":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Agent"},"average_calls_per_agent":{"type":"number","title":"Average Calls Per Agent"}},"type":"object","required":["squad_id","date","total_calls","by_agent","average_calls_per_agent"],"title":"SquadCallStatsResponse","description":"Squad call statistics response."},"SquadCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"members":{"items":{"$ref":"#/components/schemas/SquadMember"},"type":"array","minItems":1,"title":"Members","description":"Squad members with configurations"},"transfer_rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/TransferRule"},"type":"array"},{"type":"null"}],"title":"Transfer Rules","description":"Intelligent transfer rules"},"routing_strategy":{"type":"string","pattern":"^(round_robin|load_balanced|skill_based|sentiment_based|context_aware)$","title":"Routing Strategy","default":"round_robin"},"default_member":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Member","description":"Default member role for initial routing"},"agents":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Agents","description":"Legacy: Simple agent ID list"}},"type":"object","required":["name","members"],"title":"SquadCreate","description":"Squad creation model with intelligent routing support."},"SquadMember":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id","description":"Agent ID"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Member display name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"Member role (e.g., 'Orders', 'Returns', 'VIP')"},"specialization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specialization","description":"What this member specializes in"},"skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills","description":"Skills/capabilities"},"priority":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Priority","description":"Priority level (1=highest)","default":1},"max_concurrent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent","description":"Max concurrent calls"},"working_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Working Hours","description":"Working hours schedule"}},"type":"object","required":["agent_id"],"title":"SquadMember","description":"Squad member configuration with role and skills."},"SquadOutboundCampaignRequest":{"properties":{"squad_id":{"type":"string","format":"uuid","title":"Squad Id"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"targets":{"items":{"additionalProperties":true,"type":"object"},"type":"array","minItems":1,"title":"Targets"},"routing_strategy":{"type":"string","pattern":"^(round_robin|load_based|skill_based|priority)$","title":"Routing Strategy","default":"load_based"},"concurrent_calls_per_agent":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Concurrent Calls Per Agent","default":2},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"}},"type":"object","required":["squad_id","name","targets"],"title":"SquadOutboundCampaignRequest","description":"Squad-based outbound campaign request."},"SquadUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"members":{"anyOf":[{"items":{"$ref":"#/components/schemas/SquadMember"},"type":"array"},{"type":"null"}],"title":"Members"},"transfer_rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/TransferRule"},"type":"array"},{"type":"null"}],"title":"Transfer Rules"},"routing_strategy":{"anyOf":[{"type":"string","pattern":"^(round_robin|load_balanced|skill_based|sentiment_based|context_aware)$"},{"type":"null"}],"title":"Routing Strategy"},"status":{"anyOf":[{"type":"string","pattern":"^(active|inactive|archived)$"},{"type":"null"}],"title":"Status"},"default_member":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Member"},"agents":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Agents"}},"type":"object","title":"SquadUpdate","description":"Squad update model with intelligent routing support."},"TaskStatusResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"status":{"type":"string","title":"Status","description":"pending, running, completed, failed"},"progress":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress","description":"Progress percentage (0-100)"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["task_id","status","created_at","updated_at"],"title":"TaskStatusResponse","description":"Response for task status."},"TemplateCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":3,"title":"Name"},"use_case_key":{"type":"string","maxLength":100,"minLength":3,"pattern":"^[a-z_]+$","title":"Use Case Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"recommended_config":{"additionalProperties":true,"type":"object","title":"Recommended Config"},"required_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Required Tools"},"sample_first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample First Message"},"is_public":{"type":"boolean","title":"Is Public","default":false}},"type":"object","required":["name","use_case_key","recommended_config"],"title":"TemplateCreate","description":"Create custom agent template."},"TemplateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"owner_id":{"type":"string","format":"uuid","title":"Owner Id"},"name":{"type":"string","title":"Name"},"use_case_key":{"type":"string","title":"Use Case Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"recommended_config":{"additionalProperties":true,"type":"object","title":"Recommended Config"},"required_tools":{"items":{"type":"string"},"type":"array","title":"Required Tools"},"sample_first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample First Message"},"is_system_template":{"type":"boolean","title":"Is System Template"},"is_public":{"type":"boolean","title":"Is Public"},"usage_count":{"type":"integer","title":"Usage Count"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","owner_id","name","use_case_key","description","recommended_config","required_tools","sample_first_message","is_system_template","is_public","usage_count","created_at","updated_at"],"title":"TemplateResponse","description":"Agent template response."},"TemplateUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":3},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"recommended_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recommended Config"},"required_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Required Tools"},"sample_first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample First Message"},"is_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Public"}},"type":"object","title":"TemplateUpdate","description":"Update agent template."},"Tenant":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"billing_plan":{"type":"string","maxLength":100,"minLength":1,"title":"Billing Plan"},"sip_enabled":{"type":"boolean","title":"Sip Enabled","default":false},"recording_enabled":{"type":"boolean","title":"Recording Enabled","default":true},"analytics_enabled":{"type":"boolean","title":"Analytics Enabled","default":true},"max_concurrent_calls":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Max Concurrent Calls","default":10},"monthly_call_limit":{"type":"integer","minimum":0.0,"title":"Monthly Call Limit","default":1000},"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"monthly_usage_cents":{"type":"integer","title":"Monthly Usage Cents"},"meta_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta Data"},"sip_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Domain"},"sip_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Username"},"hipaa_enabled":{"type":"boolean","title":"Hipaa Enabled","default":false},"pci_enabled":{"type":"boolean","title":"Pci Enabled","default":false},"recording_format":{"type":"string","title":"Recording Format","default":"mp4"},"retention_days":{"type":"integer","title":"Retention Days","default":90},"data_encryption_enabled":{"type":"boolean","title":"Data Encryption Enabled","default":true},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"webhook_timeout_seconds":{"type":"integer","title":"Webhook Timeout Seconds","default":20},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","billing_plan","id","status","monthly_usage_cents","created_at","updated_at"],"title":"Tenant","description":"Tenant response model."},"TenantCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"billing_plan":{"type":"string","maxLength":100,"minLength":1,"title":"Billing Plan"},"sip_enabled":{"type":"boolean","title":"Sip Enabled","default":false},"recording_enabled":{"type":"boolean","title":"Recording Enabled","default":true},"analytics_enabled":{"type":"boolean","title":"Analytics Enabled","default":true},"max_concurrent_calls":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Max Concurrent Calls","default":10},"monthly_call_limit":{"type":"integer","minimum":0.0,"title":"Monthly Call Limit","default":1000},"sip_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Domain"},"sip_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Username"},"sip_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Password"}},"type":"object","required":["name","billing_plan"],"title":"TenantCreate","description":"Tenant creation model."},"TenantQuota":{"properties":{"max_agents":{"type":"integer","title":"Max Agents","description":"Maximum number of agents allowed","default":10},"max_calls_per_month":{"type":"integer","title":"Max Calls Per Month","description":"Maximum calls per month","default":1000},"max_concurrent_calls":{"type":"integer","title":"Max Concurrent Calls","description":"Maximum concurrent calls","default":10},"max_minutes_per_month":{"type":"number","title":"Max Minutes Per Month","description":"Maximum call minutes per month","default":5000.0}},"type":"object","title":"TenantQuota","description":"Tenant quota configuration."},"TenantStatistics":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"tenant_type":{"type":"string","title":"Tenant Type"},"billing_plan":{"type":"string","title":"Billing Plan"},"status":{"type":"string","title":"Status"},"total_agents":{"type":"integer","title":"Total Agents"},"total_calls":{"type":"integer","title":"Total Calls"},"total_minutes":{"type":"number","title":"Total Minutes"},"calls_this_month":{"type":"integer","title":"Calls This Month"},"minutes_this_month":{"type":"number","title":"Minutes This Month"},"active_sessions":{"type":"integer","title":"Active Sessions"},"quota":{"$ref":"#/components/schemas/TenantQuota"},"quota_exceeded":{"type":"boolean","title":"Quota Exceeded"},"calls_remaining":{"type":"integer","title":"Calls Remaining"},"minutes_remaining":{"type":"number","title":"Minutes Remaining"},"agents_remaining":{"type":"integer","title":"Agents Remaining"},"monthly_usage_cents":{"type":"integer","title":"Monthly Usage Cents"},"last_billing_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Billing Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_activity":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity"}},"type":"object","required":["tenant_id","tenant_name","tenant_type","billing_plan","status","total_agents","total_calls","total_minutes","calls_this_month","minutes_this_month","active_sessions","quota","quota_exceeded","calls_remaining","minutes_remaining","agents_remaining","monthly_usage_cents","last_billing_date","created_at","last_activity"],"title":"TenantStatistics","description":"Tenant usage statistics."},"TenantSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"tenant_type":{"type":"string","title":"Tenant Type"},"billing_plan":{"type":"string","title":"Billing Plan"},"status":{"type":"string","title":"Status"},"total_agents":{"type":"integer","title":"Total Agents"},"total_calls":{"type":"integer","title":"Total Calls"},"calls_this_month":{"type":"integer","title":"Calls This Month"},"quota_exceeded":{"type":"boolean","title":"Quota Exceeded"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","tenant_type","billing_plan","status","total_agents","total_calls","calls_this_month","quota_exceeded","created_at"],"title":"TenantSummary","description":"Brief tenant summary for listings."},"TenantUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"billing_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Plan"},"sip_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sip Enabled"},"recording_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recording Enabled"},"analytics_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Analytics Enabled"},"max_concurrent_calls":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Max Concurrent Calls"},"monthly_call_limit":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Monthly Call Limit"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"TenantUpdate","description":"Tenant update model."},"TimeWindow":{"properties":{"start_time":{"type":"string","pattern":"^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$","title":"Start Time","description":"HH:MM format"},"end_time":{"type":"string","pattern":"^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$","title":"End Time","description":"HH:MM format"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone (e.g., America/New_York)","default":"UTC"},"days_of_week":{"items":{"type":"integer"},"type":"array","maxItems":7,"minItems":1,"title":"Days Of Week","description":"0=Monday, 6=Sunday"}},"type":"object","required":["start_time","end_time","days_of_week"],"title":"TimeWindow","description":"Time window for calling."},"TokenRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"TokenRequest","description":"Token request model."},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","refresh_token","token_type","expires_in"],"title":"TokenResponse","description":"Token response model."},"ToolConfigUpdate":{"properties":{"tool_key":{"type":"string","title":"Tool Key"},"enabled":{"type":"boolean","title":"Enabled"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"type":"object","required":["tool_key","enabled"],"title":"ToolConfigUpdate","description":"Tool configuration update model."},"ToolCreate":{"properties":{"tool_key":{"type":"string","title":"Tool Key","description":"Tool type identifier from the registry. Must match an entry from GET /agents/{agent_id}/tools/registry/available."},"instance_name":{"type":"string","maxLength":120,"minLength":1,"title":"Instance Name","description":"Stable identifier the LLM will use to call this tool. Must be meaningful (e.g. 'transfer_to_billing', 'end_call_polite'); the same tool_key can be instanced multiple times with different configs. Must be unique per agent. Pattern: ^[A-Za-z][A-Za-z0-9_\\-]{0,118}[A-Za-z0-9]?$"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"Human-friendly UI label."},"enabled":{"type":"boolean","title":"Enabled","default":true},"config":{"anyOf":[{"$ref":"#/components/schemas/app__controllers__agent_tools__ToolConfig"},{"type":"null"}]},"tool_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Type","default":"function"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["tool_key","instance_name"],"title":"ToolCreate","description":"Schema for creating a new agent_tool *instance*.\n\nThe user is configuring a specific instance — a tool *type* (tool_key)\nplus a meaningful `instance_name` plus per-instance `config`. A tool\ncannot be added \"raw\" (just a type with no instance_name and no config)\n— the controller enforces this:\n  - tool_key MUST exist in the registry (`tool_registry` table)\n  - instance_name is REQUIRED (no silent default to tool_key)\n  - per-type required CFG fields are validated (e.g. http_webhook needs\n    url_allowlist; send_text_tool needs provider+from_e164+secret refs)"},"ToolExecuteResponse":{"properties":{"tool_key":{"type":"string","title":"Tool Key"},"instance_name":{"type":"string","title":"Instance Name"},"execution_id":{"type":"string","title":"Execution Id"},"result":{"title":"Result"},"status":{"type":"string","title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"execution_time_ms":{"type":"integer","title":"Execution Time Ms"}},"type":"object","required":["tool_key","instance_name","execution_id","result","status","execution_time_ms"],"title":"ToolExecuteResponse"},"ToolInstanceAttachment":{"properties":{"instance_name":{"type":"string","maxLength":120,"minLength":1,"title":"Instance Name"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["instance_name"],"title":"ToolInstanceAttachment","description":"V2: a workflow node's reference to an `agent_tools` instance.\n\n`instance_name` matches the `agent_tools.instance_name` of the tool the\nruntime should make available at this node. `parameters` are optional\nper-node overrides that the runtime can layer on top of the tool's\npersisted CFG when invoking from this specific node (e.g. force a\ndifferent `goodbye_instructions` for an `end_call` instance only when\nfired from a \"Refusal\" node)."},"ToolInvocation":{"properties":{"tool_key":{"type":"string","title":"Tool Key"},"name":{"type":"string","title":"Name"},"idempotency_key":{"type":"string","title":"Idempotency Key"},"args":{"additionalProperties":true,"type":"object","title":"Args"},"ui_confirm":{"type":"boolean","title":"Ui Confirm","default":false}},"type":"object","required":["tool_key","name","idempotency_key","args"],"title":"ToolInvocation","description":"Tool invocation model."},"ToolRegistryItem":{"properties":{"tool_key":{"type":"string","title":"Tool Key"},"connected":{"type":"boolean","title":"Connected"},"enabled_for_agent":{"type":"boolean","title":"Enabled For Agent"},"display_name":{"type":"string","title":"Display Name"},"ui_manifest":{"additionalProperties":true,"type":"object","title":"Ui Manifest"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"connect_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connect Url"}},"type":"object","required":["tool_key","connected","enabled_for_agent","display_name","ui_manifest","scopes"],"title":"ToolRegistryItem","description":"Tool registry item model."},"ToolResponse":{"properties":{"id":{"type":"string","title":"Id"},"agent_id":{"type":"string","title":"Agent Id"},"tool_key":{"type":"string","title":"Tool Key"},"instance_name":{"type":"string","title":"Instance Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"tool_type":{"type":"string","title":"Tool Type"},"enabled":{"type":"boolean","title":"Enabled"},"is_active":{"type":"boolean","title":"Is Active"},"version":{"type":"integer","title":"Version"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"raw_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Raw Schema"},"rpc_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rpc Method"},"parameters_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters Schema"},"registry_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Registry Info"}},"type":"object","required":["id","agent_id","tool_key","instance_name","display_name","tool_type","enabled","is_active","version","config","description","created_at"],"title":"ToolResponse","description":"Schema for tool response."},"ToolUpdate":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"instance_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tool_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Type"},"config":{"anyOf":[{"$ref":"#/components/schemas/app__controllers__agent_tools__ToolConfig"},{"type":"null"}]},"config_patch":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config Patch"}},"type":"object","title":"ToolUpdate","description":"Schema for updating an existing agent_tool instance (partial)."},"TranscriberConfig":{"properties":{"provider":{"type":"string","pattern":"^(deepgram|openai|assemblyai|google|azure)$","title":"Provider","default":"deepgram"},"model":{"type":"string","maxLength":100,"minLength":1,"title":"Model","default":"nova-3"},"background_denoising":{"type":"boolean","title":"Background Denoising","default":true},"confidence_threshold":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence Threshold","default":0.4}},"type":"object","title":"TranscriberConfig","description":"Transcriber configuration for agents."},"TranscriptListItem":{"properties":{"session_id":{"type":"string","title":"Session Id"},"channel":{"type":"string","title":"Channel"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"start_time":{"type":"string","title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"status":{"type":"string","title":"Status"},"message_count":{"type":"integer","title":"Message Count"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["session_id","channel","start_time","status","message_count"],"title":"TranscriptListItem","description":"Transcript list item (summary)."},"TranscriptListResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"total":{"type":"integer","title":"Total"},"transcripts":{"items":{"$ref":"#/components/schemas/TranscriptListItem"},"type":"array","title":"Transcripts"}},"type":"object","required":["agent_id","total","transcripts"],"title":"TranscriptListResponse","description":"List of transcripts."},"TranscriptMessage":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"role":{"type":"string","title":"Role"},"text":{"type":"string","title":"Text"},"lang":{"type":"string","title":"Lang"},"mt_from_lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mt From Lang"},"mt_to_lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mt To Lang"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","required":["timestamp","role","text","lang"],"title":"TranscriptMessage","description":"A single message in the transcript.\n\nThe 'role' field differentiates between speakers:\n- \"user\" or \"human\": Customer/caller speaking\n- \"assistant\" or \"agent\": AI agent speaking\n\nFrontend should use 'role' to style messages differently (e.g., alignment, colors).\nSee TRANSCRIPT_UI_GUIDE.md for UI implementation examples.","example":{"lang":"en","role":"user","text":"I need help with my account","timestamp":"2025-12-05T10:00:12Z"}},"TranscriptResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"agent_id":{"type":"string","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"channel":{"type":"string","title":"Channel"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"start_time":{"type":"string","title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"status":{"type":"string","title":"Status"},"messages":{"items":{"$ref":"#/components/schemas/TranscriptMessage"},"type":"array","title":"Messages"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"sentiment_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sentiment Score"},"language_detected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Detected"},"ai_summary":{"anyOf":[{"$ref":"#/components/schemas/AITranscriptSummary"},{"type":"null"}],"description":"AI-generated summary and analysis of the conversation (generated on demand)"}},"type":"object","required":["session_id","agent_id","agent_name","channel","start_time","status","messages"],"title":"TranscriptResponse","description":"Full transcript response with AI summary."},"TransferCallRequest":{"properties":{"transfer_to":{"type":"string","title":"Transfer To","description":"Destination: tel:+15105550100 or sip:user@domain.com"},"transfer_type":{"type":"string","pattern":"^(cold|warm)$","title":"Transfer Type","description":"Transfer type: cold or warm","default":"cold"},"play_dialtone":{"type":"boolean","title":"Play Dialtone","description":"Play dial tone during transfer","default":false}},"type":"object","required":["transfer_to"],"title":"TransferCallRequest","description":"Request to transfer a call."},"TransferRule":{"properties":{"from_member":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Member","description":"Source member role"},"to_member":{"type":"string","title":"To Member","description":"Target member role"},"conditions":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Conditions","description":"Conditions that trigger transfer"},"priority":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Priority","description":"Rule priority","default":1},"transfer_type":{"type":"string","pattern":"^(warm|cold|attended)$","title":"Transfer Type","default":"warm"},"context_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Context Fields","description":"Context fields to preserve"}},"type":"object","required":["to_member","conditions"],"title":"TransferRule","description":"Transfer rule configuration for intelligent routing."},"TransferTargetCreate":{"properties":{"name":{"type":"string","maxLength":160,"minLength":1,"title":"Name","description":"Friendly name (e.g. 'Billing')."},"target":{"type":"string","maxLength":255,"minLength":3,"title":"Target","description":"E.164 number, sip: URI, or LiveKit identity."},"mode":{"type":"string","title":"Mode","description":"warm | cold","default":"warm"},"sip_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Trunk Id"},"sip_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Sip Headers"},"briefing_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefing Prompt"},"transfer_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Announcement"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name","target"],"title":"TransferTargetCreate"},"TransferTargetResponse":{"properties":{"id":{"type":"string","title":"Id"},"owner_id":{"type":"string","title":"Owner Id"},"name":{"type":"string","title":"Name"},"target":{"type":"string","title":"Target"},"mode":{"type":"string","title":"Mode"},"sip_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Trunk Id"},"sip_headers":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sip Headers"},"briefing_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefing Prompt"},"transfer_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Announcement"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","owner_id","name","target","mode","sip_trunk_id","sip_headers","briefing_prompt","transfer_announcement","tags","enabled","created_at","updated_at"],"title":"TransferTargetResponse"},"TransferTargetUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"sip_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Trunk Id"},"sip_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Sip Headers"},"briefing_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Briefing Prompt"},"transfer_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Announcement"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"TransferTargetUpdate"},"UpdateQuotaRequest":{"properties":{"max_agents":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Max Agents","description":"Maximum agents"},"max_squads":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Max Squads","description":"Maximum squads"},"max_calls_per_month":{"anyOf":[{"type":"integer","maximum":1000000.0,"minimum":0.0},{"type":"null"}],"title":"Max Calls Per Month","description":"Monthly call limit"},"max_concurrent_calls":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Max Concurrent Calls","description":"Concurrent call limit"},"max_minutes_per_month":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Max Minutes Per Month","description":"Monthly minutes limit"},"max_campaigns":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Max Campaigns","description":"Maximum campaigns"},"max_recordings_gb":{"anyOf":[{"type":"number","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Max Recordings Gb","description":"Recording storage limit (GB)"},"max_files_gb":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Max Files Gb","description":"File storage limit (GB)"},"max_file_size_mb":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":1.0},{"type":"null"}],"title":"Max File Size Mb","description":"Max single file size (MB)"}},"type":"object","title":"UpdateQuotaRequest","description":"Request to update tenant quota (tenure)."},"UploadDocumentsResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"files_uploaded":{"type":"integer","title":"Files Uploaded"},"task_ids":{"items":{"type":"string"},"type":"array","title":"Task Ids"},"message":{"type":"string","title":"Message"}},"type":"object","required":["agent_id","files_uploaded","task_ids","message"],"title":"UploadDocumentsResponse","description":"Response from uploading documents."},"UseCaseTemplate":{"properties":{"use_case":{"type":"string","pattern":"^(appointment_scheduling|customer_support|lead_qualification|satisfaction_survey|[a-z_]+)$","title":"Use Case"},"user_language":{"type":"string","maxLength":10,"minLength":2,"title":"User Language","default":"en"},"organization_name":{"type":"string","maxLength":255,"minLength":1,"title":"Organization Name"},"custom_requirements":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Custom Requirements"}},"type":"object","required":["use_case","organization_name"],"title":"UseCaseTemplate","description":"Use case template for quick agent setup."},"UserInfo":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"type":"string","title":"Username"},"owner_id":{"type":"string","title":"Owner Id"},"role":{"$ref":"#/components/schemas/UserRole","default":"business"}},"type":"object","required":["user_id","username","owner_id"],"title":"UserInfo","description":"User info model."},"UserProfileUpdate":{"properties":{"username":{"anyOf":[{"type":"string","maxLength":50,"minLength":3},{"type":"null"}],"title":"Username"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name"}},"type":"object","title":"UserProfileUpdate","description":"User profile update model."},"UserRole":{"type":"string","enum":["business","developer","admin"],"title":"UserRole","description":"User role enumeration."},"UserSummary":{"properties":{"id":{"type":"string","title":"Id"},"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"is_active":{"type":"boolean","title":"Is Active"},"email_verified":{"type":"boolean","title":"Email Verified"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["id","username","email","role","tenant_id","tenant_name","is_active","email_verified","created_at"],"title":"UserSummary","description":"User summary for admin view."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VariableExtraction":{"properties":{"title":{"type":"string","title":"Title"},"type":{"type":"string","title":"Type","default":"string"},"enum":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enum"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["title"],"title":"VariableExtraction","description":"Variable extraction schema for conversation nodes."},"VariableExtractionPlan":{"properties":{"output":{"items":{"$ref":"#/components/schemas/VariableExtraction"},"type":"array","title":"Output"}},"type":"object","required":["output"],"title":"VariableExtractionPlan","description":"Variable extraction plan."},"VoiceConfig":{"properties":{"provider":{"type":"string","pattern":"^(elevenlabs|cartesia|openai|deepgram|google|azure|rime|lmnt)$","title":"Provider","default":"elevenlabs"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"background_sound_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Background Sound Url"},"input_min_characters":{"type":"integer","maximum":100.0,"minimum":10.0,"title":"Input Min Characters","default":30}},"type":"object","title":"VoiceConfig","description":"Voice configuration for agents."},"VoiceProcessingTest":{"properties":{"text":{"type":"string","maxLength":1000,"minLength":1,"title":"Text"},"source_language":{"type":"string","maxLength":10,"minLength":2,"title":"Source Language","default":"en"},"target_language":{"type":"string","maxLength":10,"minLength":2,"title":"Target Language","default":"en"},"test_type":{"type":"string","pattern":"^(asr|tts|llm)$","title":"Test Type","default":"tts"}},"type":"object","required":["text"],"title":"VoiceProcessingTest","description":"Voice processing test request."},"VoicemailConfig":{"properties":{"voicemail_detection_enabled":{"type":"boolean","title":"Voicemail Detection Enabled","default":true},"voicemail_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Voicemail Message"},"end_call_message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"End Call Message"}},"type":"object","title":"VoicemailConfig","description":"Voicemail and end call message configuration via LiveKit + Agent Workflow."},"Workflow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"nodes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Nodes"},"edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edges"},"global_nodes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Global Nodes"},"status":{"type":"string","title":"Status"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","name","nodes","edges","status","version","created_at","updated_at"],"title":"Workflow","description":"Workflow response model."},"WorkflowCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"nodes":{"items":{"$ref":"#/components/schemas/WorkflowNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/WorkflowEdge"},"type":"array","title":"Edges"},"global_nodes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Global Nodes"},"globalPrompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Globalprompt"}},"type":"object","required":["name","nodes","edges"],"title":"WorkflowCreate","description":"Workflow creation model."},"WorkflowEdge":{"properties":{"from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"},"to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"},"condition":{"anyOf":[{},{"type":"null"}],"title":"Condition","default":"always"}},"type":"object","title":"WorkflowEdge","description":"Workflow edge model for flow transitions."},"WorkflowNode":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"type":{"type":"string","pattern":"^(conversation|tool)$","title":"Type"},"isStart":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isstart","default":false},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"messagePlan":{"anyOf":[{"$ref":"#/components/schemas/MessagePlan"},{"type":"null"}]},"variableExtractionPlan":{"anyOf":[{"$ref":"#/components/schemas/VariableExtractionPlan"},{"type":"null"}]},"globalNodePlan":{"anyOf":[{"$ref":"#/components/schemas/GlobalNodePlan"},{"type":"null"}]},"tool":{"anyOf":[{"$ref":"#/components/schemas/app__controllers__workflows__ToolConfig"},{"type":"null"}]},"tool_instances":{"anyOf":[{"items":{"$ref":"#/components/schemas/ToolInstanceAttachment"},"type":"array"},{"type":"null"}],"title":"Tool Instances"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"type":"object","required":["id","type"],"title":"WorkflowNode","description":"Workflow node model for conversation flows."},"WorkflowUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"nodes":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkflowNode"},"type":"array"},{"type":"null"}],"title":"Nodes"},"edges":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkflowEdge"},"type":"array"},{"type":"null"}],"title":"Edges"},"global_nodes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Global Nodes"},"status":{"anyOf":[{"type":"string","pattern":"^(draft|active|archived)$"},{"type":"null"}],"title":"Status"}},"type":"object","title":"WorkflowUpdate","description":"Workflow update model."},"app__controllers__agent_config__AgentConfigUpdate":{"properties":{"model_configuration":{"anyOf":[{"$ref":"#/components/schemas/ModelConfig"},{"type":"null"}]},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/VoiceConfig"},{"type":"null"}]},"transcriber_config":{"anyOf":[{"$ref":"#/components/schemas/TranscriberConfig"},{"type":"null"}]},"conversation_control":{"anyOf":[{"$ref":"#/components/schemas/ConversationControl"},{"type":"null"}]},"call_timeout":{"anyOf":[{"$ref":"#/components/schemas/CallTimeout"},{"type":"null"}]},"analysis_config":{"anyOf":[{"$ref":"#/components/schemas/AnalysisConfig"},{"type":"null"}]},"voicemail_config":{"anyOf":[{"$ref":"#/components/schemas/VoicemailConfig"},{"type":"null"}]},"keypad_config":{"anyOf":[{"$ref":"#/components/schemas/KeypadConfig"},{"type":"null"}]}},"type":"object","title":"AgentConfigUpdate","description":"Complete agent configuration update model."},"app__controllers__agent_management__AgentConfigResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"basic_config":{"additionalProperties":true,"type":"object","title":"Basic Config"},"model_configuration":{"additionalProperties":true,"type":"object","title":"Model Configuration"},"voice_config":{"additionalProperties":true,"type":"object","title":"Voice Config"},"transcriber_config":{"additionalProperties":true,"type":"object","title":"Transcriber Config"},"conversation_control":{"additionalProperties":true,"type":"object","title":"Conversation Control"},"call_timeout":{"additionalProperties":true,"type":"object","title":"Call Timeout"},"analysis_config":{"additionalProperties":true,"type":"object","title":"Analysis Config"},"voicemail_config":{"additionalProperties":true,"type":"object","title":"Voicemail Config"},"keypad_config":{"additionalProperties":true,"type":"object","title":"Keypad Config"},"compliance_config":{"additionalProperties":true,"type":"object","title":"Compliance Config"}},"type":"object","required":["agent_id","basic_config","model_configuration","voice_config","transcriber_config","conversation_control","call_timeout","analysis_config","voicemail_config","keypad_config","compliance_config"],"title":"AgentConfigResponse","description":"Complete agent configuration response."},"app__controllers__agent_tools__ToolConfig":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"disallow_interruptions":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Disallow Interruptions","description":"If true, the tool runs uninterrupted. Default: false for read-only, true for mutating."},"requires_caller_consent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Caller Consent","description":"If true, the agent prompts the caller for consent before invoking."},"pii_classification":{"anyOf":[{"type":"string","enum":["none","low","medium","high"]},{"type":"null"}],"title":"Pii Classification","description":"Drives logging redaction policy."},"cost_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Unit","description":"Billing meter slug (e.g. 'lookup', 'sms', 'transfer')."},"goodbye_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goodbye Instructions"},"goodbye_max_duration_ms":{"anyOf":[{"type":"integer","maximum":20000.0,"minimum":500.0},{"type":"null"}],"title":"Goodbye Max Duration Ms"},"delete_room":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delete Room"},"wait_for_playout":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wait For Playout"},"record_end_reason":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Record End Reason"},"default_inter_digit_ms":{"anyOf":[{"type":"integer","maximum":2000.0,"minimum":0.0},{"type":"null"}],"title":"Default Inter Digit Ms"},"inter_digit_ms":{"anyOf":[{"type":"integer","maximum":2000.0,"minimum":0.0},{"type":"null"}],"title":"Inter Digit Ms"},"default_duration_ms":{"anyOf":[{"type":"integer","maximum":2000.0,"minimum":40.0},{"type":"null"}],"title":"Default Duration Ms"},"default_volume":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Default Volume"},"ivr_detection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ivr Detection"},"allowed_digits":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allowed Digits"},"max_sequence_length":{"anyOf":[{"type":"integer","maximum":128.0,"minimum":1.0},{"type":"null"}],"title":"Max Sequence Length"},"sip_trunk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Trunk Id"},"sip_trunk_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sip Trunk Address"},"sip_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Sip Headers"},"hold_audio_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hold Audio Url"},"hold_audio_loop":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hold Audio Loop"},"transfer_briefing_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Briefing Prompt"},"transfer_briefing_voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Briefing Voice Id"},"transfer_announcement_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Announcement Prompt"},"transfer_announcement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Announcement"},"transfer_timeout_s":{"anyOf":[{"type":"integer","maximum":300.0,"minimum":1.0},{"type":"null"}],"title":"Transfer Timeout S"},"transfer_max_attempts":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Transfer Max Attempts"},"fallback_target_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Target Name"},"take_message_on_failure":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Take Message On Failure"},"target_directory":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Target Directory"},"target_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Number"},"targets":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Targets"},"play_dialtone":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Play Dialtone"},"cold_transfer_announcement_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cold Transfer Announcement Prompt"},"specialists":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Specialists"},"prefer_warm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Prefer Warm"},"handoff_announcement_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Announcement Prompt"},"preserve_chat_ctx":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Preserve Chat Ctx"},"chat_ctx_token_cap":{"anyOf":[{"type":"integer","maximum":64000.0,"minimum":256.0},{"type":"null"}],"title":"Chat Ctx Token Cap"},"auth_mode":{"anyOf":[{"type":"string","enum":["service_account","oauth_user","bearer","basic","api_key_header","mtls","none","hmac_signed"]},{"type":"null"}],"title":"Auth Mode"},"service_account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Account Email"},"oauth_refresh_token_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oauth Refresh Token Ref"},"default_spreadsheet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Spreadsheet Id"},"allowed_spreadsheet_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Spreadsheet Ids"},"max_rows_per_read":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Max Rows Per Read"},"max_rows_per_write":{"anyOf":[{"type":"integer","maximum":5000.0,"minimum":1.0},{"type":"null"}],"title":"Max Rows Per Write"},"result_summarization":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Result Summarization"},"spreadsheet_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spreadsheet Id"},"sheet_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sheet Name"},"credentials_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Credentials Json"},"column_mapping":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Column Mapping"},"data_source_type":{"anyOf":[{"type":"string","enum":["rest_api","graphql","sql_readonly","vector_search"]},{"type":"null"}],"title":"Data Source Type"},"data_source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Source Url"},"auth_secret_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Secret Ref"},"query_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query Template"},"allowed_filters":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Filters"},"default_limit":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":1.0},{"type":"null"}],"title":"Default Limit"},"max_limit":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Max Limit"},"pii_redaction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pii Redaction"},"cache_ttl_s":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Cache Ttl S"},"top_k_default":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Top K Default"},"similarity_threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Similarity Threshold"},"knowledge_namespace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Namespace"},"provider":{"anyOf":[{"type":"string","enum":["twilio","infobip","telnyx","messagebird","aws_sns"]},{"type":"null"}],"title":"Provider"},"account_sid_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Sid Ref"},"auth_token_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Token Ref"},"from_e164":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From E164"},"default_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default From"},"allowed_destination_country_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Destination Country Codes"},"allow_send_to_caller_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Allow Send To Caller Only"},"max_message_length":{"anyOf":[{"type":"integer","maximum":2000.0,"minimum":1.0},{"type":"null"}],"title":"Max Message Length"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template"},"daily_quota_per_number":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Daily Quota Per Number"},"require_explicit_consent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Explicit Consent"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"url_allowlist":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Url Allowlist"},"default_method":{"anyOf":[{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},{"type":"null"}],"title":"Default Method"},"allowed_methods":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Methods"},"default_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Default Headers"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"},"auth":{"anyOf":[{"$ref":"#/components/schemas/HttpWebhookAuthConfig"},{"type":"null"}]},"signing_secret_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signing Secret Ref"},"timeout_s":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":1.0},{"type":"null"}],"title":"Timeout S"},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds"},"max_retries":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Max Retries"},"max_body_bytes":{"anyOf":[{"type":"integer","maximum":10000000.0,"minimum":128.0},{"type":"null"}],"title":"Max Body Bytes"},"redact_response_pii":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Redact Response Pii"},"body_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Template"},"retry_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Retry Policy"},"response_format":{"anyOf":[{"type":"string","enum":["json","text"]},{"type":"null"}],"title":"Response Format"},"simulate_latency_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":0.0},{"type":"null"}],"title":"Simulate Latency Ms"},"simulate_error_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Simulate Error Rate"},"expected_inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Expected Inputs"},"canned_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canned Response"},"response_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Template"},"latency_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":0.0},{"type":"null"}],"title":"Latency Ms"},"handler_kind":{"anyOf":[{"type":"string","enum":["local_python","mcp_server_tool","http_webhook_passthrough"]},{"type":"null"}],"title":"Handler Kind"},"handler_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handler Ref"},"raw_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Raw Schema"},"parameters_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters Schema"},"execution_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Endpoint"},"python_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Python Code"},"rpc_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rpc Method"},"mcp_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcp Url"},"mcp_allowlist":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Mcp Allowlist"},"bearer_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bearer Token"},"extra_headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Extra Headers"},"is_end_call":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is End Call"},"is_transfer":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Transfer"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"auth_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Auth Config"}},"additionalProperties":true,"type":"object","title":"ToolConfig","description":"Aggregate config for a tool instance — full v2 Field Reference superset.\n\nFrontend may submit any subset of these fields. Whatever is non-None is\npersisted into the agent_tool.config JSON blob. The runtime reads only the\nfields relevant to the resolved tool_type.\n\nSection numbers below cite mr-assistant-tools-field-reference v2."},"app__controllers__agent_tools__ToolExecuteRequest":{"properties":{"arguments":{"additionalProperties":true,"type":"object","title":"Arguments","description":"Tool arguments"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Session ID for context"}},"type":"object","required":["arguments"],"title":"ToolExecuteRequest"},"app__controllers__unified_agent_config__AgentConfigResponse":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","title":"Status"},"model_settings":{"additionalProperties":true,"type":"object","title":"Model Settings"},"voice_config":{"additionalProperties":true,"type":"object","title":"Voice Config"},"transcriber_config":{"additionalProperties":true,"type":"object","title":"Transcriber Config"},"conversation_control":{"additionalProperties":true,"type":"object","title":"Conversation Control"},"call_timeout":{"additionalProperties":true,"type":"object","title":"Call Timeout"},"analysis_config":{"additionalProperties":true,"type":"object","title":"Analysis Config"},"voicemail_config":{"additionalProperties":true,"type":"object","title":"Voicemail Config"},"keypad_config":{"additionalProperties":true,"type":"object","title":"Keypad Config"},"workflow":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Workflow"},"tools":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tools"},"language_config":{"additionalProperties":true,"type":"object","title":"Language Config"},"advanced_config":{"additionalProperties":true,"type":"object","title":"Advanced Config"},"external_integration":{"additionalProperties":true,"type":"object","title":"External Integration"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["agent_id","name","description","status","model_settings","voice_config","transcriber_config","conversation_control","call_timeout","analysis_config","voicemail_config","keypad_config","tools","language_config","advanced_config","external_integration","created_at","updated_at"],"title":"AgentConfigResponse","description":"Comprehensive agent configuration response."},"app__controllers__unified_agent_config__AgentConfigUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"$ref":"#/components/schemas/AgentStatus"},{"type":"null"}]},"model_provider":{"anyOf":[{"type":"string","pattern":"^(openai|azure_openai|anthropic|google|groq|cerebras|deepseek|xai|mistral|perplexity|together|fireworks|cohere|amazon_bedrock|alibaba_qwen|ibm_watsonx|meta_llama|anyscale|openrouter|deepinfra|custom_llm)$"},{"type":"null"}],"title":"Model Provider"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"temperature":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"max_tokens":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":50.0},{"type":"null"}],"title":"Max Tokens"},"first_message_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"First Message Mode"},"first_message_script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message Script"},"voice_provider":{"anyOf":[{"type":"string","pattern":"^(elevenlabs|cartesia|azure|livekit_inference)$"},{"type":"null"}],"title":"Voice Provider"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"background_sound_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Background Sound Url"},"input_min_characters":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":10.0},{"type":"null"}],"title":"Input Min Characters"},"transcriber_provider":{"anyOf":[{"type":"string","pattern":"^(deepgram|google|azure|assemblyai|livekit_inference)$"},{"type":"null"}],"title":"Transcriber Provider"},"transcriber_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcriber Model"},"background_denoising":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Background Denoising"},"confidence_threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence Threshold"},"wait_seconds":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.1},{"type":"null"}],"title":"Wait Seconds"},"smart_endpointing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Smart Endpointing"},"interruption_words":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Interruption Words"},"punctuation_boundary_ms":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":50.0},{"type":"null"}],"title":"Punctuation Boundary Ms"},"no_punctuation_boundary_ms":{"anyOf":[{"type":"integer","maximum":3000.0,"minimum":800.0},{"type":"null"}],"title":"No Punctuation Boundary Ms"},"silence_timeout_seconds":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":10.0},{"type":"null"}],"title":"Silence Timeout Seconds"},"max_duration_seconds":{"anyOf":[{"type":"integer","maximum":1800.0,"minimum":180.0},{"type":"null"}],"title":"Max Duration Seconds"},"idle_messages_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Idle Messages Enabled"},"max_idle_messages":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Max Idle Messages"},"idle_timeout_seconds":{"anyOf":[{"type":"number","maximum":60.0,"minimum":5.0},{"type":"null"}],"title":"Idle Timeout Seconds"},"analysis_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Prompt"},"analysis_timeout_sec":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":1.0},{"type":"null"}],"title":"Analysis Timeout Sec"},"min_messages_for_analysis":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Min Messages For Analysis"},"voicemail_detection_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Voicemail Detection Enabled"},"voicemail_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voicemail Message"},"end_call_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Call Message"},"keypad_input_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Keypad Input Enabled"},"keypad_timeout_seconds":{"anyOf":[{"type":"integer","maximum":6.0,"minimum":1.0},{"type":"null"}],"title":"Keypad Timeout Seconds"},"keypad_delimiters":{"anyOf":[{"type":"string","pattern":"^[#*]+$"},{"type":"null"}],"title":"Keypad Delimiters"},"workflow_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workflow Id"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"default_user_lang":{"anyOf":[{"type":"string","maxLength":10,"minLength":2},{"type":"null"}],"title":"Default User Lang"},"thinking_lang":{"anyOf":[{"type":"string","maxLength":10,"minLength":2},{"type":"null"}],"title":"Thinking Lang"},"interruptions_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interruptions Enabled"},"escalation_policy":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation Policy"}},"type":"object","title":"AgentConfigUpdate","description":"Comprehensive agent configuration update model."},"app__controllers__workflows__ToolConfig":{"properties":{"type":{"type":"string","title":"Type"},"tool_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Key"},"function":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Function"},"messages":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Messages"},"destinations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Destinations"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["type"],"title":"ToolConfig","description":"Tool configuration for tool nodes."},"app__models__schemas__ToolExecuteRequest":{"properties":{"session_id":{"type":"string","format":"uuid","title":"Session Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"tool_key":{"type":"string","title":"Tool Key"},"idempotency_key":{"type":"string","title":"Idempotency Key"},"args":{"additionalProperties":true,"type":"object","title":"Args"},"connection_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connection Ref"}},"type":"object","required":["session_id","agent_id","tool_key","idempotency_key","args"],"title":"ToolExecuteRequest","description":"Tool execute request model."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}