{"openapi":"3.1.0","info":{"title":"CallingScout API","description":"Public CallingScout API. Every endpoint here is intended for tenant / SDK use. Internal routes (provider webhook intakes, Clerk sync, operator controls, LLM proxy, live-call streams) are intentionally absent and not part of our backwards compatibility contract.","version":"1.0.0"},"paths":{"/api/v1/agents":{"post":{"tags":["platform"],"summary":"Create Agent","description":"Create a new agent for the authenticated tenant.","operationId":"create_agent_api_v1_agents_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["platform"],"summary":"List Agents","description":"List agents for the authenticated tenant with pagination.","operationId":"list_agents_api_v1_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Active Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}":{"get":{"tags":["platform"],"summary":"Get Agent","description":"Get a specific agent by ID. Must belong to the authenticated tenant.","operationId":"get_agent_api_v1_agents__agent_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["platform"],"summary":"Update Agent","description":"Update an existing agent. Only provided fields are modified.","operationId":"update_agent_api_v1_agents__agent_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["platform"],"summary":"Delete Agent","description":"Soft-delete an agent by setting is_active=False.","operationId":"delete_agent_api_v1_agents__agent_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys":{"get":{"tags":["platform"],"summary":"List Api Keys","description":"List all API keys for the authenticated tenant (metadata only, no plaintext).","operationId":"list_api_keys_api_v1_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Api Keys Api V1 Keys Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["platform"],"summary":"Create Api Key","description":"Create an API key for the authenticated tenant.\n\nThe plaintext key is returned exactly once in the response. It is\nhashed with bcrypt before storage and cannot be retrieved again.\n\nKey format: ``sk_live_<32 urlsafe chars>`` for production, or\n``sk_test_<32 urlsafe chars>`` for sandbox. The prefix is used by\nthe auth layer to derive ``AuthenticatedTenant.sandbox`` on every\nrequest — see ``platform/auth.py::_authenticate_opaque_api_key``.","operationId":"create_api_key_api_v1_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/v1/keys/{key_id}":{"delete":{"tags":["platform"],"summary":"Revoke Api Key","description":"Revoke (hard delete) an API key.\n\nThe key must belong to the authenticated tenant.","operationId":"revoke_api_key_api_v1_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/config":{"get":{"tags":["platform"],"summary":"Get Webhook Config","description":"Get the current webhook configuration for this tenant.","operationId":"get_webhook_config_api_v1_webhooks_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookConfigResponse"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["platform"],"summary":"Update Webhook Config","description":"Set or update the webhook URL. Generates a signing secret if one doesn't exist.","operationId":"update_webhook_config_api_v1_webhooks_config_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"tags":["platform"],"summary":"Delete Webhook Config","description":"Remove the webhook configuration.","operationId":"delete_webhook_config_api_v1_webhooks_config_delete","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/api/v1/webhooks/clerk":{"post":{"tags":["webhooks"],"summary":"Handle Clerk Event","description":"Process a Clerk webhook event.\n\nWe only handle user.created; other event types are acknowledged but ignored.","operationId":"handle_clerk_event_api_v1_webhooks_clerk_post","parameters":[{"name":"svix-id","in":"header","required":true,"schema":{"type":"string","title":"Svix-Id"}},{"name":"svix-timestamp","in":"header","required":true,"schema":{"type":"string","title":"Svix-Timestamp"}},{"name":"svix-signature","in":"header","required":true,"schema":{"type":"string","title":"Svix-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Handle Clerk Event Api V1 Webhooks Clerk Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls":{"post":{"tags":["calls"],"summary":"Initiate Call","description":"Initiate an outbound call.\n\nValidates the agent belongs to the tenant, creates a call record,\nand dispatches the call to RabbitMQ for async processing by a voice worker.\n\nReturns 202 Accepted (the call is queued, not yet connected).","operationId":"initiate_call_api_v1_calls_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["calls"],"summary":"List Calls","description":"List calls for the authenticated tenant.\n\nCursor-based pagination is preferred (O(1), stable under writes). Offset is\nkept for backward compatibility with dashboards that show \"Page 3 of 47\".","operationId":"list_calls_api_v1_calls_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor from previous response","title":"Cursor"},"description":"Opaque cursor from previous response"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Legacy offset pagination (prefer cursor)","default":0,"title":"Offset"},"description":"Legacy offset pagination (prefer cursor)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CallStatus"},{"type":"null"}],"title":"Status"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/CallDirection"},{"type":"null"}],"title":"Direction"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}":{"get":{"tags":["calls"],"summary":"Get Call","description":"Get details for a specific call. Must belong to the authenticated tenant.","operationId":"get_call_api_v1_calls__call_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/transfer":{"post":{"tags":["calls"],"summary":"Transfer Call","description":"Transfer an active call to a human agent.\n\nValidates the destination as E.164, guards against concurrent transfers\nvia a state flag in call.extra, then executes the provider-specific\ntransfer (Twilio TwiML <Dial> update or Telnyx call control transfer).","operationId":"transfer_call_api_v1_calls__call_id__transfer_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTransfer"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTransferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/detail":{"get":{"tags":["calls"],"summary":"Get Call Detail","description":"Fetch full call detail: metadata, transcript, tool executions, metrics, analysis.\n\nReturns all related data in a single response to minimize round-trips.\nTranscript turns and tool calls are merged on the frontend by timestamp.","operationId":"get_call_detail_api_v1_calls__call_id__detail_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/recording":{"get":{"tags":["calls"],"summary":"Get Call Recording Url","description":"Return a short-lived URL for a call recording.\n\nIf GCS is configured, generates a V4 signed URL (15 min TTL).\nIf GCS is not configured (e.g. local dev), returns recording_url directly.\nReturns 404 if no recording exists.","operationId":"get_call_recording_url_api_v1_calls__call_id__recording_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns":{"post":{"tags":["campaigns"],"summary":"Create Campaign","description":"Create a campaign with contacts.\n\nValidates the agent belongs to the tenant, then creates the campaign\nand all contact rows atomically in a single transaction.","operationId":"create_campaign_api_v1_campaigns_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["campaigns"],"summary":"List Campaigns","description":"List campaigns for the authenticated tenant.\n\nCursor-based pagination is preferred (O(1), stable under writes). Offset\nis kept for backward compatibility.","operationId":"list_campaigns_api_v1_campaigns_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque cursor from previous response","title":"Cursor"},"description":"Opaque cursor from previous response"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Legacy offset pagination (prefer cursor)","default":0,"title":"Offset"},"description":"Legacy offset pagination (prefer cursor)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"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/CampaignListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}":{"get":{"tags":["campaigns"],"summary":"Get Campaign","description":"Get details for a specific campaign. Must belong to the authenticated tenant.","operationId":"get_campaign_api_v1_campaigns__campaign_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","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 Criteria","description":"Update success criteria on a draft campaign.","operationId":"update_campaign_criteria_api_v1_campaigns__campaign_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCriteriaUpdate"}}}},"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/v1/campaigns/{campaign_id}/start":{"post":{"tags":["campaigns"],"summary":"Start Campaign","description":"Start a campaign (transition draft -> running, or resume paused -> running).","operationId":"start_campaign_api_v1_campaigns__campaign_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignTransitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/pause":{"post":{"tags":["campaigns"],"summary":"Pause Campaign","description":"Pause a running campaign.","operationId":"pause_campaign_api_v1_campaigns__campaign_id__pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignTransitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/cancel":{"post":{"tags":["campaigns"],"summary":"Cancel Campaign","description":"Cancel a campaign (from any non-terminal state).","operationId":"cancel_campaign_api_v1_campaigns__campaign_id__cancel_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignTransitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/generate-criteria":{"post":{"tags":["campaigns"],"summary":"Generate Campaign Criteria","description":"Use LLM to generate outcome labels and extraction schema from natural language goal.\n\nUses the tenant's most-recently-updated active agent's LLM provider.\nReturns generic defaults if the LLM call fails — never blocks campaign creation.\nTimeout: 30s (inherited from _call_llm_for_analysis).","operationId":"generate_campaign_criteria_api_v1_campaigns_generate_criteria_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCriteriaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCriteriaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/campaigns/{campaign_id}/analytics":{"get":{"tags":["campaigns"],"summary":"Get Campaign Analytics","description":"Aggregate outcome funnel, metrics, and time series for a campaign.\n\nTenant-isolated: only campaigns belonging to the authenticated tenant are accessible.","operationId":"get_campaign_analytics_api_v1_campaigns__campaign_id__analytics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Campaign Analytics Api V1 Campaigns  Campaign Id  Analytics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/insights":{"get":{"tags":["campaigns"],"summary":"Get Campaign Insights","description":"Return AI-generated insights for failed/low-quality calls.\n\nRedis-cached with 1-hour TTL. Returns empty list if < 20 completed analyses.","operationId":"get_campaign_insights_api_v1_campaigns__campaign_id__insights_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Campaign Insights Api V1 Campaigns  Campaign Id  Insights Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/extracted-data/export":{"get":{"tags":["campaigns"],"summary":"Export Campaign Extracted Data","description":"Export all extracted data for a campaign as a CSV file.\n\nMVP: synchronous export, capped at 5000 rows.\nContent-Disposition: attachment with campaign name.","operationId":"export_campaign_extracted_data_api_v1_campaigns__campaign_id__extracted_data_export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","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/v1/campaigns/{campaign_id}/extracted-data":{"get":{"tags":["campaigns"],"summary":"Get Campaign Extracted Data","description":"Paginated extracted data for analyzed calls in a campaign.\n\nFilterable by outcome label, sortable by started_at | outcome_score | duration_seconds.","operationId":"get_campaign_extracted_data_api_v1_campaigns__campaign_id__extracted_data_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"started_at","title":"Sort"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"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":{"title":"Response Get Campaign Extracted Data Api V1 Campaigns  Campaign Id  Extracted Data Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/check":{"post":{"tags":["campaigns"],"summary":"Compliance Check","description":"Run a single-number compliance check without placing a call.\n\nUseful for pre-flight verification of phone numbers before adding them\nto a campaign or initiating a call.","operationId":"compliance_check_api_v1_compliance_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/campaigns/{campaign_id}/contacts":{"get":{"tags":["campaigns"],"summary":"List Campaign Contacts","description":"List contacts for a campaign with pagination and optional status filter.","operationId":"list_campaign_contacts_api_v1_campaigns__campaign_id__contacts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"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/CampaignContactListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/{campaign_id}/contacts/{contact_id}/reschedule":{"post":{"tags":["campaigns"],"summary":"Reschedule Campaign Contact","description":"Operator-initiated reschedule.\n\nFlips the contact back to ``pending`` with a ``next_retry_at`` the\ncampaign engine honors on its next poll tick. Works regardless of\nthe contact's current state — an operator calling this on an\nalready-failed contact resurrects it for another attempt.\n\nValidation: ``next_retry_at`` must be strictly in the future.\nScheduling in the past would cause the engine to dispatch\nimmediately, which the existing ``scheduled_start`` and\ncalling-hours gates at the campaign level would then catch — but\nnot all paths go through those, so we block here too.","operationId":"reschedule_campaign_contact_api_v1_campaigns__campaign_id__contacts__contact_id__reschedule_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRescheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/campaigns/upload":{"post":{"tags":["campaigns"],"summary":"Upload Csv Campaign","description":"Upload a CSV file to create a campaign with contacts.\n\nRequired CSV column: ``phone`` (or ``phone_number``).\nOptional columns: ``first_name``, ``last_name``, plus any custom fields\nstored in ``contact_data``.\n\nMaximum 10,000 contacts per upload.","operationId":"upload_csv_campaign_api_v1_campaigns_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"campaign_name","in":"query","required":true,"schema":{"type":"string","maxLength":255,"title":"Campaign Name"}},{"name":"caller_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Caller Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_csv_campaign_api_v1_campaigns_upload_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSVUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/test":{"post":{"tags":["campaigns"],"summary":"Test Call","description":"Place a single test call to hear how the agent sounds.\n\nUses the same pipeline as production calls but is rate-limited to\n5 test calls per hour per tenant in production. The limit is skipped\nin development so builders can iterate without hitting the ceiling\nmid-debug.","operationId":"test_call_api_v1_calls_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCallRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Test Call Api V1 Calls Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/calls/{call_id}/whisper":{"post":{"tags":["operator"],"summary":"Post Whisper","description":"Enqueue an operator note to the active agent's LLM context.\n\nReturns 202 Accepted once the audit row is written and the RabbitMQ\npublish has completed (or failed with a logged warning).","operationId":"post_whisper_api_v1_calls__call_id__whisper_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhisperRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Whisper Api V1 Calls  Call Id  Whisper Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/nudge":{"post":{"tags":["operator"],"summary":"Post Nudge","description":"Look up the preset by id on the call's agent and enqueue it as a whisper.","operationId":"post_nudge_api_v1_calls__call_id__nudge_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Nudge Api V1 Calls  Call Id  Nudge Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/hangup":{"post":{"tags":["operator"],"summary":"Post Hangup","description":"Gracefully end the call via the shared end-call pipeline.\n\nIdempotent — if the call is already in a terminal state, returns\n``{\"status\": \"already_ended\"}`` without emitting a command.","operationId":"post_hangup_api_v1_calls__call_id__hangup_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HangupRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Hangup Api V1 Calls  Call Id  Hangup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calls/{call_id}/operator-actions":{"get":{"tags":["operator"],"summary":"List Operator Actions","description":"Return the full audit log for a single call.","operationId":"list_operator_actions_api_v1_calls__call_id__operator_actions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorActionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/nudge-presets":{"get":{"tags":["operator"],"summary":"Get Nudge Presets","operationId":"get_nudge_presets_api_v1_agents__agent_id__nudge_presets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgePresetsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["operator"],"summary":"Replace Nudge Presets","description":"Replace the agent's nudge presets list. Entries without an id get one.","operationId":"replace_nudge_presets_api_v1_agents__agent_id__nudge_presets_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNudgePresetsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgePresetsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/overview":{"get":{"tags":["analytics"],"summary":"Overview","description":"Business-outcome overview across all tenant campaigns.\n\n\"Primary outcome\" = first label in campaign.outcome_labels. If a\ncampaign has no labels configured, the outcome \"Completed\" is used\nas a fallback so legacy rows still contribute.","operationId":"overview_api_v1_analytics_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/usage":{"get":{"tags":["billing"],"summary":"Get Billing Usage","description":"Get billing usage summary for the current tenant.\n\nReturns aggregate usage for the current billing period (calendar month)\nplus a daily breakdown for charting.","operationId":"get_billing_usage_api_v1_billing_usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/setup":{"post":{"tags":["billing"],"summary":"Create Setup Session","description":"Create a Stripe Checkout in SETUP mode — pay-as-you-go onboarding.\n\nCollects a payment method, links it to the tenant's Stripe customer,\nand returns. No subscription, no plan, no recurring charge. Usage\nis billed via Stripe Meter Events from ``postcall/billing.py`` after\neach call based on the tenant's actual provider cost + overhead.\n\nThis is the Phase 4 pay-as-you-go entry point. The legacy\n``/checkout`` endpoint (fixed tier plans: starter / growth / scale)\nis retained for backward compatibility but marked deprecated.","operationId":"create_setup_session_api_v1_billing_setup_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CheckoutRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout Session","description":"DEPRECATED: Fixed tier plan checkout.\n\nLeft in place for backward compatibility. New integrations should\nuse ``POST /api/v1/billing/setup`` (pay-as-you-go) instead. This\nendpoint will be removed in a future breaking revision of the\npublic API.","operationId":"create_checkout_session_api_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true,"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal Session","description":"Create a Stripe Customer Portal session.\n\nThe portal lets the customer update card, download invoices, switch\nplans, or cancel. The tenant must already have a Stripe customer; if\nnot (e.g. they never upgraded) we return 409 so the UI can redirect to\nCheckout instead.","operationId":"create_portal_session_api_v1_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/phones/available":{"get":{"tags":["phone-numbers"],"summary":"Search Available Numbers","description":"Search for available phone numbers to purchase.","operationId":"search_available_numbers_api_v1_phones_available_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":2,"default":"US","title":"Country"}},{"name":"area_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Area Code"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":10,"title":"Limit"}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","description":"Telephony provider: 'twilio' or 'telnyx'","default":"twilio","title":"Provider"},"description":"Telephony provider: 'twilio' or 'telnyx'"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AvailableNumber"},"title":"Response Search Available Numbers Api V1 Phones Available Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/phones":{"get":{"tags":["phone-numbers"],"summary":"List Numbers","description":"List all phone numbers for the authenticated tenant.","operationId":"list_numbers_api_v1_phones_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberListResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["phone-numbers"],"summary":"Provision Number","description":"Purchase a phone number from the selected provider and register it.","operationId":"provision_number_api_v1_phones_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/phones/{phone_id}":{"patch":{"tags":["phone-numbers"],"summary":"Assign Agent","description":"Assign or unassign a phone number to an agent.","operationId":"assign_agent_api_v1_phones__phone_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"phone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignAgentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["phone-numbers"],"summary":"Release Number","description":"Release (delete) a phone number. Also releases it from Twilio.","operationId":"release_number_api_v1_phones__phone_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"phone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Phone Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/verifications":{"post":{"tags":["verifications"],"summary":"Start Verification Endpoint","operationId":"start_verification_endpoint_api_v1_verifications_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/verifications/confirm":{"post":{"tags":["verifications"],"summary":"Confirm Verification Endpoint","description":"Verify the code the user entered and persist on approval.\n\nOn ``approved``:\n  - stamp ``users.verified_phone_e164`` + ``users.verified_at`` for\n    the caller, and\n  - stamp ``phone_numbers.caller_id_verified_at`` for any matching\n    PhoneNumber row in this tenant so outbound dispatch unblocks\n    immediately.\n\nA phone number can be user-BYO'd (not a purchased PhoneNumber row)\nin which case only the User is stamped; the provisioning side\nnever reaches caller-ID enforcement for that number anyway\nbecause the PhoneNumber row won't exist.","operationId":"confirm_verification_endpoint_api_v1_verifications_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/webhooks/event-types":{"get":{"tags":["webhooks"],"summary":"List Event Types","description":"Return every public webhook event type + human description.","operationId":"list_event_types_api_v1_webhooks_event_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventCatalogResponse"}}}}}}},"/api/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"List Webhooks","operationId":"list_webhooks_api_v1_webhooks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookResponse"},"type":"array","title":"Response List Webhooks Api V1 Webhooks Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["webhooks"],"summary":"Create Webhook","description":"Register a new webhook subscription. Secret is returned once only.","operationId":"create_webhook_api_v1_webhooks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/webhooks/{webhook_id}":{"get":{"tags":["webhooks"],"summary":"Get Webhook","operationId":"get_webhook_api_v1_webhooks__webhook_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["webhooks"],"summary":"Update Webhook","operationId":"update_webhook_api_v1_webhooks__webhook_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete Webhook","operationId":"delete_webhook_api_v1_webhooks__webhook_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{webhook_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Deliveries","operationId":"list_deliveries_api_v1_webhooks__webhook_id__deliveries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryResponse"},"title":"Response List Deliveries Api V1 Webhooks  Webhook Id  Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/deliveries/{delivery_id}/replay":{"post":{"tags":["webhooks"],"summary":"Replay Delivery Endpoint","description":"Re-fire a previous delivery's exact payload to its webhook.","operationId":"replay_delivery_endpoint_api_v1_webhooks_deliveries__delivery_id__replay_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/{webhook_id}/test":{"post":{"tags":["webhooks"],"summary":"Test Fire","description":"Fire a synthetic event to this webhook to verify setup.","operationId":"test_fire_api_v1_webhooks__webhook_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestFireRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations":{"get":{"tags":["integrations"],"summary":"List Integrations","description":"List all available integrations with tenant's connection status.","operationId":"list_integrations_api_v1_integrations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/IntegrationInfo"},"type":"array","title":"Response List Integrations Api V1 Integrations Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/integrations/{slug}/api-key-connect":{"post":{"tags":["integrations"],"summary":"Connect With Api Key","description":"Connect an integration using an API key / token instead of OAuth.\n\nFor integrations like Discord (webhook URL), Calendly (PAT), Airtable (key + base).","operationId":"connect_with_api_key_api_v1_integrations__slug__api_key_connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{slug}/connect":{"post":{"tags":["integrations"],"summary":"Connect Integration","description":"Initiate OAuth connection for an integration.\n\nReturns the OAuth redirect URL. The frontend should open this in\na popup or redirect the user.","operationId":"connect_integration_api_v1_integrations__slug__connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{slug}/callback":{"get":{"tags":["integrations"],"summary":"Oauth Callback","description":"OAuth callback — exchanges code for tokens and redirects to dashboard.\n\nThis endpoint is called by the OAuth provider after the user authorizes.\nIt does NOT require Bearer token auth — state parameter provides CSRF protection.","operationId":"oauth_callback_api_v1_integrations__slug__callback_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{slug}":{"delete":{"tags":["integrations"],"summary":"Disconnect Integration","description":"Disconnect an integration — revoke tokens and remove connection.","operationId":"disconnect_integration_api_v1_integrations__slug__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{slug}/status":{"get":{"tags":["integrations"],"summary":"Integration Status","description":"Check the connection health of an integration.","operationId":"integration_status_api_v1_integrations__slug__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations/{slug}/config":{"patch":{"tags":["integrations"],"summary":"Update Integration Config","description":"Update integration-specific settings (e.g. Slack channel).\n\nMerges the provided config keys into the existing TenantIntegration.config JSONB.\nThe integration must already be connected.","operationId":"update_integration_config_api_v1_integrations__slug__config_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/test/text":{"post":{"tags":["testing"],"summary":"Start Text Test","description":"Text-only test with SSE streaming. Supports multi-turn conversation.\n\nIf body.session_id is provided, loads the existing session and appends\nthe new message to the conversation history. Otherwise creates a new\nsession. The session ID is always returned in the X-Session-Id header.","operationId":"start_text_test_api_v1_agents__agent_id__test_text_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextTestMessage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/test/webrtc":{"post":{"tags":["testing"],"summary":"Start Webrtc Test","description":"Create a WebRTC test session for an agent.\n\nReturns a session_id and a webrtc_url. The frontend should POST the\nbrowser's SDP offer to that URL to complete the WebRTC handshake and\nstart the Pipecat pipeline.","operationId":"start_webrtc_test_api_v1_agents__agent_id__test_webrtc_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebRTCSessionCreate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/test-sessions/{session_id}/offer":{"post":{"tags":["testing"],"summary":"Webrtc Offer","description":"Proxy a browser WebRTC SDP offer to the worker pod that owns this session.\n\nAuth: Clerk/API-key tenant auth (same as session creation). The proxy call\nto the worker uses the X-Internal-Auth shared secret.\n\nBody fields: sdp (str), type (str), pc_id (str, optional),\nrestart_pc (bool, optional), ice_servers (list, optional — injected here\nif absent so the browser doesn't have to round-trip TURN credentials).\n\nReturns the worker's SDP answer verbatim.","operationId":"webrtc_offer_api_v1_test_sessions__session_id__offer_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Webrtc Offer Api V1 Test Sessions  Session Id  Offer Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/test/websocket":{"post":{"tags":["testing"],"summary":"Start Websocket Test","description":"Create a WebSocket test session for an agent.\n\nReturns a session_id, a stream_url for the WebSocket endpoint, and a\nshort-lived HMAC token. The frontend connects to stream_url?t=<ws_token>\nto start the bidirectional audio+event stream.\n\nThe worker pod is selected via DNS resolution of the headless k8s service.\nReturns 503 if all worker pods are at capacity.","operationId":"start_websocket_test_api_v1_agents__agent_id__test_websocket_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsSessionCreate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/test-sessions/{session_id}/result":{"get":{"tags":["testing"],"summary":"Get Test Session Result","description":"Get the result of a test session.\n\nReturns 202 Accepted with Retry-After: 3 if analysis is still running.\nReturns 404 if the session does not belong to this tenant.","operationId":"get_test_session_result_api_v1_test_sessions__session_id__result_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSessionResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/{agent_id}/test-sessions":{"get":{"tags":["testing"],"summary":"List Agent Test Sessions","description":"List test sessions for an agent, paginated and ordered by created_at desc.\n\nVerifies the agent belongs to the tenant before querying sessions.","operationId":"list_agent_test_sessions_api_v1_agents__agent_id__test_sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSessionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/test-sessions/{session_id}/transcript":{"patch":{"tags":["testing"],"summary":"Save Test Session Transcript","description":"Save client-collected transcript for a WebRTC test session.\n\nWebRTC voice sessions produce transcription events over the data channel.\nThe frontend collects these and sends them back here before ending the\nsession so that post-call analysis has transcript data to work with.","operationId":"save_test_session_transcript_api_v1_test_sessions__session_id__transcript_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Transcript"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/test-sessions/{session_id}":{"delete":{"tags":["testing"],"summary":"End Test Session","description":"End a test session.\n\nSets ended_at and calculates duration_seconds. Idempotent: if the session\nis already ended, returns 204 without modification.\n\nFor WebRTC sessions: stops the active Pipecat pipeline (if running).\nFor WebSocket sessions: releases the Redis lease and worker slot.\nPipeline/lease shutdown is non-blocking — errors are logged but do not\nprevent the session from being marked ended.\n\nTriggers post-call analysis in the background after ending the session.","operationId":"end_test_session_api_v1_test_sessions__session_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/infer-capture":{"post":{"tags":["agent-ai"],"summary":"Infer Capture","description":"Infer capture fields from a role description.","operationId":"infer_capture_api_v1_agents_infer_capture_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferCaptureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferCaptureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports/catalog":{"get":{"tags":["reports"],"summary":"Get Catalog","description":"Return every registered metric: id, label, category, viz, unit.","operationId":"get_catalog_api_v1_reports_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports/templates":{"get":{"tags":["reports"],"summary":"List Board Templates","description":"Return the static list of board templates ready for cloning.","operationId":"list_board_templates_api_v1_reports_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Response List Board Templates Api V1 Reports Templates Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/reports/metrics/{metric_id}":{"get":{"tags":["reports"],"summary":"Preview Metric","description":"Compute a single metric for the picker preview pane.\n\nUses the default ``last_7_days`` window and no filters. The picker\nUI calls this when the user hovers a metric in the catalog to show\na live value before they drop the block onto the board.","operationId":"preview_metric_api_v1_reports_metrics__metric_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"metric_id","in":"path","required":true,"schema":{"type":"string","title":"Metric Id"}},{"name":"range_kind","in":"query","required":false,"schema":{"type":"string","default":"last_7_days","title":"Range Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/insights":{"get":{"tags":["insights"],"summary":"List Insights","description":"Return active insights for the caller's tenant.\n\nExcludes any insight the caller has dismissed. Ordered severity DESC\nthen detected_at DESC. The dashboard defaults to ``limit=3``.","operationId":"list_insights_api_v1_insights_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":3,"title":"Limit"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/insights/{insight_id}/dismiss":{"post":{"tags":["insights"],"summary":"Dismiss Insight","description":"Hide ``insight_id`` from the caller's view. Idempotent.","operationId":"dismiss_insight_api_v1_insights__insight_id__dismiss_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"insight_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Insight Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["insights"],"summary":"Undismiss Insight","description":"Undo a dismissal. Idempotent — never 404s.","operationId":"undismiss_insight_api_v1_insights__insight_id__dismiss_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"insight_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Insight Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"pipeline_type":{"$ref":"#/components/schemas/PipelineType","default":"cascaded"},"system_prompt":{"type":"string","minLength":1,"title":"System Prompt"},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message"},"voice_config":{"$ref":"#/components/schemas/VoiceConfigSchema"},"call_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Settings"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"mcp_servers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Mcp Servers"},"direction":{"type":"string","pattern":"^(inbound|outbound|both)$","title":"Direction","default":"outbound"},"capture_schema":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Capture Schema"},"call_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Control"},"post_call_actions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Post Call Actions"},"follow_up_rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Follow Up Rules"},"template_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Template Type"}},"additionalProperties":false,"type":"object","required":["name","system_prompt","voice_config"],"title":"AgentCreate","description":"Request body for creating an agent."},"AgentListResponse":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentResponse"},"type":"array","title":"Agents"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["agents","total"],"title":"AgentListResponse","description":"Paginated list of agents."},"AgentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"pipeline_type":{"$ref":"#/components/schemas/PipelineType"},"system_prompt":{"type":"string","title":"System Prompt"},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message"},"voice_config":{"additionalProperties":true,"type":"object","title":"Voice Config"},"call_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Settings"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"mcp_servers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Mcp Servers"},"direction":{"type":"string","title":"Direction"},"capture_schema":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Capture Schema"},"call_control":{"additionalProperties":true,"type":"object","title":"Call Control"},"post_call_actions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Post Call Actions"},"follow_up_rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Follow Up Rules"},"template_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Type"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","name","pipeline_type","system_prompt","first_message","voice_config","call_settings","tools","mcp_servers","direction","capture_schema","call_control","post_call_actions","follow_up_rules","template_type","is_active","created_at","updated_at"],"title":"AgentResponse","description":"Agent representation returned to clients."},"AgentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"pipeline_type":{"anyOf":[{"$ref":"#/components/schemas/PipelineType"},{"type":"null"}]},"system_prompt":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"System Prompt"},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/VoiceConfigSchema"},{"type":"null"}]},"call_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Settings"},"tools":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tools"},"mcp_servers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Mcp Servers"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"direction":{"anyOf":[{"type":"string","pattern":"^(inbound|outbound|both)$"},{"type":"null"}],"title":"Direction"},"capture_schema":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Capture Schema"},"call_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Control"},"post_call_actions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Post Call Actions"},"follow_up_rules":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Follow Up Rules"},"template_type":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Template Type"}},"additionalProperties":false,"type":"object","title":"AgentUpdate","description":"Request body for patching an agent. All fields optional."},"ApiKeyConnectRequest":{"properties":{"api_key":{"type":"string","title":"Api Key"},"config":{"additionalProperties":{"type":"string"},"type":"object","title":"Config","default":{}}},"type":"object","required":["api_key"],"title":"ApiKeyConnectRequest"},"ApiKeyCreateRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Human-readable key name"},"sandbox":{"type":"boolean","title":"Sandbox","description":"When True, the generated key gets the ``sk_test_`` prefix and requests authenticated with it hit sandbox mode: no real PSTN dials, no Stripe meter events, no production webhook delivery. Use sandbox keys for CI and local development. Production keys (``sandbox=False``) get the ``sk_live_`` prefix.","default":false}},"additionalProperties":false,"type":"object","required":["name"],"title":"ApiKeyCreateRequest","description":"Request body for creating an API key."},"ApiKeyCreateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"key_prefix":{"type":"string","title":"Key Prefix"},"key":{"type":"string","title":"Key","description":"Plaintext API key — store securely, shown only once. Pass as ``Authorization: Bearer <key>`` on every request. Prefix identifies mode: ``sk_live_…`` = production, ``sk_test_…`` = sandbox."},"sandbox":{"type":"boolean","title":"Sandbox"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","key_prefix","key","sandbox","created_at"],"title":"ApiKeyCreateResponse","description":"Response after creating an API key.\n\nThe plaintext ``key`` is returned exactly once and is never stored\nor retrievable again."},"AssignAgentRequest":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id","description":"Agent ID to assign, or null to unassign"}},"additionalProperties":false,"type":"object","title":"AssignAgentRequest"},"AvailableNumber":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"friendly_name":{"type":"string","title":"Friendly Name"},"locality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locality"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"capabilities":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Capabilities"}},"type":"object","required":["phone_number","friendly_name"],"title":"AvailableNumber"},"BlockIn":{"properties":{"metric_id":{"type":"string","title":"Metric Id"},"size":{"type":"string","enum":["sm","md","lg"],"title":"Size","default":"md"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["metric_id"],"title":"BlockIn"},"BlockOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"metric_id":{"type":"string","title":"Metric Id"},"size":{"type":"string","enum":["sm","md","lg"],"title":"Size"},"position":{"type":"integer","title":"Position"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["id","metric_id","size","position","config"],"title":"BlockOut"},"BlockPatch":{"properties":{"size":{"anyOf":[{"type":"string","enum":["sm","md","lg"]},{"type":"null"}],"title":"Size"},"position":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Position"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"}},"additionalProperties":false,"type":"object","title":"BlockPatch","description":"Patch shape for a single block. All fields optional."},"BlockResult":{"properties":{"block_id":{"type":"string","format":"uuid","title":"Block Id"},"metric_id":{"type":"string","title":"Metric Id"},"size":{"type":"string","enum":["sm","md","lg"],"title":"Size"},"position":{"type":"integer","title":"Position"},"result":{"anyOf":[{"$ref":"#/components/schemas/MetricResult"},{"type":"null"}]},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error"},"computed_at":{"type":"string","format":"date-time","title":"Computed At"}},"type":"object","required":["block_id","metric_id","size","position","computed_at"],"title":"BlockResult"},"BoardDataResponse":{"properties":{"board":{"$ref":"#/components/schemas/BoardOut"},"blocks":{"items":{"$ref":"#/components/schemas/BlockResult"},"type":"array","title":"Blocks"}},"type":"object","required":["board","blocks"],"title":"BoardDataResponse"},"BoardFilters":{"properties":{"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"direction":{"anyOf":[{"type":"string","enum":["inbound","outbound"]},{"type":"null"}],"title":"Direction"}},"type":"object","title":"BoardFilters"},"BoardIn":{"properties":{"title":{"type":"string","title":"Title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"shared":{"type":"boolean","title":"Shared","default":false},"range":{"$ref":"#/components/schemas/DateRange"},"filters":{"$ref":"#/components/schemas/BoardFilters"}},"type":"object","required":["title","range"],"title":"BoardIn"},"BoardOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"owner_id":{"type":"string","title":"Owner Id"},"shared":{"type":"boolean","title":"Shared"},"range_kind":{"type":"string","enum":["today","last_7_days","last_30_days","last_90_days","month_to_date","quarter_to_date","custom"],"title":"Range Kind"},"range_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Range Start"},"range_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Range End"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"},"blocks":{"items":{"$ref":"#/components/schemas/BlockOut"},"type":"array","title":"Blocks"},"pinned":{"type":"boolean","title":"Pinned","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","slug","title","subtitle","owner_id","shared","range_kind","range_start","range_end","filters","blocks","created_at","updated_at"],"title":"BoardOut"},"BoardPatch":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Title"},"subtitle":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Subtitle"},"shared":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shared"},"range":{"anyOf":[{"$ref":"#/components/schemas/DateRange"},{"type":"null"}]},"filters":{"anyOf":[{"$ref":"#/components/schemas/BoardFilters"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"BoardPatch","description":"Patch shape for board metadata. All fields optional."},"Body_upload_csv_campaign_api_v1_campaigns_upload_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"}},"type":"object","title":"Body_upload_csv_campaign_api_v1_campaigns_upload_post"},"CSVUploadResponse":{"properties":{"campaign_id":{"type":"string","format":"uuid","title":"Campaign Id"},"campaign_name":{"type":"string","title":"Campaign Name"},"total_contacts":{"type":"integer","title":"Total Contacts"},"valid_contacts":{"type":"integer","title":"Valid Contacts"},"invalid_contacts":{"type":"integer","title":"Invalid Contacts"},"errors":{"items":{"$ref":"#/components/schemas/CSVValidationError"},"type":"array","title":"Errors"}},"type":"object","required":["campaign_id","campaign_name","total_contacts","valid_contacts","invalid_contacts","errors"],"title":"CSVUploadResponse"},"CSVValidationError":{"properties":{"row":{"type":"integer","title":"Row"},"field":{"type":"string","title":"Field"},"message":{"type":"string","title":"Message"}},"type":"object","required":["row","field","message"],"title":"CSVValidationError"},"CallCreate":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"to_number":{"type":"string","maxLength":20,"minLength":10,"pattern":"^\\+?[1-9]\\d{9,14}$","title":"To Number","description":"Destination phone number in E.164 format"},"from_number":{"type":"string","maxLength":20,"minLength":10,"pattern":"^\\+?[1-9]\\d{9,14}$","title":"From Number","description":"Caller ID phone number in E.164 format"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional metadata to attach to the call"}},"additionalProperties":false,"type":"object","required":["agent_id","to_number","from_number"],"title":"CallCreate","description":"Request body for initiating an outbound call."},"CallCreateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/CallStatus"},"message":{"type":"string","title":"Message"}},"type":"object","required":["id","status","message"],"title":"CallCreateResponse","description":"Response after initiating a call."},"CallDetailResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"campaign_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Name"},"direction":{"type":"string","title":"Direction"},"from_number":{"type":"string","title":"From Number"},"to_number":{"type":"string","title":"To Number"},"status":{"type":"string","title":"Status"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"analysis_status":{"type":"string","title":"Analysis Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Outcome Score"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"extracted_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted Data"},"scorecard":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Scorecard"},"transcript":{"anyOf":[{"$ref":"#/components/schemas/TranscriptDetail"},{"type":"null"}]},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallDetail"},"type":"array","title":"Tool Calls"},"metrics":{"anyOf":[{"$ref":"#/components/schemas/CallMetricsDetail"},{"type":"null"}]},"recording":{"$ref":"#/components/schemas/RecordingInfo"}},"type":"object","required":["id","tenant_id","agent_id","agent_name","campaign_id","campaign_name","direction","from_number","to_number","status","error_message","started_at","ended_at","duration_seconds","analysis_status","outcome","outcome_score","summary","extracted_data","scorecard","transcript","tool_calls","metrics","recording"],"title":"CallDetailResponse","description":"Full call detail: metadata + transcript + tool calls + metrics + analysis."},"CallDirection":{"type":"string","enum":["outbound","inbound"],"title":"CallDirection"},"CallListResponse":{"properties":{"calls":{"items":{"$ref":"#/components/schemas/CallResponse"},"type":"array","title":"Calls"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["calls"],"title":"CallListResponse","description":"Paginated list of calls.\n\nSupports both offset-based pagination (``total`` field) and cursor-based\npagination (``next_cursor``). Cursor pagination is O(1) and recommended for\nlarge result sets; pass ``cursor=<next_cursor>`` in the next request."},"CallMetricsDetail":{"properties":{"turns":{"type":"integer","title":"Turns"},"interruptions":{"type":"integer","title":"Interruptions"},"connect_time_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Connect Time Ms"},"stt_ttfb_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stt Ttfb Ms"},"llm_ttft_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Ttft Ms"},"tts_ttfb_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tts Ttfb Ms"},"tokens_prompt":{"type":"integer","title":"Tokens Prompt"},"tokens_completion":{"type":"integer","title":"Tokens Completion"},"tts_characters":{"type":"integer","title":"Tts Characters"},"cost_stt_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Stt Usd"},"cost_llm_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Llm Usd"},"cost_tts_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Tts Usd"},"cost_telephony_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Telephony Usd"},"cost_total_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Total Usd"},"pipeline_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Type"},"providers":{"additionalProperties":{"type":"string"},"type":"object","title":"Providers"}},"type":"object","required":["turns","interruptions","connect_time_ms","stt_ttfb_ms","llm_ttft_ms","tts_ttfb_ms","tokens_prompt","tokens_completion","tts_characters","cost_stt_usd","cost_llm_usd","cost_tts_usd","cost_telephony_usd","cost_total_usd","pipeline_type","providers"],"title":"CallMetricsDetail","description":"Aggregated call performance metrics."},"CallResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"direction":{"$ref":"#/components/schemas/CallDirection"},"status":{"$ref":"#/components/schemas/CallStatus"},"from_number":{"type":"string","title":"From Number"},"to_number":{"type":"string","title":"To Number"},"provider_call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Call Sid"},"telephony_provider":{"type":"string","title":"Telephony Provider"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"extra":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"analysis_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Outcome Score"}},"type":"object","required":["id","tenant_id","agent_id","direction","status","from_number","to_number","provider_call_sid","telephony_provider","duration_seconds","recording_url","extra","error_message","started_at","ended_at","created_at","updated_at"],"title":"CallResponse","description":"Call representation returned to clients."},"CallStatus":{"type":"string","enum":["queued","compliance_blocked","ringing","in_progress","transferring","completed","failed","busy","no_answer","canceled","voicemail"],"title":"CallStatus"},"CallTransfer":{"properties":{"transfer_to":{"type":"string","maxLength":20,"minLength":10,"pattern":"^\\+?[1-9]\\d{9,14}$","title":"Transfer To","description":"Phone number to transfer the call to"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason","description":"Reason for transfer"}},"additionalProperties":false,"type":"object","required":["transfer_to"],"title":"CallTransfer","description":"Request body for transferring a call to a human."},"CallTransferResponse":{"properties":{"call_id":{"type":"string","format":"uuid","title":"Call Id"},"transfer_to":{"type":"string","title":"Transfer To"},"status":{"type":"string","title":"Status"}},"type":"object","required":["call_id","transfer_to","status"],"title":"CallTransferResponse","description":"Response after initiating a call transfer."},"CampaignContactListResponse":{"properties":{"contacts":{"items":{"$ref":"#/components/schemas/CampaignContactResponse"},"type":"array","title":"Contacts"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["contacts","total"],"title":"CampaignContactListResponse"},"CampaignContactResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"phone_number":{"type":"string","title":"Phone Number"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Contact Data"},"status":{"type":"string","title":"Status"},"attempt_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Attempt Count"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"call_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Call Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","phone_number","contact_name","contact_data","status","attempt_count","error_message","call_id","created_at"],"title":"CampaignContactResponse"},"CampaignCreate":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"contacts":{"items":{"$ref":"#/components/schemas/ContactInput"},"type":"array","minItems":1,"title":"Contacts"},"max_concurrent":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Max Concurrent"},"calls_per_minute":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":1.0},{"type":"null"}],"title":"Calls Per Minute"},"caller_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Caller Id"},"scheduled_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Start"},"goal_description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Goal Description"},"outcome_labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outcome Labels"},"extraction_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extraction Schema"},"analysis_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Prompt"}},"additionalProperties":false,"type":"object","required":["agent_id","name","contacts"],"title":"CampaignCreate","description":"Request body for creating a campaign with contacts."},"CampaignCreateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"total_contacts":{"type":"integer","title":"Total Contacts"}},"type":"object","required":["id","name","status","total_contacts"],"title":"CampaignCreateResponse","description":"Response after creating a campaign."},"CampaignCriteriaUpdate":{"properties":{"goal_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal Description"},"outcome_labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outcome Labels"},"extraction_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extraction Schema"},"analysis_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Prompt"}},"additionalProperties":false,"type":"object","title":"CampaignCriteriaUpdate","description":"Request body for updating campaign success criteria."},"CampaignListResponse":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/CampaignResponse"},"type":"array","title":"Campaigns"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["campaigns"],"title":"CampaignListResponse","description":"Paginated list of campaigns.\n\nSupports both offset-based (``total``) and cursor-based (``next_cursor``)\npagination. Cursor is O(1) and preferred for large lists."},"CampaignResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"max_concurrent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Concurrent"},"calls_per_minute":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Per Minute"},"caller_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Caller Id"},"total_contacts":{"type":"integer","title":"Total Contacts"},"completed_count":{"type":"integer","title":"Completed Count"},"connected_count":{"type":"integer","title":"Connected Count"},"failed_count":{"type":"integer","title":"Failed Count"},"scheduled_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled Start"},"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"},"paused_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paused At"},"goal_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal Description"},"outcome_labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outcome Labels"},"extraction_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extraction Schema"},"analysis_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Prompt"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","agent_id","name","status","max_concurrent","calls_per_minute","caller_id","total_contacts","completed_count","connected_count","failed_count","scheduled_start","started_at","completed_at","paused_at","created_at","updated_at"],"title":"CampaignResponse","description":"Campaign representation returned to clients."},"CampaignTransitionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["id","status","message"],"title":"CampaignTransitionResponse","description":"Response after a state transition."},"CaptureFieldSchema":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["string","number","boolean","date","enum"],"title":"Type"},"description":{"type":"string","title":"Description"},"required":{"type":"boolean","title":"Required"},"values":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Values"}},"additionalProperties":false,"type":"object","required":["name","type","description","required"],"title":"CaptureFieldSchema"},"CatalogResponse":{"properties":{"metrics":{"items":{"$ref":"#/components/schemas/Metric"},"type":"array","title":"Metrics"}},"type":"object","required":["metrics"],"title":"CatalogResponse"},"CheckoutRequest":{"properties":{"plan":{"type":"string","enum":["starter","growth","scale"],"title":"Plan","description":"Plan slug: starter | growth | scale"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url","description":"Override for the post-success redirect URL."},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url","description":"Override for the cancel redirect URL."}},"type":"object","required":["plan"],"title":"CheckoutRequest"},"CheckoutResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"CheckoutResponse"},"ComplianceCheckRequest":{"properties":{"phone_number":{"type":"string","maxLength":20,"minLength":10,"title":"Phone Number","description":"Phone number in E.164 format"}},"additionalProperties":false,"type":"object","required":["phone_number"],"title":"ComplianceCheckRequest","description":"Request body for a single-number compliance check."},"ComplianceCheckResponse":{"properties":{"verdict":{"type":"string","title":"Verdict","description":"ALLOW or DENY"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"checks":{"additionalProperties":true,"type":"object","title":"Checks","description":"Detailed per-check results: dnc, tcpa_hours, consent."},"checked_at":{"type":"string","format":"date-time","title":"Checked At"}},"type":"object","required":["verdict","checks","checked_at"],"title":"ComplianceCheckResponse","description":"Result of a compliance check against a single phone number."},"ConfirmRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"code":{"type":"string","maxLength":10,"minLength":4,"title":"Code"}},"type":"object","required":["phone_number","code"],"title":"ConfirmRequest"},"ConfirmResponse":{"properties":{"phone_e164":{"type":"string","title":"Phone E164"},"approved":{"type":"boolean","title":"Approved"},"status":{"type":"string","title":"Status"}},"type":"object","required":["phone_e164","approved","status"],"title":"ConfirmResponse"},"ConnectResponse":{"properties":{"redirect_url":{"type":"string","title":"Redirect Url"}},"type":"object","required":["redirect_url"],"title":"ConnectResponse"},"ContactInput":{"properties":{"phone_number":{"type":"string","maxLength":20,"minLength":10,"title":"Phone Number","description":"Contact phone number in E.164 format"},"contact_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Name"},"contact_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Contact Data"}},"additionalProperties":false,"type":"object","required":["phone_number"],"title":"ContactInput","description":"A single contact within a campaign creation request."},"ContactRescheduleRequest":{"properties":{"next_retry_at":{"type":"string","format":"date-time","title":"Next Retry At","description":"UTC timestamp when the campaign engine should re-attempt this contact."}},"additionalProperties":false,"type":"object","required":["next_retry_at"],"title":"ContactRescheduleRequest","description":"Body for manually rescheduling a contact dial."},"CredentialUpsert":{"properties":{"provider_slug":{"type":"string","maxLength":63,"minLength":1,"title":"Provider Slug","description":"Provider identifier, e.g. 'openai', 'twilio', 'elevenlabs'"},"api_key":{"type":"string","minLength":1,"title":"Api Key","description":"Provider API key (stored encrypted)"}},"additionalProperties":false,"type":"object","required":["provider_slug","api_key"],"title":"CredentialUpsert","description":"Request body for creating or updating a provider credential."},"DailyUsage":{"properties":{"date":{"type":"string","title":"Date"},"minutes":{"type":"integer","title":"Minutes"},"calls":{"type":"integer","title":"Calls"},"tokens":{"type":"integer","title":"Tokens"},"tts_characters":{"type":"integer","title":"Tts Characters"}},"type":"object","required":["date","minutes","calls","tokens","tts_characters"],"title":"DailyUsage"},"DateRange":{"properties":{"kind":{"type":"string","enum":["today","last_7_days","last_30_days","last_90_days","month_to_date","quarter_to_date","custom"],"title":"Kind"},"start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"}},"type":"object","required":["kind"],"title":"DateRange"},"DeliveryResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"webhook_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Webhook Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"url":{"type":"string","title":"Url"},"response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Status"},"attempt":{"type":"integer","title":"Attempt"},"status":{"type":"string","title":"Status"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["id","webhook_id","event_id","event_type","url","response_status","attempt","status","error","created_at","delivered_at"],"title":"DeliveryResponse"},"EventCatalogEntry":{"properties":{"event_type":{"type":"string","title":"Event Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["event_type","description"],"title":"EventCatalogEntry"},"EventCatalogResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EventCatalogEntry"},"type":"array","title":"Events"}},"type":"object","required":["events"],"title":"EventCatalogResponse"},"ExtractionField":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"description":{"type":"string","title":"Description"},"required":{"type":"boolean","title":"Required"}},"type":"object","required":["name","type","description","required"],"title":"ExtractionField"},"ExtractionSchema":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/ExtractionField"},"type":"array","title":"Fields"}},"type":"object","required":["fields"],"title":"ExtractionSchema"},"GenerateCriteriaRequest":{"properties":{"goal_description":{"type":"string","maxLength":1000,"minLength":10,"title":"Goal Description"},"agent_system_prompt":{"type":"string","maxLength":10000,"minLength":1,"title":"Agent System Prompt"}},"additionalProperties":false,"type":"object","required":["goal_description","agent_system_prompt"],"title":"GenerateCriteriaRequest","description":"Request body for generating campaign success criteria from a natural language goal."},"GenerateCriteriaResponse":{"properties":{"outcome_labels":{"items":{"type":"string"},"type":"array","title":"Outcome Labels"},"extraction_schema":{"$ref":"#/components/schemas/ExtractionSchema"},"analysis_prompt":{"type":"string","title":"Analysis Prompt"}},"type":"object","required":["outcome_labels","extraction_schema","analysis_prompt"],"title":"GenerateCriteriaResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HangupRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","title":"HangupRequest"},"IceServerResponse":{"properties":{"urls":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}],"title":"Urls"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"credential":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credential"}},"type":"object","required":["urls"],"title":"IceServerResponse","description":"ICE server configuration (STUN or TURN) for WebRTC connectivity."},"InferCaptureRequest":{"properties":{"role":{"type":"string","maxLength":4000,"minLength":10,"title":"Role"}},"additionalProperties":false,"type":"object","required":["role"],"title":"InferCaptureRequest"},"InferCaptureResponse":{"properties":{"fields":{"items":{"$ref":"#/components/schemas/CaptureFieldSchema"},"type":"array","title":"Fields"}},"type":"object","required":["fields"],"title":"InferCaptureResponse"},"InsightListResponse":{"properties":{"insights":{"items":{"$ref":"#/components/schemas/InsightOut"},"type":"array","title":"Insights"}},"type":"object","required":["insights"],"title":"InsightListResponse"},"InsightOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kind":{"type":"string","title":"Kind"},"severity":{"type":"string","enum":["low","medium","high"],"title":"Severity"},"campaign_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Campaign Id"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"},"detected_at":{"type":"string","format":"date-time","title":"Detected At"},"metric_snapshot":{"additionalProperties":true,"type":"object","title":"Metric Snapshot"},"rule_version":{"type":"string","title":"Rule Version"}},"type":"object","required":["id","kind","severity","campaign_id","agent_id","title","body","narrative","detected_at","metric_snapshot","rule_version"],"title":"InsightOut","description":"Wire shape returned by ``GET /api/v1/insights``."},"IntegrationInfo":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"icon":{"type":"string","title":"Icon"},"category":{"type":"string","title":"Category"},"available":{"type":"boolean","title":"Available"},"auth_type":{"type":"string","title":"Auth Type"},"extra_fields":{"items":{"type":"string"},"type":"array","title":"Extra Fields","default":[]},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"external_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Account Id"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"connected_at":{"anyOf":[{},{"type":"null"}],"title":"Connected At"}},"type":"object","required":["slug","name","icon","category","available","auth_type"],"title":"IntegrationInfo"},"InvitationResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","role","status","expires_at","created_at"],"title":"InvitationResponse"},"InviteRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","pattern":"^(admin|agent_operator|member)$","title":"Role","default":"member"}},"additionalProperties":false,"type":"object","required":["email"],"title":"InviteRequest"},"MemberResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"role":{"type":"string","title":"Role"},"is_active":{"type":"boolean","title":"Is Active"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","display_name","role","is_active","last_login_at","created_at"],"title":"MemberResponse"},"Metric":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"category":{"type":"string","title":"Category"},"viz":{"type":"string","enum":["kpi","line","bar","donut","segments","table"],"title":"Viz"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"}},"type":"object","required":["id","label","category","viz"],"title":"Metric"},"MetricResult":{"properties":{"viz":{"type":"string","enum":["kpi","line","bar","donut","segments","table"],"title":"Viz"},"value":{"title":"Value"}},"type":"object","required":["viz","value"],"title":"MetricResult"},"MetricsResponse":{"properties":{"turns":{"type":"integer","title":"Turns","default":0},"interruptions":{"type":"integer","title":"Interruptions","default":0},"stt_ttfb_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stt Ttfb Ms"},"llm_ttft_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Ttft Ms"},"tts_ttfb_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tts Ttfb Ms"},"tokens_prompt":{"type":"integer","title":"Tokens Prompt","default":0},"tokens_completion":{"type":"integer","title":"Tokens Completion","default":0},"tts_characters":{"type":"integer","title":"Tts Characters","default":0},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd","default":0.0}},"type":"object","title":"MetricsResponse"},"NudgePreset":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"label":{"type":"string","maxLength":50,"minLength":1,"title":"Label"},"prompt":{"type":"string","maxLength":500,"minLength":1,"title":"Prompt"}},"additionalProperties":false,"type":"object","required":["label","prompt"],"title":"NudgePreset","description":"One nudge preset stored in ``agents.nudge_presets``."},"NudgePresetsResponse":{"properties":{"presets":{"items":{"$ref":"#/components/schemas/NudgePreset"},"type":"array","title":"Presets"}},"type":"object","required":["presets"],"title":"NudgePresetsResponse"},"NudgeRequest":{"properties":{"preset_id":{"type":"string","format":"uuid","title":"Preset Id"}},"additionalProperties":false,"type":"object","required":["preset_id"],"title":"NudgeRequest"},"OperatorActionListResponse":{"properties":{"actions":{"items":{"$ref":"#/components/schemas/OperatorActionOut"},"type":"array","title":"Actions"}},"type":"object","required":["actions"],"title":"OperatorActionListResponse"},"OperatorActionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"call_id":{"type":"string","format":"uuid","title":"Call Id"},"user_id":{"type":"string","title":"User Id"},"kind":{"type":"string","title":"Kind"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"created_at":{"title":"Created At"}},"type":"object","required":["id","tenant_id","call_id","user_id","kind","payload","created_at"],"title":"OperatorActionOut"},"OverviewResponse":{"properties":{"primary_outcomes_total":{"type":"integer","title":"Primary Outcomes Total"},"primary_outcomes_7d":{"type":"integer","title":"Primary Outcomes 7D"},"primary_outcomes_prev_7d":{"type":"integer","title":"Primary Outcomes Prev 7D"},"total_calls_7d":{"type":"integer","title":"Total Calls 7D"},"total_spend_usd_7d":{"type":"number","title":"Total Spend Usd 7D"},"cost_per_primary_outcome_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per Primary Outcome Usd"},"connected_7d":{"type":"integer","title":"Connected 7D"},"transferred_7d":{"type":"integer","title":"Transferred 7D"},"reach_rate_7d":{"type":"number","title":"Reach Rate 7D"},"active_campaigns":{"type":"integer","title":"Active Campaigns"},"seconds_to_first_test_call":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds To First Test Call"},"seconds_to_first_real_call":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds To First Real Call"}},"type":"object","required":["primary_outcomes_total","primary_outcomes_7d","primary_outcomes_prev_7d","total_calls_7d","total_spend_usd_7d","cost_per_primary_outcome_usd","connected_7d","transferred_7d","reach_rate_7d","active_campaigns","seconds_to_first_test_call","seconds_to_first_real_call"],"title":"OverviewResponse"},"PhoneNumberListResponse":{"properties":{"numbers":{"items":{"$ref":"#/components/schemas/PhoneNumberResponse"},"type":"array","title":"Numbers"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["numbers","total"],"title":"PhoneNumberListResponse"},"PhoneNumberResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"number_e164":{"type":"string","title":"Number E164"},"friendly_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Friendly Name"},"provider":{"type":"string","title":"Provider"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"capabilities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capabilities"},"assigned_agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assigned Agent Id"},"created_at":{"title":"Created At"}},"type":"object","required":["id","number_e164","friendly_name","provider","country_code","capabilities","assigned_agent_id","created_at"],"title":"PhoneNumberResponse"},"PipelineType":{"type":"string","enum":["cascaded","realtime"],"title":"PipelineType"},"PortalResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"PortalResponse"},"ProviderCategory":{"type":"string","enum":["stt","llm","tts","realtime"],"title":"ProviderCategory"},"ProviderListResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/ProviderResponse"},"type":"array","title":"Providers"}},"type":"object","required":["providers"],"title":"ProviderListResponse","description":"List of available providers."},"ProviderModelListResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ProviderModelResponse"},"type":"array","title":"Models"}},"type":"object","required":["models"],"title":"ProviderModelListResponse","description":"List of models for a provider."},"ProviderModelResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"model_id":{"type":"string","title":"Model Id"},"display_name":{"type":"string","title":"Display Name"},"is_default":{"type":"boolean","title":"Is Default"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"pricing_input":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pricing Input"},"pricing_output":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pricing Output"},"pricing_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pricing Unit"},"latency_p50_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency P50 Ms"},"latency_p99_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency P99 Ms"},"supported_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Supported Params"}},"type":"object","required":["id","model_id","display_name","is_default","is_enabled","pricing_input","pricing_output","pricing_unit","latency_p50_ms","latency_p99_ms","supported_params"],"title":"ProviderModelResponse","description":"Model available for a provider."},"ProviderResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"category":{"$ref":"#/components/schemas/ProviderCategory"},"slug":{"type":"string","title":"Slug"},"display_name":{"type":"string","title":"Display Name"},"is_enabled":{"type":"boolean","title":"Is Enabled"}},"type":"object","required":["id","category","slug","display_name","is_enabled"],"title":"ProviderResponse","description":"Provider catalog entry."},"ProviderVoiceListResponse":{"properties":{"voices":{"items":{"$ref":"#/components/schemas/ProviderVoiceResponse"},"type":"array","title":"Voices"}},"type":"object","required":["voices"],"title":"ProviderVoiceListResponse","description":"List of voices for a provider."},"ProviderVoiceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"voice_id":{"type":"string","title":"Voice Id"},"display_name":{"type":"string","title":"Display Name"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"style_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Style Tags"},"language_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Language Codes"},"is_default":{"type":"boolean","title":"Is Default"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"}},"type":"object","required":["id","voice_id","display_name","gender","style_tags","language_codes","is_default","is_enabled","preview_url"],"title":"ProviderVoiceResponse","description":"Voice available for a provider."},"ProvisionRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number","description":"E.164 phone number to purchase"},"friendly_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Friendly Name"},"provider":{"type":"string","title":"Provider","description":"Telephony provider: 'twilio' or 'telnyx'","default":"twilio"}},"additionalProperties":false,"type":"object","required":["phone_number"],"title":"ProvisionRequest"},"RecordingInfo":{"properties":{"available":{"type":"boolean","title":"Available"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format"}},"type":"object","required":["available"],"title":"RecordingInfo","description":"Recording availability metadata (not the URL — fetch that separately)."},"RecordingUrlResponse":{"properties":{"url":{"type":"string","title":"Url"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["url","expires_at"],"title":"RecordingUrlResponse","description":"Short-lived signed URL for recording playback."},"StartRequest":{"properties":{"phone_number":{"type":"string","maxLength":32,"minLength":5,"title":"Phone Number","description":"Phone number to verify. Any parseable format; normalized to E.164."},"channel":{"type":"string","enum":["sms","call"],"title":"Channel","description":"How to deliver the code. 'call' is required for pure voice stacks.","default":"sms"}},"type":"object","required":["phone_number"],"title":"StartRequest"},"StartResponse":{"properties":{"phone_e164":{"type":"string","title":"Phone E164"},"status":{"type":"string","title":"Status"},"channel":{"type":"string","title":"Channel"}},"type":"object","required":["phone_e164","status","channel"],"title":"StartResponse"},"TeamListResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/MemberResponse"},"type":"array","title":"Members"},"invitations":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Invitations"}},"type":"object","required":["members","invitations"],"title":"TeamListResponse"},"TestCallRequest":{"properties":{"to_number":{"type":"string","title":"To Number","description":"Phone number to call (your own number for testing)"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number","description":"Caller ID. If omitted, uses first tenant number."}},"additionalProperties":false,"type":"object","required":["to_number","agent_id"],"title":"TestCallRequest"},"TestFireRequest":{"properties":{"event_type":{"type":"string","enum":["call.started","call.completed","call.failed","call.hangup","call.transferred","transcript.ready","recording.ready","analysis.ready","campaign.started","campaign.completed","campaign.contact.completed","agent.activated","agent.deactivated","usage.credit_exhausted","usage.daily_cap_approaching"],"title":"Event Type","default":"call.completed"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"Arbitrary payload echoed back in the 'data' field."}},"additionalProperties":false,"type":"object","title":"TestFireRequest"},"TestSessionListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"mode":{"type":"string","title":"Mode"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"analysis_status":{"type":"string","title":"Analysis Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","mode","agent_id","outcome","duration_seconds","analysis_status","created_at"],"title":"TestSessionListItem"},"TestSessionListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/TestSessionListItem"},"type":"array","title":"Sessions"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["sessions","total"],"title":"TestSessionListResponse"},"TestSessionResult":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"mode":{"type":"string","title":"Mode"},"pipeline_type":{"type":"string","title":"Pipeline Type"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"analysis_status":{"type":"string","title":"Analysis Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Outcome Score"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"transcript":{"items":{"$ref":"#/components/schemas/TranscriptTurnResponse"},"type":"array","title":"Transcript"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallResponse"},"type":"array","title":"Tool Calls"},"metrics":{"$ref":"#/components/schemas/MetricsResponse"},"extracted_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted Data"},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"recording_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recording Duration Ms"},"voice_config_snapshot":{"additionalProperties":true,"type":"object","title":"Voice Config Snapshot"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"}},"type":"object","required":["id","mode","pipeline_type","agent_id","duration_seconds","analysis_status","outcome","outcome_score","summary","transcript","tool_calls","metrics","extracted_data","recording_url","recording_duration_ms","voice_config_snapshot","created_at","ended_at"],"title":"TestSessionResult"},"TextTestMessage":{"properties":{"message":{"type":"string","maxLength":4000,"minLength":1,"title":"Message"},"session_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Session Id","description":"Existing session ID for multi-turn conversation. Omit on first message to create a new session."}},"additionalProperties":false,"type":"object","required":["message"],"title":"TextTestMessage","description":"Request body for text mode test."},"ToolCallDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"args":{"additionalProperties":true,"type":"object","title":"Args"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"status":{"type":"string","title":"Status"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"source":{"type":"string","title":"Source"},"agent_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Message"}},"type":"object","required":["id","name","args","result","status","started_at","duration_ms","source"],"title":"ToolCallDetail","description":"A single tool execution during the call."},"ToolCallResponse":{"properties":{"name":{"type":"string","title":"Name"},"args":{"additionalProperties":true,"type":"object","title":"Args"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"},"status":{"type":"string","title":"Status"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"}},"type":"object","required":["name","args","status"],"title":"ToolCallResponse"},"TranscriptDetail":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/TranscriptTurnDetail"},"type":"array","title":"Turns"},"redacted":{"type":"boolean","title":"Redacted"}},"type":"object","required":["turns","redacted"],"title":"TranscriptDetail","description":"Full call transcript with redaction status."},"TranscriptTurnDetail":{"properties":{"speaker":{"type":"string","title":"Speaker"},"text":{"type":"string","title":"Text"},"timestamp_ms":{"type":"integer","title":"Timestamp Ms"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"}},"type":"object","required":["speaker","text","timestamp_ms"],"title":"TranscriptTurnDetail","description":"A single turn in the call transcript."},"TranscriptTurnResponse":{"properties":{"speaker":{"type":"string","title":"Speaker"},"text":{"type":"string","title":"Text"},"timestamp_ms":{"type":"integer","title":"Timestamp Ms"}},"type":"object","required":["speaker","text","timestamp_ms"],"title":"TranscriptTurnResponse"},"UpdateConfigRequest":{"properties":{"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["config"],"title":"UpdateConfigRequest"},"UpdateNudgePresetsRequest":{"properties":{"presets":{"items":{"$ref":"#/components/schemas/NudgePreset"},"type":"array","maxItems":20,"title":"Presets"}},"additionalProperties":false,"type":"object","title":"UpdateNudgePresetsRequest"},"UpdateRoleRequest":{"properties":{"role":{"type":"string","pattern":"^(owner|admin|agent_operator|member)$","title":"Role"}},"additionalProperties":false,"type":"object","required":["role"],"title":"UpdateRoleRequest"},"UsageSummary":{"properties":{"billing_plan":{"type":"string","title":"Billing Plan"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"total_minutes":{"type":"integer","title":"Total Minutes"},"total_calls":{"type":"integer","title":"Total Calls"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_tts_characters":{"type":"integer","title":"Total Tts Characters"},"estimated_cost_usd":{"type":"number","title":"Estimated Cost Usd"},"max_calls_per_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Calls Per Day"},"max_call_duration_sec":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Call Duration Sec"},"daily_usage":{"items":{"$ref":"#/components/schemas/DailyUsage"},"type":"array","title":"Daily Usage"}},"type":"object","required":["billing_plan","period_start","period_end","total_minutes","total_calls","total_tokens","total_tts_characters","estimated_cost_usd","max_calls_per_day","max_call_duration_sec","daily_usage"],"title":"UsageSummary","description":"Current billing period usage summary."},"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"},"VoiceConfigSchema":{"properties":{"stt":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stt"},"llm":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Llm"},"tts":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tts"},"realtime":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Realtime"},"vad":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Vad"},"telephony_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Telephony Provider"}},"additionalProperties":false,"type":"object","title":"VoiceConfigSchema","description":"Voice pipeline configuration.\n\nFor cascaded pipelines: requires stt, llm, and tts blocks.\nFor realtime pipelines: requires a realtime block."},"WebRTCSessionCreate":{"properties":{"session_id":{"type":"string","format":"uuid","title":"Session Id"},"webrtc_url":{"type":"string","title":"Webrtc Url","description":"Base URL for Pipecat's /offer endpoint"},"ice_servers":{"items":{"$ref":"#/components/schemas/IceServerResponse"},"type":"array","title":"Ice Servers","description":"ICE servers (STUN + TURN) for WebRTC connectivity"}},"additionalProperties":false,"type":"object","required":["session_id","webrtc_url"],"title":"WebRTCSessionCreate","description":"Response for creating a WebRTC test session."},"WebhookConfigRequest":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"}},"type":"object","required":["url"],"title":"WebhookConfigRequest","description":"Configure webhook URL for real-time event delivery."},"WebhookConfigResponse":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"}},"type":"object","required":["url","secret"],"title":"WebhookConfigResponse","description":"Current webhook configuration."},"WebhookCreate":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types","description":"Event types to subscribe to. '*' means all events. Supported: call.started, call.completed, call.failed, call.hangup, call.transferred, transcript.ready, recording.ready, analysis.ready, campaign.started, campaign.completed, campaign.contact.completed, agent.activated, agent.deactivated, usage.credit_exhausted, usage.daily_cap_approaching."},"sandbox":{"type":"boolean","title":"Sandbox","description":"If True, receives only events from sandbox (sk_test_) calls.","default":false}},"additionalProperties":false,"type":"object","required":["url"],"title":"WebhookCreate"},"WebhookCreateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"url":{"type":"string","title":"Url"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types"},"is_active":{"type":"boolean","title":"Is Active"},"sandbox":{"type":"boolean","title":"Sandbox"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"secret":{"type":"string","title":"Secret","description":"HMAC-SHA256 signing key. Returned ONCE. Store it — we don't show it again. Sign verification: hex(hmac_sha256(secret, f'{timestamp}.{body}')). The request header format is X-CallingScout-Signature: t=<unix_ts>,v1=<hex>."}},"type":"object","required":["id","url","event_types","is_active","sandbox","created_at","updated_at","secret"],"title":"WebhookCreateResponse","description":"On-create response — includes the signing secret exactly once."},"WebhookResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"url":{"type":"string","title":"Url"},"event_types":{"items":{"type":"string"},"type":"array","title":"Event Types"},"is_active":{"type":"boolean","title":"Is Active"},"sandbox":{"type":"boolean","title":"Sandbox"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","url","event_types","is_active","sandbox","created_at","updated_at"],"title":"WebhookResponse"},"WebhookUpdate":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url"},"event_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Event Types"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"additionalProperties":false,"type":"object","title":"WebhookUpdate"},"WhisperRequest":{"properties":{"text":{"type":"string","maxLength":280,"minLength":1,"title":"Text"}},"additionalProperties":false,"type":"object","required":["text"],"title":"WhisperRequest"},"WsSessionCreate":{"properties":{"session_id":{"type":"string","format":"uuid","title":"Session Id"},"stream_url":{"type":"string","title":"Stream Url","description":"WSS URL the browser should connect to"},"ws_token":{"type":"string","title":"Ws Token","description":"HMAC-signed token passed as ?t= query param"}},"additionalProperties":false,"type":"object","required":["session_id","stream_url","ws_token"],"title":"WsSessionCreate","description":"Response for creating a WebSocket test session."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}