{"openapi":"3.1.0","info":{"title":"Zetta Dialer API","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/live":{"get":{"summary":"Health Live","description":"Liveness probe — returns 200 if the process is running.","operationId":"health_live_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"summary":"Health Ready","description":"Readiness probe — checks all critical dependencies.","operationId":"health_ready_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/fs/directory":{"post":{"tags":["freeswitch"],"summary":"Fs Directory","description":"mod_xml_curl directory binding — returns dynamic verto user XML.\n\nThe response contains an HMAC-derived password for the requested\nverto user, so this endpoint MUST refuse requests from anywhere\nother than the WireGuard subnet that hosts FreeSWITCH.","operationId":"fs_directory_fs_directory_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_fs_directory_fs_directory_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/login":{"post":{"tags":["agent"],"summary":"Login","operationId":"login_api_agent_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/agent/logout":{"post":{"tags":["agent"],"summary":"Logout","operationId":"logout_api_agent_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/agent/status":{"post":{"tags":["agent"],"summary":"Update Status Endpoint","operationId":"update_status_endpoint_api_agent_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStatusUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/agent/next-lead/{campaign_id}":{"get":{"tags":["agent"],"summary":"Get Next Lead","operationId":"get_next_lead_api_agent_next_lead__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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/agent/dial":{"post":{"tags":["agent"],"summary":"Dial Lead","operationId":"dial_lead_api_agent_dial_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DialRequest"}}},"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":[]}]}},"/api/agent/dispose":{"post":{"tags":["agent"],"summary":"Dispose Call","operationId":"dispose_call_api_agent_dispose_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisposeRequestBody"}}},"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":[]}]}},"/api/campaigns":{"get":{"tags":["campaigns"],"summary":"List Campaigns","operationId":"list_campaigns_api_campaigns_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CampaignResponse"},"type":"array","title":"Response List Campaigns Api Campaigns Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["campaigns"],"summary":"Create Campaign","operationId":"create_campaign_api_campaigns_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/campaigns/{campaign_id}":{"get":{"tags":["campaigns"],"summary":"Get Campaign","operationId":"get_campaign_api_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/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["campaigns"],"summary":"Update Campaign","operationId":"update_campaign_api_campaigns__campaign_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdate"}}}},"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"}}}}}},"delete":{"tags":["campaigns"],"summary":"Delete Campaign","operationId":"delete_campaign_api_campaigns__campaign_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/{campaign_id}/start":{"post":{"tags":["campaigns"],"summary":"Start Campaign","operationId":"start_campaign_api_campaigns__campaign_id__start_post","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/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/{campaign_id}/pause":{"post":{"tags":["campaigns"],"summary":"Pause Campaign","operationId":"pause_campaign_api_campaigns__campaign_id__pause_post","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/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/{campaign_id}/stop":{"post":{"tags":["campaigns"],"summary":"Stop Campaign","operationId":"stop_campaign_api_campaigns__campaign_id__stop_post","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/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/{campaign_id}/predictive/pause":{"post":{"tags":["campaigns"],"summary":"Pause Predictive Campaign","operationId":"pause_predictive_campaign_api_campaigns__campaign_id__predictive_pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PausePredictiveRequest"}}}},"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"}}}}}}},"/api/campaigns/{campaign_id}/predictive/resume":{"post":{"tags":["campaigns"],"summary":"Resume Predictive Campaign","operationId":"resume_predictive_campaign_api_campaigns__campaign_id__predictive_resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumePredictiveRequest"}}}},"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"}}}}}}},"/api/campaigns/{campaign_id}/leads/upload":{"post":{"tags":["campaigns"],"summary":"Upload Leads","operationId":"upload_leads_api_campaigns__campaign_id__leads_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_leads_api_campaigns__campaign_id__leads_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/{campaign_id}/scrub":{"post":{"tags":["campaigns"],"summary":"Scrub Campaign","operationId":"scrub_campaign_api_campaigns__campaign_id__scrub_post","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":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/{campaign_id}/stats":{"get":{"tags":["campaigns"],"summary":"Get Campaign Stats","operationId":"get_campaign_stats_api_campaigns__campaign_id__stats_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/CampaignStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/supervisor/floor":{"get":{"tags":["supervisor"],"summary":"Get Floor View","description":"Real-time floor view: all agents with status, call info, and KPIs.","operationId":"get_floor_view_api_supervisor_floor_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorViewResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/supervisor/transfer":{"post":{"tags":["supervisor"],"summary":"Force Transfer","description":"Force-transfer a call to another extension.","operationId":"force_transfer_api_supervisor_transfer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/supervisor/sessions":{"post":{"tags":["supervisor-sessions"],"summary":"Start Session","operationId":"start_session_api_supervisor_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/supervisor/sessions/active":{"get":{"tags":["supervisor-sessions"],"summary":"Get My Active Session","operationId":"get_my_active_session_api_supervisor_sessions_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SupervisorSessionResponse"},{"type":"null"}],"title":"Response Get My Active Session Api Supervisor Sessions Active Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/supervisor/sessions/{session_id}/mode":{"patch":{"tags":["supervisor-sessions"],"summary":"Change Mode","operationId":"change_mode_api_supervisor_sessions__session_id__mode_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeModeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupervisorSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/supervisor/sessions/{session_id}":{"delete":{"tags":["supervisor-sessions"],"summary":"Stop Session","operationId":"stop_session_api_supervisor_sessions__session_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/supervisor/audit":{"get":{"tags":["supervisor-sessions"],"summary":"List Audit","operationId":"list_audit_api_supervisor_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}},{"name":"supervisor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supervisor Id"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"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/AuditListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calls":{"get":{"tags":["calls"],"summary":"List Calls","description":"Paginated call history with optional filters.","operationId":"list_calls_api_calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Page Size"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"disposition","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calls/{call_id}":{"get":{"tags":["calls"],"summary":"Get Call Detail","description":"Get full call detail with recording URL and AI fields.","operationId":"get_call_detail_api_calls__call_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__calls__models__CallDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calls/{call_id}/recording":{"get":{"tags":["calls"],"summary":"Get Recording Url","description":"Get a fresh signed URL for a call recording.","operationId":"get_recording_url_api_calls__call_id__recording_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calls/{call_id}/notes":{"post":{"tags":["calls"],"summary":"Add Notes","description":"Add or update notes on a call.","operationId":"add_notes_api_calls__call_id__notes_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallNoteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/calls/{call_id}/ai-results":{"patch":{"tags":["calls"],"summary":"Update Ai Results","description":"Endpoint for Zetta platform to post AI analysis results.\n\nCalled after async AI processing (transcription, summarization, sentiment)\ncompletes for a call recording. Updates the call record with AI fields.","operationId":"update_ai_results_api_calls__call_id__ai_results_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIResultsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dispositions":{"get":{"tags":["dispositions"],"summary":"List Dispositions","description":"List all dispositions for the user's tenant.","operationId":"list_dispositions_api_dispositions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DispositionResponse"},"type":"array","title":"Response List Dispositions Api Dispositions Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["dispositions"],"summary":"Create Disposition","description":"Create a new disposition for the user's tenant.","operationId":"create_disposition_api_dispositions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispositionCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispositionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dispositions/{disposition_id}":{"patch":{"tags":["dispositions"],"summary":"Update Disposition","description":"Update a disposition. Only non-None fields are updated.","operationId":"update_disposition_api_dispositions__disposition_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"disposition_id","in":"path","required":true,"schema":{"type":"string","title":"Disposition Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispositionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispositionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["dispositions"],"summary":"Delete Disposition","description":"Delete a disposition.","operationId":"delete_disposition_api_dispositions__disposition_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"disposition_id","in":"path","required":true,"schema":{"type":"string","title":"Disposition Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows":{"get":{"tags":["flows"],"summary":"List Flows","operationId":"list_flows_api_flows_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FlowResponse"},"type":"array","title":"Response List Flows Api Flows Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["flows"],"summary":"Create Flow","operationId":"create_flow_api_flows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/flows/{flow_id}":{"get":{"tags":["flows"],"summary":"Get Flow","operationId":"get_flow_api_flows__flow_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["flows"],"summary":"Update Flow","operationId":"update_flow_api_flows__flow_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["flows"],"summary":"Delete Flow","operationId":"delete_flow_api_flows__flow_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}/publish":{"post":{"tags":["flows"],"summary":"Publish Flow","operationId":"publish_flow_api_flows__flow_id__publish_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flows/{flow_id}/test":{"post":{"tags":["flows"],"summary":"Test Flow","description":"Originate a test call and run this flow against it.\n\nOriginates a call to the given phone number via ESL, then runs\nthe FlowExecutor in a background task. Useful for flow testing\nwithout needing an inbound call.","operationId":"test_flow_api_flows__flow_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dids":{"get":{"tags":["dids"],"summary":"List Dids","operationId":"list_dids_api_dids_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DIDResponse"},"type":"array","title":"Response List Dids Api Dids Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["dids"],"summary":"Create Did","operationId":"create_did_api_dids_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DIDCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DIDResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dids/{did_id}":{"get":{"tags":["dids"],"summary":"Get Did","operationId":"get_did_api_dids__did_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DIDResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["dids"],"summary":"Update Did","operationId":"update_did_api_dids__did_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DIDUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DIDResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["dids"],"summary":"Delete Did","operationId":"delete_did_api_dids__did_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/audio/upload":{"post":{"tags":["audio"],"summary":"Upload Audio","operationId":"upload_audio_api_audio_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_audio_api_audio_upload_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/audio/{filename}":{"get":{"tags":["audio"],"summary":"Get Audio","operationId":"get_audio_api_audio__filename__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/agent-performance":{"get":{"tags":["reports"],"summary":"Agent Performance Report","description":"Agent performance metrics (calls, connect rate, avg talk time) for the tenant.","operationId":"agent_performance_report_api_reports_agent_performance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/tenant":{"get":{"tags":["tenant"],"summary":"Get Tenant","operationId":"get_tenant_api_tenant_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["tenant"],"summary":"Update Tenant","operationId":"update_tenant_api_tenant_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/users":{"get":{"tags":["users"],"summary":"List Users","operationId":"list_users_api_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/UserRoleResponse"},"type":"array","title":"Response List Users Api Users Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["users"],"summary":"Add User","operationId":"add_user_api_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteUserRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/users/{user_id}":{"patch":{"tags":["users"],"summary":"Update User Role","operationId":"update_user_role_api_users__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Remove User","operationId":"remove_user_api_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/me/profile":{"get":{"tags":["users"],"summary":"Get My Profile","operationId":"get_my_profile_api_users_me_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["users"],"summary":"Update My Profile","operationId":"update_my_profile_api_users_me_profile_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/api-keys":{"get":{"tags":["api-keys"],"summary":"List Api Keys","operationId":"list_api_keys_api_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/APIKeyResponse"},"type":"array","title":"Response List Api Keys Api Api Keys Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["api-keys"],"summary":"Create Api Key","operationId":"create_api_key_api_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/api-keys/{key_id}":{"patch":{"tags":["api-keys"],"summary":"Update Api Key","description":"Update mutable fields on an API key (currently just allowed_origins).","operationId":"update_api_key_api_api_keys__key_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api-keys"],"summary":"Revoke Api Key","operationId":"revoke_api_key_api_api_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/click-to-call":{"post":{"tags":["click-to-call"],"summary":"Click To Call","description":"Trigger an outbound call from an agent to a phone number.","operationId":"click_to_call_api_click_to_call_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClickToCallRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClickToCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/chat/history":{"get":{"tags":["chat"],"summary":"History","operationId":"history_api_chat_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"peer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Other user id, or omit for tenant broadcast","title":"Peer Id"},"description":"Other user id, or omit for tenant broadcast"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/send":{"post":{"tags":["chat"],"summary":"Send","operationId":"send_api_chat_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/chat/mark_read":{"post":{"tags":["chat"],"summary":"Mark Read","operationId":"mark_read_api_chat_mark_read_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMarkReadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mark Read Api Chat Mark Read Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dnc/internal":{"get":{"tags":["dnc"],"summary":"List Internal Endpoint","operationId":"list_internal_endpoint_api_dnc_internal_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Search"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"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/InternalDncListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["dnc"],"summary":"Add Internal Endpoint","operationId":"add_internal_endpoint_api_dnc_internal_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddInternalDncRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalDncEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dnc/internal/{entry_id}":{"delete":{"tags":["dnc"],"summary":"Remove Internal Endpoint","operationId":"remove_internal_endpoint_api_dnc_internal__entry_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dnc/internal/import":{"post":{"tags":["dnc"],"summary":"Import Internal Endpoint","operationId":"import_internal_endpoint_api_dnc_internal_import_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_internal_endpoint_api_dnc_internal_import_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dnc/trai/import":{"post":{"tags":["dnc"],"summary":"Import Trai Endpoint","operationId":"import_trai_endpoint_api_dnc_trai_import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"replace","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Replace"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_trai_endpoint_api_dnc_trai_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraiImportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dnc/events":{"get":{"tags":["dnc"],"summary":"List Events Endpoint","operationId":"list_events_endpoint_api_dnc_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"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/DncEventListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dnc/stats":{"get":{"tags":["dnc"],"summary":"Stats Endpoint","operationId":"stats_endpoint_api_dnc_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DncStats"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/reputation/pool":{"get":{"tags":["reputation"],"summary":"List Pool Endpoint","operationId":"list_pool_endpoint_api_reputation_pool_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DidPoolListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["reputation"],"summary":"Add To Pool Endpoint","operationId":"add_to_pool_endpoint_api_reputation_pool_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDidRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DidPoolEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/pool/stats":{"get":{"tags":["reputation"],"summary":"Pool Stats Endpoint","operationId":"pool_stats_endpoint_api_reputation_pool_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DidPoolStats"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/reputation/pool/{did_id}":{"get":{"tags":["reputation"],"summary":"Get Did Endpoint","operationId":"get_did_endpoint_api_reputation_pool__did_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DidPoolDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reputation"],"summary":"Delete Pool Did Endpoint","description":"Permanently remove a retired DID from the pool.\n\nReturns 404 if the DID isn't in this tenant's pool.\nReturns 409 if the DID isn't in status='retired' — operators must\nretire it first via PATCH /status so the audit trail shows why.","operationId":"delete_pool_did_endpoint_api_reputation_pool__did_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/pool/{did_id}/status":{"patch":{"tags":["reputation"],"summary":"Update Status Endpoint","operationId":"update_status_endpoint_api_reputation_pool__did_id__status_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DidPoolEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/pool/{did_id}/rotate":{"post":{"tags":["reputation"],"summary":"Force Rotate Endpoint","operationId":"force_rotate_endpoint_api_reputation_pool__did_id__rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceRotateRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/pool/{did_id}/snapshots":{"get":{"tags":["reputation"],"summary":"Get Snapshots Endpoint","operationId":"get_snapshots_endpoint_api_reputation_pool__did_id__snapshots_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"path","required":true,"schema":{"type":"string","title":"Did Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthSnapshotListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/canary/devices":{"get":{"tags":["reputation"],"summary":"List Canary Devices Endpoint","operationId":"list_canary_devices_endpoint_api_reputation_canary_devices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanaryDeviceListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["reputation"],"summary":"Register Canary Device Endpoint","operationId":"register_canary_device_endpoint_api_reputation_canary_devices_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterCanaryDeviceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterCanaryDeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/reputation/canary/devices/{device_id}":{"delete":{"tags":["reputation"],"summary":"Delete Canary Device Endpoint","operationId":"delete_canary_device_endpoint_api_reputation_canary_devices__device_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/canary/ingest":{"post":{"tags":["reputation"],"summary":"Canary Ingest Endpoint","operationId":"canary_ingest_endpoint_api_reputation_canary_ingest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanaryIngestRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanaryIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reputation/canary/heartbeat":{"post":{"tags":["reputation"],"summary":"Canary Heartbeat Endpoint","operationId":"canary_heartbeat_endpoint_api_reputation_canary_heartbeat_post","responses":{"204":{"description":"Successful Response"}}}},"/api/reputation/rotation-events":{"get":{"tags":["reputation"],"summary":"List Rotation Events Endpoint","operationId":"list_rotation_events_endpoint_api_reputation_rotation_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"did_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Did Id"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"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/RotationEventListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks":{"post":{"tags":["webhooks"],"summary":"Create Subscription","description":"Create a webhook subscription. The response carries the\n`signing_secret` — shown ONCE. Clients must store it at their\nend for signature verification; our side keeps only the HMAC\nit signs with, never exposed on subsequent reads.","operationId":"create_subscription_api_webhooks_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["webhooks"],"summary":"List Subscriptions","operationId":"list_subscriptions_api_webhooks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_disabled","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Disabled"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionResponse"},"title":"Response List Subscriptions Api Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{subscription_id}":{"delete":{"tags":["webhooks"],"summary":"Delete Subscription","operationId":"delete_subscription_api_webhooks__subscription_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{subscription_id}/rotate":{"post":{"tags":["webhooks"],"summary":"Rotate Subscription Secret","description":"Rotate the subscription's signing_secret. The old secret stays\nvalid for a 24 h grace window (enforced by the\n`secret_rotation_sweep` Celery task) so customers can cut over\nwithout dropped deliveries. Response carries the NEW secret ONCE\n— same show-once pattern as subscribe.","operationId":"rotate_subscription_secret_api_webhooks__subscription_id__rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{subscription_id}/test":{"post":{"tags":["webhooks"],"summary":"Test Subscription","description":"Synchronous dry-run delivery. The operator sees the outcome in\ntheir dev-console without polluting the production delivery log —\nthe test-fire path deliberately bypasses `webhook_deliveries`.","operationId":"test_subscription_api_webhooks__subscription_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/webhooks/{subscription_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Subscription Deliveries","description":"The delivery log viewer's data source. Tenant-fenced at the\nquery layer so tenant B can't read tenant A's log via a spoofed\nsubscription_id.","operationId":"list_subscription_deliveries_api_webhooks__subscription_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryRow"},"title":"Response List Subscription Deliveries Api Webhooks  Subscription Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns":{"get":{"tags":["v1 campaigns"],"summary":"List Campaigns","operationId":"list_campaigns_api_v1_campaigns_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CampaignResponse"},"type":"array","title":"Response List Campaigns Api V1 Campaigns Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["v1 campaigns"],"summary":"Create Campaign","description":"POST a new campaign. `tenant_id` is bound from the API key,\nnot the body — a customer key can never create a campaign in\nanother tenant.","operationId":"create_campaign_api_v1_campaigns_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/campaigns/{campaign_id}":{"get":{"tags":["v1 campaigns"],"summary":"Get Campaign","operationId":"get_campaign_api_v1_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/CampaignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["v1 campaigns"],"summary":"Update Campaign","operationId":"update_campaign_api_v1_campaigns__campaign_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdate"}}}},"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"}}}}}},"delete":{"tags":["v1 campaigns"],"summary":"Delete Campaign","operationId":"delete_campaign_api_v1_campaigns__campaign_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/leads":{"post":{"tags":["v1 leads"],"summary":"Create Lead","description":"Add one lead. Tenant-fenced: returns 404 if the campaign\nisn't in this key's tenant.","operationId":"create_lead_api_v1_campaigns__campaign_id__leads_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadInput"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/leads:bulk":{"post":{"tags":["v1 leads"],"summary":"Bulk Create Leads","description":"Bulk-ingest up to 500 leads. Per-lead validation same as the\nsingle endpoint; invalid leads are counted + reported but don't\nfail the whole request. Idempotency on phone uniqueness within\nthe campaign is the responsibility of the service's existing\nadd_lead (duplicates are returned as dup count, not errors).","operationId":"bulk_create_leads_api_v1_campaigns__campaign_id__leads_bulk_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLeadsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLeadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}":{"get":{"tags":["v1 calls"],"summary":"Get Call V1","description":"Single call detail. Tenant-fenced: returns 404 if the call\nbelongs to another tenant, never 403 — we don't leak existence\nacross tenants.","operationId":"get_call_v1_api_v1_calls__call_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__platform__v1__calls__CallDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/calls":{"get":{"tags":["v1 calls"],"summary":"List Campaign Calls V1","description":"Paginated list of calls for a specific campaign. Tenant fence\nis applied at the query layer — `list_calls_paginated` filters\non both `tenant_id` and `campaign_id` so a forged campaign_id\nfrom another tenant returns zero rows, not cross-tenant data.","operationId":"list_campaign_calls_v1_api_v1_campaigns__campaign_id__calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","title":"Campaign Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":25,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"disposition","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/recording":{"get":{"tags":["v1 calls"],"summary":"Get Call Recording V1","description":"Returns a short-lived signed URL for the call's recording.\n\nTwo failure modes intentionally distinguished:\n - 404: call doesn't exist (or wrong tenant)\n - 409: call exists but has no recording yet (e.g. answered but\n   still in progress; or recording pipeline hasn't processed it).\n   Customers can retry later after seeing `call.recording_ready`\n   webhook.\n\nThe signed URL expires in 7 days. We don't cache it — every call\nre-signs. That keeps the TTL in the URL a single source of truth\nand avoids a stale-cache class of bugs.","operationId":"get_call_recording_v1_api_v1_calls__call_id__recording_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingSignedUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents":{"get":{"tags":["v1 agents"],"summary":"List Agents V1","description":"List every agent in the caller's tenant. Simple SELECT —\nno pagination yet because tenant agent count tops out at 60\nfor our anchor client and 200 for an enterprise deployment;\npagination is v1.1 if we start seeing 1k+ seats.","operationId":"list_agents_v1_api_v1_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentResponse"},"type":"array","title":"Response List Agents V1 Api V1 Agents Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/agents/{agent_id}":{"get":{"tags":["v1 agents"],"summary":"Get Agent V1","operationId":"get_agent_v1_api_v1_agents__agent_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/stats":{"get":{"tags":["v1 agents"],"summary":"Get Agent Stats V1","description":"24-hour-rolling call stats for an agent. Computed on-demand\nfrom the `calls` table — small enough that a query-per-request\nis fine at current scale. If a v1.1 customer hits it hundreds of\ntimes a minute we'll rollup to `agent_stats_hourly` similar to\nthe api_key usage rollup pattern.","operationId":"get_agent_stats_v1_api_v1_agents__agent_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Window Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/authorize":{"get":{"tags":["oauth"],"summary":"Authorize","description":"Present the consent payload. The UI at `/oauth/authorize` on\ndialer-ui renders this, collects approve/deny, and POSTs back\nto `/oauth/authorize/approve`.\n\nWe validate BEFORE rendering so a bogus client_id or\nredirect_uri surfaces as an error the user can understand,\nnot mid-flow after they've already clicked approve.","operationId":"authorize_oauth_authorize_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string","title":"Response Type"}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","title":"Redirect Uri"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","title":"Code Challenge"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","default":"S256","title":"Code Challenge Method"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"","title":"Scope"}},{"name":"nonce","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nonce"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentPayload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/authorize/approve":{"post":{"tags":["oauth"],"summary":"Authorize Approve","description":"User has (dis)approved the consent screen. If approved, issue\na code and redirect to `redirect_uri?code=...&state=...`. If\ndenied, redirect with `error=access_denied&state=...` per RFC\n6749 §4.1.2.1.","operationId":"authorize_approve_oauth_authorize_approve_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authorize_approve_oauth_authorize_approve_post"}}},"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":[]}]}},"/oauth/token":{"post":{"tags":["oauth"],"summary":"Token","description":"RFC 6749 §3.2 token endpoint. Dispatches by grant_type.\n\nClient authentication: either HTTP Basic (the RFC's preferred\nform; Salesforce uses it) or form-encoded client_id +\nclient_secret. We accept either.","operationId":"token_oauth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_token_oauth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/introspect":{"post":{"tags":["oauth"],"summary":"Introspect","description":"RFC 7662. Resource servers call this to validate a token\nserver-side. Salesforce's Apex uses it to check access tokens\nbefore relying on them.","operationId":"introspect_oauth_introspect_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_introspect_oauth_introspect_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntrospectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/revoke":{"post":{"tags":["oauth"],"summary":"Revoke","description":"RFC 7009. Always returns 200 even for unknown tokens — the RFC\nrequires this to prevent token-existence enumeration via the\nendpoint.","operationId":"revoke_oauth_revoke_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_revoke_oauth_revoke_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/userinfo":{"get":{"tags":["oauth"],"summary":"Userinfo","description":"OIDC §5.3. Bearer-authed endpoint returning the user's\nprofile claims. Scopes control which claims appear:\n  openid → sub (always)\n  profile → name\n  email → email","operationId":"userinfo_oauth_userinfo_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/openid-configuration":{"get":{"tags":["oauth discovery"],"summary":"Openid Configuration","description":"OIDC Discovery 1.0 §3. Shape is prescribed by the spec;\nSalesforce's Auth Provider setup pastes the URL and auto-\npopulates everything from here.","operationId":"openid_configuration__well_known_openid_configuration_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenIDConfiguration"}}}}}}},"/.well-known/jwks.json":{"get":{"tags":["oauth discovery"],"summary":"Jwks","description":"JWKS with all non-retired keys. Browsers cache these\naggressively; we don't set cache-control so middleboxes'\ndefaults apply. Mintlify + Salesforce both re-fetch on each\nverify which is fine at our volume.","operationId":"jwks__well_known_jwks_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/oauth/clients":{"get":{"tags":["oauth admin"],"summary":"List Clients","operationId":"list_clients_api_oauth_clients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ClientListItem"},"type":"array","title":"Response List Clients Api Oauth Clients Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["oauth admin"],"summary":"Create Client","description":"Register a new OAuth partner. Returns the client_secret ONCE\n— same show-once pattern as API keys + webhook signing_secrets\nshipped in E.","operationId":"create_client_api_oauth_clients_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/oauth/authorizations":{"get":{"tags":["oauth admin"],"summary":"List My Authorizations","description":"List the current user's OAuth grants. Grouped by (client_id,\nuser_id) so multiple active refresh tokens for the same partner\nshow as one row (the latest grant).","operationId":"list_my_authorizations_api_oauth_authorizations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/oauth/authorizations/{client_id}":{"delete":{"tags":["oauth admin"],"summary":"Revoke My Authorization","description":"Revoke every refresh token this user has for this client.\nThe user MUST be the owner (user_id match) — a user can't revoke\nanother user's grants even in the same tenant.","operationId":"revoke_my_authorization_api_oauth_authorizations__client_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"client_id","in":"path","required":true,"schema":{"type":"string","title":"Client Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/settings":{"get":{"tags":["billing"],"summary":"Get Settings","operationId":"get_settings_api_billing_settings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["billing"],"summary":"Update Settings","operationId":"update_settings_api_billing_settings_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/usage":{"get":{"tags":["billing"],"summary":"Get Usage","operationId":"get_usage_api_billing_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM, convenience param","title":"Period"},"description":"YYYY-MM, convenience param"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive period start","title":"Start"},"description":"Inclusive period start"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive period end","title":"End"},"description":"Inclusive period end"},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SUPER_ADMIN only","title":"Tenant Id"},"description":"SUPER_ADMIN only"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsagePeriod"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/usage.csv":{"get":{"tags":["billing"],"summary":"Export Usage Csv","operationId":"export_usage_csv_api_billing_usage_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End"}},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/rollup":{"post":{"tags":["billing"],"summary":"Trigger Rollup","description":"On-demand rollup. Useful when an invoice needs fresh numbers\nwithout waiting for the daily beat. Also the hook the reconciliation\ntool uses after CDR corrections.","operationId":"trigger_rollup_api_billing_rollup_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"target_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"UTC date to rollup","title":"Target Date"},"description":"UTC date to rollup"},{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trigger Rollup Api Billing Rollup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys":{"get":{"tags":["api-keys-v1"],"summary":"List Keys","operationId":"list_keys_api_v1_keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_revoked","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Revoked"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyListItem"},"title":"Response List Keys Api V1 Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api-keys-v1"],"summary":"Issue Key","operationId":"issue_key_api_v1_keys_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIssuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys/{key_id}/rotate":{"post":{"tags":["api-keys-v1"],"summary":"Rotate Key","description":"Issue a new key and revoke the old one atomically.\n\nThe request body mirrors issue — caller chooses whether to copy\nthe previous label / scopes or change them. Making that explicit\nis cleaner than auto-copying: if the tenant is rotating because\na scope leaked, they should be reconsidering the scope list\nanyway.","operationId":"rotate_key_api_v1_keys__key_id__rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyIssuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys/{key_id}":{"delete":{"tags":["api-keys-v1"],"summary":"Revoke Key","operationId":"revoke_key_api_v1_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApiKeyRevokeRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/test-tenants":{"get":{"tags":["admin","test-tenants"],"summary":"List Test Tenants","operationId":"list_test_tenants_admin_test_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Test Tenants Admin Test Tenants Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin","test-tenants"],"summary":"Create Test Tenant","operationId":"create_test_tenant_admin_test_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/test-tenants/{tenant_id}/api-keys":{"post":{"tags":["admin","test-tenants"],"summary":"Issue Secondary Api Key","description":"Mint an additional api_key for the test tenant with a specified role.\n\nEnables cross-role negative tests from shell / pytest: provision a\ntest tenant, then issue an AGENT-role key here and verify that\ntenant-admin routes return 403.","operationId":"issue_secondary_api_key_admin_test_tenants__tenant_id__api_keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/test-tenants/{tenant_id}/reset":{"post":{"tags":["admin","test-tenants"],"summary":"Reset Test Tenant","operationId":"reset_test_tenant_admin_test_tenants__tenant_id__reset_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset Test Tenant Admin Test Tenants  Tenant Id  Reset Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/test-tenants/{tenant_id}/seed":{"post":{"tags":["admin","test-tenants"],"summary":"Seed Test Tenant","description":"Seed a test tenant with N agent seats (+ matching user_roles rows),\nM supervisor user_roles, P campaigns, and Q leads per campaign.\n\nEmpty body (`{}`) reproduces the legacy default shape: 2 agents,\n1 supervisor, 1 progressive campaign, 5 leads.\n\nReturns the created `user_id`s + `agent_seat_id`s + extensions so the\nE2E harness can impersonate them via /admin/test-tenants/impersonate.\n\nIdempotent: if a `seed-campaign` already exists for this tenant, the\nexisting cached payload is returned verbatim — the request body is\nIGNORED on a re-entry. Callers that want a larger/different seed\nmust /reset first. Activity timestamp is still bumped so the reaper\ndoesn't evict an actively-used tenant.","operationId":"seed_test_tenant_admin_test_tenants__tenant_id__seed_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SeedRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Seed Test Tenant Admin Test Tenants  Tenant Id  Seed Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/test-tenants/{tenant_id}/inbound-call":{"post":{"tags":["admin","test-tenants"],"summary":"Originate Inbound Call","description":"Originate a synthetic inbound call into the tenant's test DID via\nFreeSWITCH ESL. Uses a loopback leg so no actual PSTN trunk is crossed.\n\nThe DID must belong to this tenant — cross-tenant generation is\nblocked to keep the debug surface from being a call-generation\ncannon aimed at other customers' DIDs.","operationId":"originate_inbound_call_admin_test_tenants__tenant_id__inbound_call_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Originate Inbound Call Admin Test Tenants  Tenant Id  Inbound Call Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/test-tenants/{tenant_id}":{"delete":{"tags":["admin","test-tenants"],"summary":"Delete Test Tenant","operationId":"delete_test_tenant_admin_test_tenants__tenant_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/test-tenants/{tenant_id}/stats":{"get":{"tags":["admin","test-tenants"],"summary":"Stats For Test Tenant","operationId":"stats_for_test_tenant_admin_test_tenants__tenant_id__stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Stats For Test Tenant Admin Test Tenants  Tenant Id  Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ai-sessions/{call_id}/control":{"post":{"tags":["ai-sessions"],"summary":"Control","operationId":"control_api_v1_ai_sessions__call_id__control_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlEvent"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AIResultsRequest":{"properties":{"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"},"ai_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Sentiment"},"ai_next_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Next Action"}},"type":"object","title":"AIResultsRequest","description":"Request from Zetta platform to post AI analysis results."},"AIResultsResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"},"ai_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Sentiment"},"ai_next_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Next Action"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["call_id","updated_at"],"title":"AIResultsResponse","description":"Response after saving AI results."},"APIKeyCreateRequest":{"properties":{"label":{"type":"string","title":"Label"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":[]},"allowed_origins":{"items":{"type":"string"},"type":"array","title":"Allowed Origins","default":[]}},"type":"object","required":["label"],"title":"APIKeyCreateRequest"},"APIKeyCreateResponse":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"tenant_id":{"type":"string","title":"Tenant Id"}},"type":"object","required":["id","key","label","tenant_id"],"title":"APIKeyCreateResponse"},"APIKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"role":{"type":"string","title":"Role","default":"API_USER"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":[]},"is_active":{"type":"boolean","title":"Is Active","default":true},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Last Used At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Created At"},"key_prefix":{"type":"string","title":"Key Prefix","default":""},"allowed_origins":{"items":{"type":"string"},"type":"array","title":"Allowed Origins","default":[]}},"type":"object","required":["id","tenant_id"],"title":"APIKeyResponse"},"APIKeyUpdateRequest":{"properties":{"allowed_origins":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Origins"}},"type":"object","title":"APIKeyUpdateRequest"},"AddDidRequest":{"properties":{"number":{"type":"string","maxLength":20,"minLength":10,"title":"Number"},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label"},"carrier":{"type":"string","enum":["airtel","jio","vi","bsnl","trunk","unknown"],"title":"Carrier","default":"unknown"},"role":{"type":"string","enum":["outbound","both"],"title":"Role","default":"outbound"}},"type":"object","required":["number"],"title":"AddDidRequest"},"AddInternalDncRequest":{"properties":{"phone":{"type":"string","maxLength":15,"minLength":10,"title":"Phone"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","required":["phone"],"title":"AddInternalDncRequest"},"AgentFloorItem":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"user_id":{"type":"string","title":"User Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"extension":{"type":"string","title":"Extension"},"status":{"$ref":"#/components/schemas/AgentStatus"},"current_call_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Call Uuid"},"current_lead_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Lead Name"},"current_lead_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Lead Phone"},"campaign_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Name"},"call_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Call Started At"},"call_duration_s":{"type":"integer","title":"Call Duration S","default":0}},"type":"object","required":["agent_id","user_id","extension","status"],"title":"AgentFloorItem","description":"Single agent on the floor view grid."},"AgentLoginRequest":{"properties":{"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","title":"AgentLoginRequest"},"AgentLoginResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"extension":{"type":"string","title":"Extension"},"verto_host":{"type":"string","title":"Verto Host"},"verto_port":{"type":"integer","title":"Verto Port"},"verto_ws_url":{"type":"string","title":"Verto Ws Url"},"verto_password":{"type":"string","title":"Verto Password"},"verto_domain":{"type":"string","title":"Verto Domain"},"status":{"$ref":"#/components/schemas/AgentStatus"}},"type":"object","required":["agent_id","extension","verto_host","verto_port","verto_ws_url","verto_password","verto_domain","status"],"title":"AgentLoginResponse"},"AgentResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"extension":{"type":"string","title":"Extension"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"status":{"type":"string","title":"Status"},"current_call_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Call Uuid"},"last_status_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Status At"}},"type":"object","required":["id","user_id","extension","status"],"title":"AgentResponse","description":"Public agent shape. `user_id` is exposed (tenants' own user\nmapping), `tenant_id` is elided since the API key already pins\ntenant."},"AgentStatsResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"window_hours":{"type":"integer","title":"Window Hours","default":24},"calls_total":{"type":"integer","title":"Calls Total","default":0},"calls_connected":{"type":"integer","title":"Calls Connected","default":0},"calls_failed":{"type":"integer","title":"Calls Failed","default":0},"avg_talk_time_s":{"type":"number","title":"Avg Talk Time S","default":0.0},"connect_rate":{"type":"number","title":"Connect Rate","default":0.0}},"type":"object","required":["agent_id"],"title":"AgentStatsResponse"},"AgentStatus":{"type":"string","enum":["offline","available","ringing","on_call","wrap_up","break"],"title":"AgentStatus"},"AgentStatusResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"status":{"$ref":"#/components/schemas/AgentStatus"},"previous_status":{"$ref":"#/components/schemas/AgentStatus"}},"type":"object","required":["agent_id","status","previous_status"],"title":"AgentStatusResponse"},"AgentStatusUpdate":{"properties":{"status":{"$ref":"#/components/schemas/AgentStatus"}},"type":"object","required":["status"],"title":"AgentStatusUpdate"},"ApiKeyCreateRequest":{"properties":{"label":{"type":"string","maxLength":200,"minLength":1,"title":"Label"},"environment":{"type":"string","enum":["live","test"],"title":"Environment","default":"live"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"rate_limit_per_min":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Rate Limit Per Min","default":600},"allowed_origins":{"items":{"type":"string"},"type":"array","title":"Allowed Origins"}},"type":"object","required":["label"],"title":"ApiKeyCreateRequest","description":"Body for POST /api/api-keys (E9 also exposes this at /api/v1/keys).\n\n`scopes` is accepted but not enforced per-scope yet — reserved for\nv1.1 when we'll gate individual v1 routes behind scope checks."},"ApiKeyIssuedResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"label":{"type":"string","title":"Label"},"environment":{"type":"string","enum":["live","test"],"title":"Environment"},"key":{"type":"string","title":"Key"},"key_prefix":{"type":"string","title":"Key Prefix"},"last_four":{"type":"string","title":"Last Four"},"rate_limit_per_min":{"type":"integer","title":"Rate Limit Per Min"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","tenant_id","label","environment","key","key_prefix","last_four","rate_limit_per_min"],"title":"ApiKeyIssuedResponse","description":"Returned ONCE at issue time. The `key` field is the raw secret\nand never appears again in any other response."},"ApiKeyListItem":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"environment":{"type":"string","enum":["live","test"],"title":"Environment","default":"live"},"key_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Prefix"},"last_four":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Four"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"rate_limit_per_min":{"type":"integer","title":"Rate Limit Per Min","default":600},"allowed_origins":{"items":{"type":"string"},"type":"array","title":"Allowed Origins"},"is_active":{"type":"boolean","title":"Is Active","default":true},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","tenant_id"],"title":"ApiKeyListItem","description":"Row shape for GET /api/api-keys. No secrets. The prefix + last\nfour are enough for an operator to distinguish which key they're\nlooking at in the dev console + revoke the right one."},"ApiKeyRevokeRequest":{"properties":{"reason":{"type":"string","maxLength":500,"title":"Reason","default":""}},"type":"object","title":"ApiKeyRevokeRequest","description":"Optional body for the revoke endpoint — capturing why the key\nwas revoked is a TRAI/compliance win (the `api_key_events.payload`\naudit row pins the reason at the moment of revocation)."},"AudioPath":{"type":"string","enum":["browser","mobile"],"title":"AudioPath"},"AudioUploadResponse":{"properties":{"id":{"type":"string","title":"Id"},"filename":{"type":"string","title":"Filename"},"url":{"type":"string","title":"Url"},"s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"S3 Key"},"duration_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration S"},"sample_rate":{"type":"integer","title":"Sample Rate","default":8000},"format":{"type":"string","title":"Format","default":"wav"}},"type":"object","required":["id","filename","url"],"title":"AudioUploadResponse"},"AuditListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/AuditSessionRow"},"type":"array","title":"Sessions"},"total":{"type":"integer","title":"Total","default":0},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["sessions","limit","offset"],"title":"AuditListResponse"},"AuditSessionRow":{"properties":{"id":{"type":"string","title":"Id"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration S"},"mode":{"$ref":"#/components/schemas/SessionMode"},"audio_path":{"$ref":"#/components/schemas/AudioPath"},"end_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Reason"},"has_recording":{"type":"boolean","title":"Has Recording"},"supervisor_id":{"type":"string","title":"Supervisor Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"agent_extension":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Extension"},"target_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Phone"},"campaign_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Name"}},"type":"object","required":["id","started_at","ended_at","duration_s","mode","audio_path","end_reason","has_recording","supervisor_id"],"title":"AuditSessionRow"},"BillingSettings":{"properties":{"billing_plan":{"type":"string","title":"Billing Plan"},"billing_per_minute_paise":{"type":"integer","title":"Billing Per Minute Paise"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"}},"type":"object","required":["billing_plan","billing_per_minute_paise"],"title":"BillingSettings","description":"What the dashboard shows + allows editing on the billing page."},"BillingSettingsUpdate":{"properties":{"billing_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Plan"},"billing_per_minute_paise":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Billing Per Minute Paise"}},"type":"object","title":"BillingSettingsUpdate","description":"Only the fields an admin is allowed to change. Stripe fields\nrequire ops to set them separately."},"Body_authorize_approve_oauth_authorize_approve_post":{"properties":{"authorize_token":{"type":"string","title":"Authorize Token"},"approve":{"type":"boolean","title":"Approve"}},"type":"object","required":["authorize_token","approve"],"title":"Body_authorize_approve_oauth_authorize_approve_post"},"Body_fs_directory_fs_directory_post":{"properties":{"section":{"type":"string","title":"Section","default":""},"tag_name":{"type":"string","title":"Tag Name","default":""},"key_name":{"type":"string","title":"Key Name","default":""},"key_value":{"type":"string","title":"Key Value","default":""},"user":{"type":"string","title":"User","default":""},"domain":{"type":"string","title":"Domain","default":""},"action":{"type":"string","title":"Action","default":""}},"type":"object","title":"Body_fs_directory_fs_directory_post"},"Body_import_internal_endpoint_api_dnc_internal_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_internal_endpoint_api_dnc_internal_import_post"},"Body_import_trai_endpoint_api_dnc_trai_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_trai_endpoint_api_dnc_trai_import_post"},"Body_introspect_oauth_introspect_post":{"properties":{"token":{"type":"string","title":"Token"},"token_type_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Type Hint"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["token"],"title":"Body_introspect_oauth_introspect_post"},"Body_revoke_oauth_revoke_post":{"properties":{"token":{"type":"string","title":"Token"},"token_type_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Type Hint"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["token"],"title":"Body_revoke_oauth_revoke_post"},"Body_token_oauth_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"code_verifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code Verifier"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"assertion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assertion"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["grant_type"],"title":"Body_token_oauth_token_post"},"Body_upload_audio_api_audio_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_audio_api_audio_upload_post"},"Body_upload_leads_api_campaigns__campaign_id__leads_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_leads_api_campaigns__campaign_id__leads_upload_post"},"BotProviderConfig":{"properties":{"type":{"$ref":"#/components/schemas/BotProviderType","default":"none"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"max_concurrent":{"type":"integer","title":"Max Concurrent","default":50}},"type":"object","title":"BotProviderConfig","description":"Bot provider configuration — defines how answered calls reach the bot."},"BotProviderType":{"type":"string","enum":["none","zetta","sip","websocket"],"title":"BotProviderType"},"BulkLeadsRequest":{"properties":{"leads":{"items":{"$ref":"#/components/schemas/LeadInput"},"type":"array","maxItems":500,"minItems":1,"title":"Leads"}},"type":"object","required":["leads"],"title":"BulkLeadsRequest"},"BulkLeadsResponse":{"properties":{"total":{"type":"integer","title":"Total"},"valid":{"type":"integer","title":"Valid"},"invalid":{"type":"integer","title":"Invalid"},"duplicates":{"type":"integer","title":"Duplicates"},"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Results"}},"type":"object","required":["total","valid","invalid","duplicates","results"],"title":"BulkLeadsResponse"},"Call":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"lead_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"fs_uuid":{"type":"string","title":"Fs Uuid"},"direction":{"type":"string","title":"Direction"},"status":{"$ref":"#/components/schemas/CallStatus","default":"initiated"},"dial_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dial Time"},"ring_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ring Time"},"answer_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answer Time"},"agent_connect_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Agent Connect Time"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"ring_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ring Duration S"},"talk_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Talk Duration S"},"total_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Duration S"},"hangup_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hangup Cause"},"recording_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Path"},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"},"ai_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Sentiment"},"ai_next_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Next Action"}},"type":"object","required":["id","tenant_id","fs_uuid","direction"],"title":"Call"},"CallListItem":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"fs_uuid":{"type":"string","title":"Fs Uuid"},"direction":{"type":"string","title":"Direction"},"status":{"$ref":"#/components/schemas/CallStatus"},"dial_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dial Time"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"talk_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Talk Duration S"},"total_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Duration S"},"disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"},"has_recording":{"type":"boolean","title":"Has Recording","default":false}},"type":"object","required":["id","tenant_id","fs_uuid","direction","status"],"title":"CallListItem","description":"Lightweight call item for paginated list views."},"CallListResponse":{"properties":{"calls":{"items":{"$ref":"#/components/schemas/CallListItem"},"type":"array","title":"Calls"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_next":{"type":"boolean","title":"Has Next"}},"type":"object","required":["calls","total","page","page_size","has_next"],"title":"CallListResponse","description":"Paginated call history response."},"CallNoteRequest":{"properties":{"notes":{"type":"string","title":"Notes"}},"type":"object","required":["notes"],"title":"CallNoteRequest","description":"Request to add or update notes on a call."},"CallNoteResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"notes":{"type":"string","title":"Notes"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["call_id","notes","updated_at"],"title":"CallNoteResponse","description":"Response after saving notes."},"CallStatus":{"type":"string","enum":["initiated","ringing","answered","agent_connected","completed","failed"],"title":"CallStatus"},"CampaignCreate":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id","default":""},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"dial_mode":{"$ref":"#/components/schemas/DialMode","default":"progressive"},"bot_provider":{"$ref":"#/components/schemas/BotProviderConfig","default":{"type":"none","max_concurrent":50}},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"max_attempts":{"type":"integer","title":"Max Attempts","default":3},"retry_delay_mins":{"type":"integer","title":"Retry Delay Mins","default":60},"start_time":{"type":"string","title":"Start Time","default":"09:00"},"end_time":{"type":"string","title":"End Time","default":"21:00"},"timezone":{"type":"string","title":"Timezone","default":"Asia/Kolkata"},"script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"post_answer_action":{"$ref":"#/components/schemas/PostAnswerAction","default":"connect_agent"},"broadcast_audio_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Broadcast Audio Url"},"max_concurrent":{"type":"integer","title":"Max Concurrent","default":10},"predictive_min_dial_ratio":{"type":"number","maximum":5.0,"minimum":1.0,"title":"Predictive Min Dial Ratio","default":1.0},"predictive_max_dial_ratio":{"type":"number","maximum":5.0,"minimum":1.0,"title":"Predictive Max Dial Ratio","default":3.0},"predictive_target_abandon":{"type":"number","maximum":0.03,"exclusiveMinimum":0.0,"title":"Predictive Target Abandon","default":0.025},"predictive_max_wait_s":{"type":"integer","maximum":30.0,"minimum":1.0,"title":"Predictive Max Wait S","default":6},"predictive_wrap_up_s":{"type":"integer","maximum":300.0,"minimum":1.0,"title":"Predictive Wrap Up S","default":30}},"type":"object","required":["name"],"title":"CampaignCreate"},"CampaignResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"dial_mode":{"$ref":"#/components/schemas/DialMode"},"bot_provider":{"$ref":"#/components/schemas/BotProviderConfig","default":{"type":"none","max_concurrent":50}},"status":{"$ref":"#/components/schemas/CampaignStatus","default":"draft"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"max_attempts":{"type":"integer","title":"Max Attempts","default":3},"retry_delay_mins":{"type":"integer","title":"Retry Delay Mins","default":60},"start_time":{"type":"string","title":"Start Time","default":"09:00"},"end_time":{"type":"string","title":"End Time","default":"21:00"},"timezone":{"type":"string","title":"Timezone","default":"Asia/Kolkata"},"script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"post_answer_action":{"$ref":"#/components/schemas/PostAnswerAction","default":"connect_agent"},"max_concurrent":{"type":"integer","title":"Max Concurrent","default":10},"predictive_min_dial_ratio":{"type":"number","title":"Predictive Min Dial Ratio","default":1.0},"predictive_max_dial_ratio":{"type":"number","title":"Predictive Max Dial Ratio","default":3.0},"predictive_target_abandon":{"type":"number","title":"Predictive Target Abandon","default":0.025},"predictive_max_wait_s":{"type":"integer","title":"Predictive Max Wait S","default":6},"predictive_wrap_up_s":{"type":"integer","title":"Predictive Wrap Up S","default":30},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","tenant_id","name","dial_mode"],"title":"CampaignResponse"},"CampaignSeed":{"properties":{"dial_mode":{"type":"string","pattern":"^(preview|progressive|predictive)$","title":"Dial Mode","default":"progressive"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"predictive_max_dial_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Predictive Max Dial Ratio"}},"type":"object","title":"CampaignSeed"},"CampaignStats":{"properties":{"campaign_id":{"type":"string","title":"Campaign Id"},"attempted":{"type":"integer","title":"Attempted","default":0},"connected":{"type":"integer","title":"Connected","default":0},"failed":{"type":"integer","title":"Failed","default":0},"avg_talk_time_s":{"type":"number","title":"Avg Talk Time S","default":0.0},"connect_rate":{"type":"number","title":"Connect Rate","default":0.0},"pending_leads":{"type":"integer","title":"Pending Leads","default":0},"dnd_leads":{"type":"integer","title":"Dnd Leads","default":0},"total_leads":{"type":"integer","title":"Total Leads","default":0}},"type":"object","required":["campaign_id"],"title":"CampaignStats"},"CampaignStatus":{"type":"string","enum":["draft","running","paused","completed","archived"],"title":"CampaignStatus"},"CampaignUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"dial_mode":{"anyOf":[{"$ref":"#/components/schemas/DialMode"},{"type":"null"}]},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"max_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Attempts"},"retry_delay_mins":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retry Delay Mins"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"script":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"post_answer_action":{"anyOf":[{"$ref":"#/components/schemas/PostAnswerAction"},{"type":"null"}]},"max_concurrent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent"},"predictive_min_dial_ratio":{"anyOf":[{"type":"number","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Predictive Min Dial Ratio"},"predictive_max_dial_ratio":{"anyOf":[{"type":"number","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Predictive Max Dial Ratio"},"predictive_target_abandon":{"anyOf":[{"type":"number","maximum":0.03,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Predictive Target Abandon"},"predictive_max_wait_s":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":1.0},{"type":"null"}],"title":"Predictive Max Wait S"},"predictive_wrap_up_s":{"anyOf":[{"type":"integer","maximum":300.0,"minimum":1.0},{"type":"null"}],"title":"Predictive Wrap Up S"}},"type":"object","title":"CampaignUpdate"},"CanaryDevice":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"phone_number":{"type":"string","title":"Phone Number"},"carrier":{"type":"string","enum":["airtel","jio","vi","bsnl"],"title":"Carrier"},"sim_slot":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sim Slot"},"enabled":{"type":"boolean","title":"Enabled"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","label","phone_number","carrier","enabled","created_at"],"title":"CanaryDevice"},"CanaryDeviceListResponse":{"properties":{"devices":{"items":{"$ref":"#/components/schemas/CanaryDevice"},"type":"array","title":"Devices"}},"type":"object","required":["devices"],"title":"CanaryDeviceListResponse"},"CanaryIngestRequest":{"properties":{"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number"},"call_log_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Log Name"},"notification_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Content"},"tc_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tc Display Name"},"tc_spam_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tc Spam Count"},"tc_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tc Category"},"tc_verified_business":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tc Verified Business"},"ocr_raw_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Raw Text"},"timestamp_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timestamp Ms"}},"type":"object","title":"CanaryIngestRequest","description":"Body posted by the Termux script after a canary call lands."},"CanaryIngestResponse":{"properties":{"event_id":{"type":"string","title":"Event Id"},"label":{"type":"string","enum":["clean","spam_likely","fraud_likely","unknown"],"title":"Label"}},"type":"object","required":["event_id","label"],"title":"CanaryIngestResponse"},"ChangeModeRequest":{"properties":{"mode":{"$ref":"#/components/schemas/SessionMode"}},"type":"object","required":["mode"],"title":"ChangeModeRequest"},"ChatHistoryResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"ChatHistoryResponse"},"ChatMarkReadRequest":{"properties":{"peer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Peer Id"}},"type":"object","title":"ChatMarkReadRequest"},"ChatMessage":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"sender_id":{"type":"string","title":"Sender Id"},"recipient_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Id"},"body":{"type":"string","title":"Body"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Created At"},"read_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Read At"}},"type":"object","required":["id","tenant_id","sender_id","recipient_id","body"],"title":"ChatMessage"},"ChatSendRequest":{"properties":{"body":{"type":"string","maxLength":2000,"minLength":1,"title":"Body"},"recipient_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Id"}},"type":"object","required":["body"],"title":"ChatSendRequest"},"ClickToCallRequest":{"properties":{"phone":{"type":"string","title":"Phone","description":"Destination phone (digits only, +/space stripped)"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id","description":"Specific agent to ring; omit for round-robin"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id","description":"Override outbound caller ID"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["phone"],"title":"ClickToCallRequest"},"ClickToCallResponse":{"properties":{"call_uuid":{"type":"string","title":"Call Uuid"},"agent_id":{"type":"string","title":"Agent Id"},"agent_extension":{"type":"string","title":"Agent Extension"},"status":{"type":"string","title":"Status","default":"ringing"}},"type":"object","required":["call_uuid","agent_id","agent_extension"],"title":"ClickToCallResponse"},"ClientCreate":{"properties":{"client_id":{"type":"string","maxLength":100,"minLength":4,"title":"Client Id"},"client_name":{"type":"string","maxLength":200,"minLength":1,"title":"Client Name"},"redirect_uris":{"items":{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},"type":"array","minItems":1,"title":"Redirect Uris"},"allowed_scopes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Allowed Scopes"},"allowed_grant_types":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Allowed Grant Types"},"jwt_issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jwt Issuer"},"jwt_public_key_pem":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jwt Public Key Pem"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"}},"type":"object","required":["client_id","client_name","redirect_uris","allowed_scopes","allowed_grant_types"],"title":"ClientCreate"},"ClientCreated":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"},"client_name":{"type":"string","title":"Client Name"},"redirect_uris":{"items":{"type":"string"},"type":"array","title":"Redirect Uris"},"allowed_scopes":{"items":{"type":"string"},"type":"array","title":"Allowed Scopes"},"allowed_grant_types":{"items":{"type":"string"},"type":"array","title":"Allowed Grant Types"}},"type":"object","required":["id","client_id","client_secret","client_name","redirect_uris","allowed_scopes","allowed_grant_types"],"title":"ClientCreated"},"ClientListItem":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"redirect_uris":{"items":{"type":"string"},"type":"array","title":"Redirect Uris"},"allowed_scopes":{"items":{"type":"string"},"type":"array","title":"Allowed Scopes"},"allowed_grant_types":{"items":{"type":"string"},"type":"array","title":"Allowed Grant Types"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","client_id","client_name","redirect_uris","allowed_scopes","allowed_grant_types","is_active"],"title":"ClientListItem"},"ConsentPayload":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_name":{"type":"string","title":"Client Name"},"scopes":{"items":{"prefixItems":[{"type":"string"},{"type":"string"}],"type":"array","maxItems":2,"minItems":2},"type":"array","title":"Scopes"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"state":{"type":"string","title":"State"},"authorize_token":{"type":"string","title":"Authorize Token"}},"type":"object","required":["client_id","client_name","scopes","redirect_uri","state","authorize_token"],"title":"ConsentPayload","description":"Returned from GET /oauth/authorize when the user hasn't yet\napproved. The dialer-ui consent page renders this + collects\napprove/deny, then POSTs /oauth/authorize/approve with the\nsigned payload + decision."},"ControlEvent":{"properties":{"event":{"type":"string","enum":["transfer","hangup","log"],"title":"Event"},"destination_type":{"anyOf":[{"type":"string","enum":["agent_queue","e164"]},{"type":"null"}],"title":"Destination Type"},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["event"],"title":"ControlEvent","description":"The JSON body a voice agent POSTs to /ai-sessions/{call_id}/control."},"ControlResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"call_id":{"type":"string","title":"Call Id"},"dispatched_at":{"type":"string","title":"Dispatched At"}},"type":"object","required":["call_id","dispatched_at"],"title":"ControlResponse","description":"200 response body per spec §5.3."},"CreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"purpose":{"type":"string","maxLength":255,"minLength":1,"title":"Purpose"},"admin_api_key_role":{"type":"string","pattern":"^(?:SUPER_ADMIN|TENANT_ADMIN|SUPERVISOR|AGENT|API_USER)$","title":"Admin Api Key Role","default":"SUPER_ADMIN"}},"type":"object","required":["name","purpose"],"title":"CreateRequest"},"CreateResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"admin_api_key":{"type":"string","title":"Admin Api Key"},"admin_api_key_role":{"type":"string","title":"Admin Api Key Role"},"test_did":{"type":"string","title":"Test Did"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["tenant_id","admin_api_key","admin_api_key_role","test_did","created_at"],"title":"CreateResponse"},"DIDCreate":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id","default":""},"number":{"type":"string","title":"Number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["number"],"title":"DIDCreate"},"DIDResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"number":{"type":"string","title":"Number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"flow_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Name"}},"type":"object","required":["id","tenant_id","number"],"title":"DIDResponse"},"DIDUpdate":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"flow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flow Id"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"DIDUpdate"},"DialMode":{"type":"string","enum":["preview","progressive","predictive"],"title":"DialMode"},"DialRequest":{"properties":{"campaign_id":{"type":"string","title":"Campaign Id"},"lead_id":{"type":"string","title":"Lead Id"}},"type":"object","required":["campaign_id","lead_id"],"title":"DialRequest"},"DidPoolDetailResponse":{"properties":{"entry":{"$ref":"#/components/schemas/DidPoolEntry"},"latest_snapshot":{"anyOf":[{"$ref":"#/components/schemas/HealthSnapshot"},{"type":"null"}]},"canary_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Canary Events","default":[]}},"type":"object","required":["entry"],"title":"DidPoolDetailResponse"},"DidPoolEntry":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"number":{"type":"string","title":"Number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"carrier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carrier"},"prefix_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix Class"},"role":{"type":"string","enum":["inbound","outbound","both"],"title":"Role"},"status":{"type":"string","enum":["warming","active","resting","retired"],"title":"Status"},"health_score":{"type":"number","title":"Health Score"},"last_scored_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Scored At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"calls_today":{"type":"integer","title":"Calls Today","default":0},"resting_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resting Until"},"retired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retired At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","number","role","status","health_score","created_at"],"title":"DidPoolEntry"},"DidPoolListResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/DidPoolEntry"},"type":"array","title":"Entries"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["entries","total"],"title":"DidPoolListResponse"},"DidPoolStats":{"properties":{"warming":{"type":"integer","title":"Warming"},"active":{"type":"integer","title":"Active"},"resting":{"type":"integer","title":"Resting"},"retired":{"type":"integer","title":"Retired"},"avg_health_score":{"type":"number","title":"Avg Health Score"},"canary_devices_active":{"type":"integer","title":"Canary Devices Active"}},"type":"object","required":["warming","active","resting","retired","avg_health_score","canary_devices_active"],"title":"DidPoolStats"},"DisposeRequestBody":{"properties":{"call_id":{"type":"string","title":"Call Id"},"disposition":{"type":"string","title":"Disposition"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"callback_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Callback At"}},"type":"object","required":["call_id","disposition"],"title":"DisposeRequestBody"},"DispositionCreate":{"properties":{"label":{"type":"string","title":"Label"},"code":{"type":"string","title":"Code"},"is_callback":{"type":"boolean","title":"Is Callback","default":false},"is_dnc":{"type":"boolean","title":"Is Dnc","default":false},"color":{"type":"string","title":"Color","default":"#6B7280"},"sort_order":{"type":"integer","title":"Sort Order","default":0}},"type":"object","required":["label","code"],"title":"DispositionCreate"},"DispositionResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"label":{"type":"string","title":"Label"},"code":{"type":"string","title":"Code"},"is_callback":{"type":"boolean","title":"Is Callback"},"is_dnc":{"type":"boolean","title":"Is Dnc"},"color":{"type":"string","title":"Color"},"sort_order":{"type":"integer","title":"Sort Order"}},"type":"object","required":["id","tenant_id","label","code","is_callback","is_dnc","color","sort_order"],"title":"DispositionResponse"},"DispositionUpdate":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"is_callback":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Callback"},"is_dnc":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Dnc"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"sort_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Order"}},"type":"object","title":"DispositionUpdate"},"DncEvent":{"properties":{"id":{"type":"string","title":"Id"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"},"event_type":{"type":"string","title":"Event Type"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_type","created_at"],"title":"DncEvent"},"DncEventListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/DncEvent"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total","default":0},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["events","limit","offset"],"title":"DncEventListResponse"},"DncStats":{"properties":{"internal_count":{"type":"integer","title":"Internal Count"},"trai_count":{"type":"integer","title":"Trai Count"},"last_trai_import_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Trai Import At"},"last_rescrub_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Rescrub At"}},"type":"object","required":["internal_count","trai_count"],"title":"DncStats"},"FloorSummary":{"properties":{"total_agents":{"type":"integer","title":"Total Agents","default":0},"available":{"type":"integer","title":"Available","default":0},"on_call":{"type":"integer","title":"On Call","default":0},"ringing":{"type":"integer","title":"Ringing","default":0},"wrap_up":{"type":"integer","title":"Wrap Up","default":0},"on_break":{"type":"integer","title":"On Break","default":0},"offline":{"type":"integer","title":"Offline","default":0},"calls_today":{"type":"integer","title":"Calls Today","default":0},"connect_rate":{"type":"number","title":"Connect Rate","default":0.0},"avg_talk_time_s":{"type":"integer","title":"Avg Talk Time S","default":0}},"type":"object","title":"FloorSummary","description":"Aggregate KPIs for the stats bar."},"FloorViewResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"agents":{"items":{"$ref":"#/components/schemas/AgentFloorItem"},"type":"array","title":"Agents"},"summary":{"$ref":"#/components/schemas/FloorSummary"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["tenant_id","agents","summary","timestamp"],"title":"FloorViewResponse","description":"Full floor view snapshot."},"FlowCreate":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id","default":""},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"type":{"$ref":"#/components/schemas/FlowType","default":"general"},"graph":{"$ref":"#/components/schemas/FlowGraph","default":{"nodes":[],"edges":[]}},"initial_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Node Id"}},"type":"object","required":["name"],"title":"FlowCreate"},"FlowEdge":{"properties":{"id":{"type":"string","title":"Id"},"source":{"type":"string","title":"Source"},"target":{"type":"string","title":"Target"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"sourceHandle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcehandle"},"targetHandle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Targethandle"}},"type":"object","required":["id","source","target"],"title":"FlowEdge"},"FlowGraph":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/FlowNode"},"type":"array","title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/FlowEdge"},"type":"array","title":"Edges"}},"type":"object","title":"FlowGraph"},"FlowNode":{"properties":{"id":{"type":"string","title":"Id"},"type":{"$ref":"#/components/schemas/NodeType"},"position":{"$ref":"#/components/schemas/NodePosition","default":{"x":0.0,"y":0.0}},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["id","type"],"title":"FlowNode"},"FlowResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"type":{"$ref":"#/components/schemas/FlowType"},"status":{"$ref":"#/components/schemas/FlowStatus","default":"draft"},"graph":{"$ref":"#/components/schemas/FlowGraph","default":{"nodes":[],"edges":[]}},"initial_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Node Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","tenant_id","name","type"],"title":"FlowResponse"},"FlowStatus":{"type":"string","enum":["draft","published","archived"],"title":"FlowStatus"},"FlowTestRequest":{"properties":{"phone":{"type":"string","title":"Phone"}},"type":"object","required":["phone"],"title":"FlowTestRequest"},"FlowTestResponse":{"properties":{"call_uuid":{"type":"string","title":"Call Uuid"},"flow_id":{"type":"string","title":"Flow Id"},"status":{"type":"string","title":"Status","default":"initiated"}},"type":"object","required":["call_uuid","flow_id"],"title":"FlowTestResponse"},"FlowType":{"type":"string","enum":["inbound","outbound","general"],"title":"FlowType"},"FlowUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"type":{"anyOf":[{"$ref":"#/components/schemas/FlowType"},{"type":"null"}]},"graph":{"anyOf":[{"$ref":"#/components/schemas/FlowGraph"},{"type":"null"}]},"initial_node_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Node Id"}},"type":"object","title":"FlowUpdate"},"ForceRotateRequest":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"ForceRotateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthSnapshot":{"properties":{"id":{"type":"string","title":"Id"},"snapshot_at":{"type":"string","format":"date-time","title":"Snapshot At"},"health_score":{"type":"number","title":"Health Score"},"calls_24h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls 24H"},"asr_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Asr 7D"},"short_call_rate_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Short Call Rate 7D"},"complaint_rate_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Complaint Rate 7D"},"repeat_lead_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Repeat Lead Pct"},"canary_labels":{"additionalProperties":true,"type":"object","title":"Canary Labels","default":{}}},"type":"object","required":["id","snapshot_at","health_score"],"title":"HealthSnapshot"},"HealthSnapshotListResponse":{"properties":{"snapshots":{"items":{"$ref":"#/components/schemas/HealthSnapshot"},"type":"array","title":"Snapshots"}},"type":"object","required":["snapshots"],"title":"HealthSnapshotListResponse"},"ImportResponse":{"properties":{"total":{"type":"integer","title":"Total"},"added":{"type":"integer","title":"Added"},"skipped_invalid":{"type":"integer","title":"Skipped Invalid"},"skipped_duplicate":{"type":"integer","title":"Skipped Duplicate"},"mode":{"type":"string","enum":["append","replace"],"title":"Mode","default":"append"}},"type":"object","required":["total","added","skipped_invalid","skipped_duplicate"],"title":"ImportResponse"},"InboundCallRequest":{"properties":{"to_did":{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$","title":"To Did"},"from_number":{"anyOf":[{"type":"string","pattern":"^\\+[1-9]\\d{7,14}$"},{"type":"null"}],"title":"From Number"}},"type":"object","required":["to_did"],"title":"InboundCallRequest"},"InternalDncEntry":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"phone":{"type":"string","title":"Phone"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"added_at":{"type":"string","format":"date-time","title":"Added At"}},"type":"object","required":["id","tenant_id","phone","added_at"],"title":"InternalDncEntry"},"InternalDncListResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/InternalDncEntry"},"type":"array","title":"Entries"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["entries","total","limit","offset"],"title":"InternalDncListResponse"},"IntrospectionResponse":{"properties":{"active":{"type":"boolean","title":"Active"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"token_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Type"},"exp":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp"},"iat":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Iat"},"nbf":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nbf"},"sub":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub"},"aud":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Aud"},"iss":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iss"},"jti":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jti"}},"type":"object","required":["active"],"title":"IntrospectionResponse","description":"RFC 7662 §2.2. For an inactive token we return `{active: false}`\nwith nothing else — the RFC is explicit about not leaking metadata\nfor invalid tokens."},"InviteUserRequest":{"properties":{"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role","default":"AGENT"}},"type":"object","required":["user_id"],"title":"InviteUserRequest"},"IssueKeyRequest":{"properties":{"role":{"type":"string","pattern":"^(?:SUPER_ADMIN|TENANT_ADMIN|SUPERVISOR|AGENT|API_USER)$","title":"Role"},"label":{"type":"string","maxLength":255,"minLength":1,"title":"Label","default":"secondary key"}},"type":"object","required":["role"],"title":"IssueKeyRequest"},"IssueKeyResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"api_key":{"type":"string","title":"Api Key"},"role":{"type":"string","title":"Role"},"label":{"type":"string","title":"Label"}},"type":"object","required":["tenant_id","api_key","role","label"],"title":"IssueKeyResponse"},"LeadInput":{"properties":{"phone":{"type":"string","maxLength":20,"minLength":5,"title":"Phone"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["phone"],"title":"LeadInput"},"LeadResponse":{"properties":{"id":{"type":"string","title":"Id"},"campaign_id":{"type":"string","title":"Campaign Id"},"phone":{"type":"string","title":"Phone"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"status":{"$ref":"#/components/schemas/LeadStatus","default":"pending"},"attempts":{"type":"integer","title":"Attempts","default":0},"dnd_checked":{"type":"boolean","title":"Dnd Checked","default":false},"dnd_clean":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dnd Clean"},"assigned_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Agent Id"},"last_attempted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Attempted At"},"callback_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Callback At"}},"type":"object","required":["id","campaign_id","phone"],"title":"LeadResponse"},"LeadStatus":{"type":"string","enum":["pending","dialing","connected","busy","no_answer","failed","dnd","completed","callback"],"title":"LeadStatus"},"LeadUploadResponse":{"properties":{"total":{"type":"integer","title":"Total"},"valid":{"type":"integer","title":"Valid"},"invalid":{"type":"integer","title":"Invalid"},"duplicates":{"type":"integer","title":"Duplicates"}},"type":"object","required":["total","valid","invalid","duplicates"],"title":"LeadUploadResponse"},"NodePosition":{"properties":{"x":{"type":"number","title":"X"},"y":{"type":"number","title":"Y"}},"type":"object","required":["x","y"],"title":"NodePosition"},"NodeType":{"type":"string","enum":["start","play_audio","collect_digits","connect_bot","connect_agent","transfer","hangup","condition","amd_detect","voicemail_drop"],"title":"NodeType"},"OpenIDConfiguration":{"properties":{"issuer":{"type":"string","title":"Issuer"},"authorization_endpoint":{"type":"string","title":"Authorization Endpoint"},"token_endpoint":{"type":"string","title":"Token Endpoint"},"userinfo_endpoint":{"type":"string","title":"Userinfo Endpoint"},"jwks_uri":{"type":"string","title":"Jwks Uri"},"introspection_endpoint":{"type":"string","title":"Introspection Endpoint"},"revocation_endpoint":{"type":"string","title":"Revocation Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"scopes_supported":{"items":{"type":"string"},"type":"array","title":"Scopes Supported"},"response_types_supported":{"items":{"type":"string"},"type":"array","title":"Response Types Supported"},"grant_types_supported":{"items":{"type":"string"},"type":"array","title":"Grant Types Supported"},"token_endpoint_auth_methods_supported":{"items":{"type":"string"},"type":"array","title":"Token Endpoint Auth Methods Supported"},"code_challenge_methods_supported":{"items":{"type":"string"},"type":"array","title":"Code Challenge Methods Supported"},"subject_types_supported":{"items":{"type":"string"},"type":"array","title":"Subject Types Supported"},"id_token_signing_alg_values_supported":{"items":{"type":"string"},"type":"array","title":"Id Token Signing Alg Values Supported"},"claims_supported":{"items":{"type":"string"},"type":"array","title":"Claims Supported"}},"type":"object","required":["issuer","authorization_endpoint","token_endpoint","userinfo_endpoint","jwks_uri","introspection_endpoint","revocation_endpoint","scopes_supported","response_types_supported","grant_types_supported","token_endpoint_auth_methods_supported","code_challenge_methods_supported","subject_types_supported","id_token_signing_alg_values_supported","claims_supported"],"title":"OpenIDConfiguration","description":"OpenID Connect Discovery 1.0 §3. Salesforce's Auth Provider\nUI consumes this endpoint verbatim — the field names matter\n(they're defined by the spec, not by us)."},"PausePredictiveRequest":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"PausePredictiveRequest","description":"Body for POST /api/campaigns/{id}/predictive/pause. `reason` is\nwritten verbatim into the campaign_paused audit event so the\nsupervisor can tell auto-pauses (`abandon_rate_exceeded`) from\noperator-driven ones."},"PostAnswerAction":{"type":"string","enum":["run_flow","connect_agent","connect_voice_agent"],"title":"PostAnswerAction"},"RecordingSignedUrlResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"url":{"type":"string","title":"Url"},"expires_at":{"type":"string","title":"Expires At"},"duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration S"}},"type":"object","required":["call_id","url","expires_at"],"title":"RecordingSignedUrlResponse","description":"Short-lived signed URL for a call's audio file. `expires_at` is\ninformational — the URL becomes invalid after it. Clients should\nnot cache beyond that; re-call this endpoint for a fresh URL."},"RegisterCanaryDeviceRequest":{"properties":{"label":{"type":"string","maxLength":100,"minLength":1,"title":"Label"},"phone_number":{"type":"string","maxLength":20,"minLength":10,"title":"Phone Number"},"carrier":{"type":"string","enum":["airtel","jio","vi","bsnl"],"title":"Carrier"},"sim_slot":{"anyOf":[{"type":"integer","maximum":4.0,"minimum":1.0},{"type":"null"}],"title":"Sim Slot"}},"type":"object","required":["label","phone_number","carrier"],"title":"RegisterCanaryDeviceRequest"},"RegisterCanaryDeviceResponse":{"properties":{"device":{"$ref":"#/components/schemas/CanaryDevice"},"auth_token":{"type":"string","title":"Auth Token"}},"type":"object","required":["device","auth_token"],"title":"RegisterCanaryDeviceResponse"},"ResumePredictiveRequest":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"ResumePredictiveRequest"},"RotationEvent":{"properties":{"id":{"type":"string","title":"Id"},"did_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Did Id"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"},"event_type":{"type":"string","title":"Event Type"},"old_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Status"},"new_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"telco_ticket_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Telco Ticket Ref"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"}},"type":"object","required":["id","event_type","occurred_at"],"title":"RotationEvent"},"RotationEventListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/RotationEvent"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total","default":0},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["events","limit","offset"],"title":"RotationEventListResponse"},"SeedRequest":{"properties":{"agents":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Agents","default":2},"supervisors":{"type":"integer","maximum":20.0,"minimum":0.0,"title":"Supervisors","default":1},"leads":{"type":"integer","maximum":5000.0,"minimum":0.0,"title":"Leads","default":5},"campaigns":{"items":{"$ref":"#/components/schemas/CampaignSeed"},"type":"array","title":"Campaigns"}},"type":"object","title":"SeedRequest","description":"Parameterises /seed so a single round-trip can provision a\ntenant with N agents / M supervisors / P campaigns × Q leads.\n\nAll fields have sensible defaults — an empty body (`{}`) is\nexplicitly supported and reproduces the legacy 2+1+1+5 shape so\ncallers that predate this body keep working unchanged.\n\nCapacity notes:\n  - Agent extensions use `9<tenant_suffix>{idx:03d}`, so N ≤ 999.\n    Pydantic caps at 200 which fits comfortably below that.\n  - Lead phones must match the test-tenant allowlist regex\n    `^\\+?91999990\\d{4}$`, giving 10000 unique numbers. We cap\n    (campaigns × leads) ≤ 9999 in the handler."},"SessionMode":{"type":"string","enum":["monitor","whisper","barge"],"title":"SessionMode"},"SessionStatus":{"type":"string","enum":["starting","active","ended","failed"],"title":"SessionStatus"},"StartSessionRequest":{"properties":{"target_call_uuid":{"type":"string","title":"Target Call Uuid"},"audio_path":{"$ref":"#/components/schemas/AudioPath"},"initial_mode":{"$ref":"#/components/schemas/SessionMode","default":"monitor"}},"type":"object","required":["target_call_uuid","audio_path"],"title":"StartSessionRequest"},"SupervisorActionResponse":{"properties":{"action":{"$ref":"#/components/schemas/SupervisorActionType"},"call_uuid":{"type":"string","title":"Call Uuid"},"supervisor_id":{"type":"string","title":"Supervisor Id"},"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["action","call_uuid","supervisor_id","success","message"],"title":"SupervisorActionResponse","description":"Response after performing a supervisor action."},"SupervisorActionType":{"type":"string","enum":["monitor","whisper","barge","transfer","force_hangup"],"title":"SupervisorActionType"},"SupervisorSessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"supervisor_id":{"type":"string","title":"Supervisor Id"},"target_call_uuid":{"type":"string","title":"Target Call Uuid"},"target_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Agent Id"},"eavesdrop_channel_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eavesdrop Channel Uuid"},"audio_path":{"$ref":"#/components/schemas/AudioPath"},"destination":{"type":"string","title":"Destination"},"mode":{"$ref":"#/components/schemas/SessionMode"},"status":{"$ref":"#/components/schemas/SessionStatus"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration S"},"end_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Reason"},"recording_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording S3 Key"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"}},"type":"object","required":["id","tenant_id","supervisor_id","target_call_uuid","audio_path","destination","mode","status","started_at"],"title":"SupervisorSessionResponse"},"TenantResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"seats_licensed":{"type":"integer","title":"Seats Licensed"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"caller_id_pool":{"items":{"type":"string"},"type":"array","title":"Caller Id Pool","default":[]},"is_active":{"type":"boolean","title":"Is Active","default":true},"settings":{"additionalProperties":true,"type":"object","title":"Settings","default":{}}},"type":"object","required":["id","name","slug","seats_licensed"],"title":"TenantResponse"},"TenantUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"seats_licensed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seats Licensed"},"caller_id_pool":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Caller Id Pool"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"}},"type":"object","title":"TenantUpdate"},"TraiImportResponse":{"properties":{"total":{"type":"integer","title":"Total"},"added":{"type":"integer","title":"Added"},"skipped_invalid":{"type":"integer","title":"Skipped Invalid"},"skipped_duplicate":{"type":"integer","title":"Skipped Duplicate"},"mode":{"type":"string","enum":["append","replace"],"title":"Mode","default":"append"},"rescrub_task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rescrub Task Id"}},"type":"object","required":["total","added","skipped_invalid","skipped_duplicate"],"title":"TraiImportResponse"},"TransferRequest":{"properties":{"call_uuid":{"type":"string","title":"Call Uuid"},"target_extension":{"type":"string","title":"Target Extension"}},"type":"object","required":["call_uuid","target_extension"],"title":"TransferRequest","description":"Request to force-transfer a call to another extension."},"UpdateRoleRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"UpdateRoleRequest"},"UpdateStatusRequest":{"properties":{"new_status":{"type":"string","enum":["warming","active","resting","retired"],"title":"New Status"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","required":["new_status"],"title":"UpdateStatusRequest"},"UpdateUserProfileRequest":{"properties":{"extension":{"anyOf":[{"type":"string","pattern":"^\\d{3,6}$"},{"type":"null"}],"title":"Extension"},"mobile_number":{"anyOf":[{"type":"string","pattern":"^\\+?\\d{10,15}$"},{"type":"null"}],"title":"Mobile Number"}},"type":"object","title":"UpdateUserProfileRequest"},"UsageDaily":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"usage_date":{"type":"string","format":"date","title":"Usage Date"},"outbound_calls":{"type":"integer","title":"Outbound Calls"},"inbound_calls":{"type":"integer","title":"Inbound Calls"},"outbound_minutes":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Outbound Minutes"},"inbound_minutes":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Inbound Minutes"},"abandoned_calls":{"type":"integer","title":"Abandoned Calls"},"billable_amount_paise":{"type":"integer","title":"Billable Amount Paise","description":"Cost for this day in paise, based on the tenant's billing_per_minute_paise at aggregation time."}},"type":"object","required":["tenant_id","usage_date","outbound_calls","inbound_calls","outbound_minutes","inbound_minutes","abandoned_calls","billable_amount_paise"],"title":"UsageDaily","description":"One row from tenant_usage_daily, as surfaced to callers."},"UsagePeriod":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"period_start":{"type":"string","format":"date","title":"Period Start"},"period_end":{"type":"string","format":"date","title":"Period End"},"outbound_calls":{"type":"integer","title":"Outbound Calls"},"inbound_calls":{"type":"integer","title":"Inbound Calls"},"outbound_minutes":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Outbound Minutes"},"inbound_minutes":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Inbound Minutes"},"abandoned_calls":{"type":"integer","title":"Abandoned Calls"},"billable_amount_paise":{"type":"integer","title":"Billable Amount Paise"},"daily":{"items":{"$ref":"#/components/schemas/UsageDaily"},"type":"array","title":"Daily"}},"type":"object","required":["tenant_id","period_start","period_end","outbound_calls","inbound_calls","outbound_minutes","inbound_minutes","abandoned_calls","billable_amount_paise","daily"],"title":"UsagePeriod","description":"Per-tenant rollup across a date range (YYYY-MM or explicit from/to)."},"UserProfileResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"role":{"type":"string","title":"Role"},"extension":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extension"},"mobile_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mobile Number"}},"type":"object","required":["user_id","tenant_id","role"],"title":"UserProfileResponse"},"UserRoleResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"role":{"type":"string","title":"Role"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","user_id","tenant_id","role"],"title":"UserRoleResponse"},"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"},"WebhookDeliveryRow":{"properties":{"id":{"type":"string","title":"Id"},"subscription_id":{"type":"string","title":"Subscription Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"event_type":{"type":"string","title":"Event Type"},"event_id":{"type":"string","title":"Event Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"attempt":{"type":"integer","title":"Attempt"},"status":{"type":"string","enum":["pending","delivered","failed","dead"],"title":"Status"},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Http Status"},"response_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Snippet"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"next_retry_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Retry At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"}},"type":"object","required":["id","subscription_id","tenant_id","event_type","event_id","payload","attempt","status"],"title":"WebhookDeliveryRow","description":"One row from the delivery log. `payload` is the exact body\nthat was (or will be) POSTed — including the envelope keys so\na customer reconstructing an event from the log sees the same\nshape their handler saw."},"WebhookSubscriptionCreate":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"test_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Test Url"},"event_types":{"items":{"type":"string","enum":["call.started","call.answered","call.ended","call.recording_ready","call.transcript_ready","lead.completed","campaign.started","campaign.paused","campaign.resumed","campaign.completed","agent.logged_in","agent.logged_out"]},"type":"array","minItems":1,"title":"Event Types"}},"type":"object","required":["url","event_types"],"title":"WebhookSubscriptionCreate"},"WebhookSubscriptionCreated":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"url":{"type":"string","title":"Url"},"test_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Url"},"event_types":{"items":{"type":"string","enum":["call.started","call.answered","call.ended","call.recording_ready","call.transcript_ready","lead.completed","campaign.started","campaign.paused","campaign.resumed","campaign.completed","agent.logged_in","agent.logged_out"]},"type":"array","title":"Event Types"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures","default":0},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"},"signing_secret":{"type":"string","title":"Signing Secret"}},"type":"object","required":["id","tenant_id","url","event_types","is_active","signing_secret"],"title":"WebhookSubscriptionCreated","description":"One-time response from POST /api/v1/webhooks. Carries the\n`signing_secret` so the customer can configure their verifier —\nshown ONCE, never returned from any other endpoint (same pattern\nas ApiKeyIssuedResponse)."},"WebhookSubscriptionResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"url":{"type":"string","title":"Url"},"test_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Url"},"event_types":{"items":{"type":"string","enum":["call.started","call.answered","call.ended","call.recording_ready","call.transcript_ready","lead.completed","campaign.started","campaign.paused","campaign.resumed","campaign.completed","agent.logged_in","agent.logged_out"]},"type":"array","title":"Event Types"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"consecutive_failures":{"type":"integer","title":"Consecutive Failures","default":0},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"}},"type":"object","required":["id","tenant_id","url","event_types","is_active"],"title":"WebhookSubscriptionResponse","description":"Returned from list + get. No secrets — see `SubscriptionCreated`\nfor the one-time shape that carries signing_secret."},"WebhookTestRequest":{"properties":{"event_type":{"type":"string","enum":["call.started","call.answered","call.ended","call.recording_ready","call.transcript_ready","lead.completed","campaign.started","campaign.paused","campaign.resumed","campaign.completed","agent.logged_in","agent.logged_out"],"title":"Event Type","default":"call.ended"},"sample_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Sample Payload"}},"type":"object","title":"WebhookTestRequest","description":"Body for POST /api/v1/webhooks/{id}/test — synchronous\ndry-run delivery that echoes the signature + the customer's\nresponse so the operator can debug end-to-end."},"WebhookTestResponse":{"properties":{"delivered":{"type":"boolean","title":"Delivered"},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Http Status"},"response_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Snippet"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["delivered","http_status","response_snippet","duration_ms"],"title":"WebhookTestResponse"},"app__calls__models__CallDetail":{"properties":{"call":{"$ref":"#/components/schemas/Call"},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"ai_processing":{"type":"boolean","title":"Ai Processing","default":false}},"type":"object","required":["call"],"title":"CallDetail","description":"Full call detail with recording URL + AI fields."},"app__platform__v1__calls__CallDetail":{"properties":{"id":{"type":"string","title":"Id"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"lead_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"fs_uuid":{"type":"string","title":"Fs Uuid"},"direction":{"type":"string","title":"Direction"},"status":{"type":"string","title":"Status"},"dial_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dial Time"},"ring_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ring Time"},"answer_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer Time"},"agent_connect_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Connect Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"ring_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ring Duration S"},"talk_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Talk Duration S"},"total_duration_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Duration S"},"hangup_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hangup Cause"},"has_recording":{"type":"boolean","title":"Has Recording","default":false},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disposition"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"},"ai_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Sentiment"},"ai_next_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Next Action"}},"type":"object","required":["id","fs_uuid","direction","status"],"title":"CallDetail","description":"Detail shape — superset of CallListItem with audio + AI fields.\nMirrors the internal Call model but excludes the `tenant_id` field\n(implied by the API key) so we don't echo tenant context in\nresponses the customer will log."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}