{"openapi":"3.1.0","info":{"title":"Interactly API","description":"API for building interactly.ai services","version":"1.1.0","contact":{"name":"Interactly","url":"https://interactly.ai","email":"developers@interactly.ai"}},"servers":[{"url":"https://api-qa.interactly.ai","description":"API Server"}],"paths":{"/campaigns/v1/campaigns":{"post":{"tags":["Campaigns"],"summary":"Create Campaign","description":"Create a new campaign configuration.\n\nReturns the full campaign object on success.\nThe campaign starts in 'pending' status — use the `/action` endpoint to launch it.","operationId":"campaigns_service_create_campaigns_v1_campaigns_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenefitsVerificationConfigRequest"}}}},"responses":{"200":{"description":"Campaign created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDataResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]},"get":{"tags":["Campaigns"],"summary":"List Campaigns","description":"Fetch a paginated list of campaigns with optional filters.\n\n**Pagination parameters** (passed as query params):\n- **page**: Page number, 1-indexed (default: 1).\n- **size**: Items per page, max 200 (default: 50).\n- **search**: Search term matched against campaign name.\n- **start** / **end**: ISO 8601 date range filter on campaign creation date.\n\n**Filter parameters:**\n- **status**: Filter by campaign status. Possible values: pending, processing, paused, aborted, completed.\n- **source**: Filter by campaign source (e.g. 'internal', 'api').\n- **tags**: Repeat to filter by multiple tags: `?tags=region:west&tags=priority:high`.\n- **campaignType**: Filter by campaign type ('single' or 'multi').\n- **groupId**: Return only campaigns belonging to the specified group.\n- **runNumber**: Return only the campaign with this run number within its group.","operationId":"campaigns_service_get_campaigns_v1_campaigns_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source","title":"Source"},"description":"Filter by source"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by tags (format: key:value)","title":"Tags"},"description":"Filter by tags (format: key:value)"},{"name":"campaignType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by campaign type","title":"Campaigntype"},"description":"Filter by campaign type"},{"name":"groupId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by group ID","title":"Groupid"},"description":"Filter by group ID"},{"name":"runNumber","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by run number","title":"Runnumber"},"description":"Filter by run number"},{"name":"is_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"When true, return only soft-deleted campaigns","default":false,"title":"Is Deleted"},"description":"When true, return only soft-deleted campaigns"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Paginated list of campaigns","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignListResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}":{"patch":{"tags":["Campaigns"],"summary":"Update Campaign","description":"Partially update a campaign configuration.\n\nAccepts any subset of the campaign fields. Fields not included in the request body are left unchanged.\nReturns the full updated campaign object.","operationId":"campaigns_service_patch_campaign_with_id_v1_campaigns__campaign_id__patch","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Updated campaign configuration object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDataResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]},"get":{"tags":["Campaigns"],"summary":"Get Campaign","description":"Fetch a single campaign configuration by its ID.","operationId":"campaigns_service_get_campaign_by_id_v1_campaigns__campaign_id__get","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"}],"responses":{"200":{"description":"Campaign configuration object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDataResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]},"delete":{"tags":["Campaigns"],"summary":"Delete Campaign","description":"Delete a campaign and all of its associated call records.\n\n- Default (hard_delete=false): soft-delete — admin and super_admin.\n- hard_delete=true: permanent deletion — super_admin only.","operationId":"campaigns_service_delete_campaign_with_id_v1_campaigns__campaign_id__delete","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"hard_delete","in":"query","required":false,"schema":{"type":"boolean","description":"When true, permanently delete (super_admin only)","default":false,"title":"Hard Delete"},"description":"When true, permanently delete (super_admin only)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/action":{"post":{"tags":["Campaigns"],"summary":"Campaign Action","description":"Perform a lifecycle action on a campaign.\n\n- **launch**: Start processing calls. Campaign must be in 'pending' or 'paused' state.\n- **pause**: Suspend call processing. Campaign must be in 'processing' state.\n- **resume**: Resume a paused campaign.\n- **abort**: Cancel all pending/queued/ready calls and mark them as failed.","operationId":"campaigns_service_action_campaign_by_id_v1_campaigns__campaign_id__action_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/clone":{"post":{"tags":["Campaigns"],"summary":"Clone Campaign","description":"Clone a campaign configuration.\n\nCreates a new campaign with the same configuration as the source.\nCall records are copied in the background — use the `include_outcomes`, `exclude_outcomes`,\n`include_status`, and `exclude_status` body fields to control which calls are cloned.\nReturns immediately with the new `campaign_id`; call cloning continues asynchronously.","operationId":"campaigns_service_clone_campaign_by_id_v1_campaigns__campaign_id__clone_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID to clone"},"description":"Campaign configuration ID to clone"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCloneRequest"}}}},"responses":{"200":{"description":"Clone created — call records are cloned asynchronously in the background","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCloneResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/restore":{"post":{"tags":["Campaigns"],"summary":"Restore Campaign","description":"Restore a soft-deleted campaign and all of its associated call records.\n\nAdmins and super-admins can restore campaigns.","operationId":"campaigns_service_restore_campaign_with_id_v1_campaigns__campaign_id__restore_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/calls":{"post":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Upload Calls","description":"Upload a batch of call records to a campaign.\n\n**Request body:** A JSON array of call objects. Each object must include a `phone_number` field.\nAlong with optional `override_assistant_id`, `override_schedule` and `override_timezone` fields\nand you can include any additional fields relevant to the call (e.g. `patientId`, `insuranceId`, etc.).\nThese extra fields are dynamic variables from attached assistant or workflow and will be stored as part of the call record's payload for use in the campaign.\n\nCalls can be uploaded while the campaign is already running — they will be picked up automatically.\nReturns `202 Accepted` immediately; actual call processing happens asynchronously.","operationId":"campaigns_service_create_campaigns_calls_v1_campaigns__campaign_id__calls_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"202":{"description":"Calls accepted for processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCallsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"additionalProperties":true,"description":"One call record in an upload batch. Extra fields are stored as call payload.","properties":{"phone_number":{"description":"Target phone number (E.164 format recommended, e.g. '+12065551234')","title":"Phone Number","type":"string"},"override_assistant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Override the campaign's default AI assistant for this specific call","title":"Override Assistant Id"},"override_timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"IANA timezone override for this call's scheduling window (e.g. 'America/Chicago')","title":"Override Timezone"},"override_schedule":{"anyOf":[{"items":{"description":"Represents a schedule for processing calls.\nThis model includes the start and end times for the schedule,\nallowing for flexible scheduling of call processing.","properties":{"startAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Schedule start datetime","title":"Startat"},"endAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Schedule end datetime","title":"Endat"}},"title":"Schedule","type":"object"},"type":"array"},{"type":"null"}],"description":"Call window override — each entry has 'startAt' and 'endAt' as ISO 8601 strings","title":"Override Schedule"}},"required":["phone_number"],"title":"UploadCallItem","type":"object"}},"example":[{"phone_number":"+12065551234","override_timezone":"America/Chicago","patientId":"P-12345","insuranceId":"INS-67890"}]}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/calls/count":{"get":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Get Call Count","description":"Get the count of calls in a campaign, broken down by status.\n\n- **start** / **end**: Optional ISO 8601 date range to filter calls by creation date.\n- **search**: Optional search term to narrow the count.","operationId":"campaigns_service_get_campaigns_calls_count_v1_campaigns__campaign_id__calls_count_get","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Call counts broken down by status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallCountResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/calls/list":{"get":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"List Calls","description":"Fetch a paginated list of call records for a campaign.\n\n- **page** / **size**: Pagination (default: page=1, size=50, max size=200).\n- **start** / **end**: ISO 8601 date range filter on call creation date.\n- **status**: Filter by call status (received, ready, queued, ringing, processing, ended, completed, failed).\n- **search**: Search term matched against phone number or other call fields.\n- **outcomes**: Repeat to filter by multiple outcomes: `?outcomes=voicemail&outcomes=no_answer`.\n- **tags**: Repeat to filter by multiple tags: `?tags=region:west&tags=priority:high`.\n- **groupId**: When provided, returns calls across all campaign runs in the group.","operationId":"campaigns_service_get_campaigns_call_list_v1_campaigns__campaign_id__calls_list_get","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Call status","title":"Status"},"description":"Call status"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"outcomes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Outcome values to filter by","title":"Outcomes"},"description":"Outcome values to filter by"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by tags (format: key:value)","title":"Tags"},"description":"Filter by tags (format: key:value)"},{"name":"groupId","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by group ID","title":"Groupid"},"description":"Filter by group ID"},{"name":"is_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"When true, return only soft-deleted calls","default":false,"title":"Is Deleted"},"description":"When true, return only soft-deleted calls"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Paginated list of call records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCallListResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/calls/{call_id}":{"get":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Get Call","description":"Get a call by its ID in a campaign.\n- **campaign_id**: The ID of the campaign configuration.\n- **call_id**: The ID of the call to retrieve.","operationId":"campaigns_service_get_call_by_call_id_v1_campaigns__campaign_id__calls__call_id__get","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"call_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Call record ID"},"description":"Call record ID"}],"responses":{"200":{"description":"Call record object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCallDetailsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]},"patch":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Update Call","description":"Patch a call by its ID in a campaign.\n- **campaign_id**: The ID of the campaign configuration.\n- **call_id**: The ID of the call to patch.\n- **body**: The request body containing fields to update.","operationId":"campaigns_service_patch_call_by_call_id_v1_campaigns__campaign_id__calls__call_id__patch","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"call_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Call record ID"},"description":"Call record ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCallPatchRequest"}}}},"responses":{"200":{"description":"Updated call record object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCallDataResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]},"delete":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Delete Call","description":"Delete a call by its ID in a campaign.\n\n- Default (hard_delete=false): soft-delete.\n- hard_delete=true: permanent deletion — super_admin only.","operationId":"campaigns_service_delete_call_by_call_id_v1_campaigns__campaign_id__calls__call_id__delete","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"call_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Call record ID"},"description":"Call record ID"},{"name":"hard_delete","in":"query","required":false,"schema":{"type":"boolean","description":"When true, permanently delete (super_admin only)","default":false,"title":"Hard Delete"},"description":"When true, permanently delete (super_admin only)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{campaign_id}/calls/{call_id}/restore":{"post":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Restore Call","description":"Restore a soft-deleted call by its ID.\n\nAdmins and super-admins can restore calls.","operationId":"campaigns_service_restore_call_by_call_id_v1_campaigns__campaign_id__calls__call_id__restore_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"},{"name":"call_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Call record ID"},"description":"Call record ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{config_id}/calls/download":{"post":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Download Calls","description":"Download call records for a campaign as an exported file.\n\nUse the request body to filter which calls to include:\n- **start** / **end**: Date range filter.\n- **status**: Filter by call status.\n- **callIds**: Download only the specified call record IDs.\n- **search**: Filter by search term.","operationId":"campaigns_service_download_calls_route_v1_campaigns__config_id__calls_download_post","parameters":[{"name":"config_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadCallsBody"}}}},"responses":{"200":{"description":"Call records matching the filter criteria","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadCallsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/campaigns/{config_id}/calls/report":{"post":{"tags":["Campaigns Calls","Campaign Calls"],"summary":"Send Campaign Report Email","description":"Send the campaign summary report to the configured report email addresses.\n\nTriggers an email containing call outcome summaries and statistics for this campaign.\nThe report is sent to the addresses in `reportEmails` on the campaign configuration.","operationId":"campaigns_service_send_campaign_report_v1_campaigns__config_id__calls_report_post","parameters":[{"name":"config_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/schedule/calls":{"post":{"tags":["Campaign Bulk Calls","Bulk Calls"],"summary":"Create Campaign Calls Bulk","description":"Create a new campaign call configuration in bulk.\n- **body**: The campaign call configuration data.\n- **config**: Configuration options for the campaign call.\n- **data**: List of campaign call data to be processed in bulk.","operationId":"campaigns_service_create_campaigns_calls_v1_schedule_calls_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCampaignCallsRequest","description":"Campaign call configuration data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"202":{"description":"Batch accepted — campaign and calls created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateCallsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/insurance-calling/calls/{call_id}/status":{"get":{"tags":["Campaign Bulk Calls","Bulk Calls"],"summary":"Get Call Status by ID","description":"Get the status of a campaign call by its ID.\n- **call_id**: The ID of the campaign call to retrieve.","operationId":"campaigns_service_get_call_by_call_id_v1_insurance_calling_calls__call_id__status_get","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Campaign configuration ID"},"description":"Campaign configuration ID"}],"responses":{"200":{"description":"Call status record with resolved outcome and artifacts","content":{"application/json":{"schema":{"properties":{"record_id":{"description":"Call record ID","title":"Record Id","type":"string"},"status":{"description":"Resolved call status after applying review logic. Possible values: 'received', 'ready', 'queued', 'ringing', 'processing', 'ended', 'completed', 'failed', 'incomplete'","title":"Status","type":"string"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Error message when the call failed","title":"Failure Reason"},"input":{"additionalProperties":true,"description":"Decrypted call payload — the data submitted at upload time","title":"Input","type":"object"},"output":{"additionalProperties":true,"description":"Structured data collected by the AI assistant during the call","title":"Output","type":"object"},"phone_call_artifacts":{"properties":{"audio_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Signed URL for the call audio recording (valid 48 hours)","title":"Audio Uri"},"transcript_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Signed URL for the call transcript (valid 48 hours)","title":"Transcript Uri"}},"title":"PhoneCallArtifacts","type":"object","description":"Signed URLs for the call recording and transcript"}},"required":["record_id","status"],"title":"BulkCallStatusRecord","type":"object"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/insurance-calling/calls/status":{"post":{"tags":["Campaign Bulk Calls","Bulk Calls"],"summary":"Bulk Call Status","description":"Get the status of multiple campaign calls in bulk.\n- **callIds**: A list of campaign call IDs to retrieve statuses for.","operationId":"campaigns_service_bulk_call_status_v1_insurance_calling_calls_status_post","parameters":[],"responses":{"200":{"description":"Status records for each requested call ID","content":{"application/json":{"schema":{"type":"array","items":{"properties":{"record_id":{"description":"Call record ID","title":"Record Id","type":"string"},"status":{"description":"Resolved call status after applying review logic. Possible values: 'received', 'ready', 'queued', 'ringing', 'processing', 'ended', 'completed', 'failed', 'incomplete'","title":"Status","type":"string"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Error message when the call failed","title":"Failure Reason"},"input":{"additionalProperties":true,"description":"Decrypted call payload — the data submitted at upload time","title":"Input","type":"object"},"output":{"additionalProperties":true,"description":"Structured data collected by the AI assistant during the call","title":"Output","type":"object"},"phone_call_artifacts":{"properties":{"audio_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Signed URL for the call audio recording (valid 48 hours)","title":"Audio Uri"},"transcript_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Signed URL for the call transcript (valid 48 hours)","title":"Transcript Uri"}},"title":"PhoneCallArtifacts","type":"object","description":"Signed URLs for the call recording and transcript"}},"required":["record_id","status"],"title":"BulkCallStatusRecord","type":"object"}}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"callIds":{"type":"array","items":{"type":"string"},"description":"List of call record IDs to retrieve status for"}},"required":["callIds"]},"example":{"callIds":["64f1a2b3c4d5e6f7a8b9c0d1","64f1a2b3c4d5e6f7a8b9c0d2"]}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/campaigns/calls":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Campaign Call Stats","description":"Get aggregated call counts grouped by a chosen dimension.\n\n- **group_by**: Grouping dimension — `outcome` (default), `status`, `status_outcome`, or `tag`.\n- **campaign_id**: Scope stats to a single campaign.\n- **statuses**: Repeat to filter by multiple statuses: `?statuses=completed&statuses=failed`.\n- **outcomes**: Repeat to filter by multiple outcomes: `?outcomes=voicemail&outcomes=conveyed`.\n- **tags**: Filter tag-grouped results by substring match against tag strings.\n- **start** / **end**: ISO 8601 date range filter applied to call creation date.","operationId":"campaigns_service_get_campaign_call_stats_v1_stats_campaigns_calls_get","parameters":[{"name":"group_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/StatsGroupBy","description":"Grouping criteria: outcome, status, status_outcome, tag","default":"outcome"},"description":"Grouping criteria: outcome, status, status_outcome, tag"},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PydanticObjectId"},{"type":"null"}],"description":"Filter by campaign ID","title":"Campaign Id"},"description":"Filter by campaign ID"},{"name":"statuses","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by one or more call statuses","title":"Statuses"},"description":"Filter by one or more call statuses"},{"name":"outcomes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by one or more outcomes","title":"Outcomes"},"description":"Filter by one or more outcomes"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter tag stats by tag strings (substring match)","title":"Tags"},"description":"Filter tag stats by tag strings (substring match)"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Aggregated call counts grouped by the chosen dimension","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/campaigns/tags":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Campaign Tags","description":"Get all distinct tags used across campaigns and their calls.\n\n- **campaign_id**: Scope results to a single campaign and its calls.\n- **tags**: Filter results by substring match against tag strings.","operationId":"campaigns_service_get_campaign_and_calls_tags_v1_stats_campaigns_tags_get","parameters":[{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PydanticObjectId"},{"type":"null"}],"description":"Scope to a specific campaign","title":"Campaign Id"},"description":"Scope to a specific campaign"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter tag stats by tag strings (substring match)","title":"Tags"},"description":"Filter tag stats by tag strings (substring match)"}],"responses":{"200":{"description":"Distinct tags with occurrence counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/campaigns":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Campaign Stats","description":"Get aggregated campaign counts grouped by a chosen dimension.\n\n- **group_by**: Grouping dimension — `status` (default), `source`, or `campaignType`.\n- **statuses**: Repeat to filter by multiple statuses: `?statuses=completed&statuses=processing`.\n- **tags**: Filter tag-grouped results by substring match.\n- **start** / **end**: ISO 8601 date range filter applied to campaign creation date.","operationId":"campaigns_service_get_campaign_stats_v1_stats_campaigns_get","parameters":[{"name":"group_by","in":"query","required":false,"schema":{"$ref":"#/components/schemas/StatsGroupBy","description":"Grouping criteria: status, source, campaignType","default":"status"},"description":"Grouping criteria: status, source, campaignType"},{"name":"statuses","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by one or more campaign statuses","title":"Statuses"},"description":"Filter by one or more campaign statuses"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter tag stats by tag strings (substring match)","title":"Tags"},"description":"Filter tag stats by tag strings (substring match)"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Aggregated campaign counts grouped by the chosen dimension","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/outcomes":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Conversation Outcome Stats","description":"Get conversation counts grouped by outcome value.\n\n- **start** / **end**: ISO 8601 date range filter applied to conversation start time.\n\nConversations with a missing, null, or empty outcome are grouped under `no-outcome-recorded`.","operationId":"campaigns_service_get_conversation_outcome_stats_v1_stats_outcomes_get","parameters":[{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Conversation counts grouped by outcome value","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawOutcomeStatsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/frequent-callers":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Frequent Callers Stats","description":"Get phone numbers that placed more than one call within the given date range.\n\n- **start** / **end**: ISO 8601 date range filter applied to conversation start/end time.\n\nWeb calls (`callType=\"web\"`) and conversations with no recorded `userNumber` are\nexcluded. Results are sorted by call count, descending.","operationId":"campaigns_service_get_frequent_callers_stats_v1_stats_frequent_callers_get","parameters":[{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Phone numbers that called more than once, grouped by userNumber","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrequentCallersStatsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/outcomes/{template}":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Conversation Outcome Mapping Stats","description":"Get conversation counts bucketed by outcome category and sub category,\nbased on the team's configured outcome mapping for the given template.\n\n- **template**: Outcome mapping template to bucket outcomes by.\n- **start** / **end**: ISO 8601 date range filter applied to conversation start time.\n\nReturns an empty list if the team has no outcome mapping configured yet.","operationId":"campaigns_service_get_conversation_outcome_mapping_stats_v1_stats_outcomes__template__get","parameters":[{"name":"template","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Templates","description":"Outcome mapping template to bucket outcomes by"},"description":"Outcome mapping template to bucket outcomes by"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Conversation counts grouped by outcome category and sub category","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeStatsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/stats/outcomes/{template}/trends":{"get":{"tags":["Campaign Stats","Stats"],"summary":"Conversation Outcome Mapping Trends","description":"Get conversation outcome category / sub category counts over time, split into\ncontiguous windows so the result can be rendered as a trend/bar chart.\n\nThe window size is derived from the requested period:\n- **≤ 2 days** → 6-hour windows\n- **≤ 14 days** → daily windows\n- **≤ ~1 month** → weekly windows\n- **> 1 month** → monthly windows\n\n- **template**: Outcome mapping template to bucket outcomes by.\n- **start** / **end**: ISO 8601 range. `end` is exclusive; each window's `end`\n  field is its last second (e.g. `...T23:59:59Z`).\n- **timezone**: IANA timezone the day/month/6-hour bars align to (local calendar);\n  defaults to UTC. Weekly bars are always anchored to `start`.\n\nReturns an empty list if the team has no outcome mapping configured yet, or if\nthe given range is missing or empty.","operationId":"campaigns_service_get_conversation_outcome_mapping_trends_v1_stats_outcomes__template__trends_get","parameters":[{"name":"template","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Templates","description":"Outcome mapping template to bucket outcomes by"},"description":"Outcome mapping template to bucket outcomes by"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone (e.g. 'Asia/Kolkata') that day/month/6-hour bars align to; defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone (e.g. 'Asia/Kolkata') that day/month/6-hour bars align to; defaults to UTC."},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Conversation outcome category / sub category counts bucketed into time windows","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeTrendsResponse"}}}},"400":{"description":"Bad request — invalid input or constraint violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/contacts":{"post":{"tags":["Contacts"],"summary":"Create New Contact","description":"Create a new contact for the team.\n- **body**: The contact data including first_name, last_name, phone_number, and optional email and dob.","operationId":"campaigns_service_create_new_contact_v1_contacts_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreateRequest","description":"Contact data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]},"get":{"tags":["Contacts"],"summary":"Get Contacts","description":"Fetch all contacts for the team with optional search and pagination.\n- **pagination**: Pagination parameters including page, size, and optional search term.","operationId":"campaigns_service_get_contacts_v1_contacts_get","parameters":[{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Number of items per page","default":300,"title":"Size"},"description":"Number of items per page"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search keywords","title":"Search"},"description":"Search keywords"},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by start time (ISO 8601 format)","title":"Start"},"description":"Filter by start time (ISO 8601 format)"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter by end time (ISO 8601 format)","title":"End"},"description":"Filter by end time (ISO 8601 format)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/contacts/stats":{"get":{"tags":["Contacts"],"summary":"Get Contacts Stats","description":"Fetch statistics about contacts for the team.","operationId":"campaigns_service_get_contacts_stats_v1_contacts_stats_get","parameters":[],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/contacts/{contact_id}":{"get":{"tags":["Contacts"],"summary":"Get Contact By Id","description":"Fetch a contact by ID.\n- **contact_id**: The ID of the contact to fetch.","operationId":"campaigns_service_get_contact_by_id_v1_contacts__contact_id__get","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Contact ID"},"description":"Contact ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]},"put":{"tags":["Contacts"],"summary":"Update Contact","description":"Update a contact by ID.\n- **contact_id**: The ID of the contact to update.\n- **body**: The fields to update.","operationId":"campaigns_service_update_contact_v1_contacts__contact_id__put","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Contact ID"},"description":"Contact ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdateRequest","description":"Contact data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]},"delete":{"tags":["Contacts"],"summary":"Delete Contact","description":"Delete a contact by ID.\n- **contact_id**: The ID of the contact to delete.","operationId":"campaigns_service_delete_contact_v1_contacts__contact_id__delete","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/PydanticObjectId","description":"Contact ID"},"description":"Contact ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/outcome-mappings/{template}":{"post":{"tags":["Outcome Mappings"],"summary":"Create New Outcome Mapping","description":"Create the outcome mapping configuration for the team's template.\n- **template**: The template to create the outcome mapping for.\n- **body**: The categories, sub categories, and mappings for the outcome configuration.","operationId":"campaigns_service_create_new_outcome_mapping_v1_outcome_mappings__template__post","parameters":[{"name":"template","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Templates","description":"Outcome mapping template"},"description":"Outcome mapping template"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeMappingsCreateRequest","description":"Outcome mapping data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]},"get":{"tags":["Outcome Mappings"],"summary":"Get Outcome Mapping By Template","description":"Fetch the outcome mapping configuration for the team's template.\n- **template**: The template to fetch the outcome mapping for.","operationId":"campaigns_service_get_outcome_mapping_by_template_v1_outcome_mappings__template__get","parameters":[{"name":"template","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Templates","description":"Outcome mapping template"},"description":"Outcome mapping template"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]},"put":{"tags":["Outcome Mappings"],"summary":"Update Outcome Mapping","description":"Update the outcome mapping configuration for the team's template.\n- **template**: The template to update the outcome mapping for.\n- **body**: The fields to update.","operationId":"campaigns_service_update_outcome_mapping_v1_outcome_mappings__template__put","parameters":[{"name":"template","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Templates","description":"Outcome mapping template"},"description":"Outcome mapping template"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeMappingsUpdateRequest","description":"Outcome mapping data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]},"delete":{"tags":["Outcome Mappings"],"summary":"Delete Outcome Mapping","description":"Delete the outcome mapping configuration for the team's template.\n- **template**: The template to delete the outcome mapping for.","operationId":"campaigns_service_delete_outcome_mapping_v1_outcome_mappings__template__delete","parameters":[{"name":"template","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Templates","description":"Outcome mapping template"},"description":"Outcome mapping template"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/outcome-mappings":{"get":{"tags":["Outcome Mappings"],"summary":"Get Outcome Mappings","description":"Fetch outcome mapping configurations for all templates for the team.","operationId":"campaigns_service_get_outcome_mappings_v1_outcome_mappings_get","parameters":[],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/conversations/{conversation_id}/transcript":{"get":{"tags":["Conversations"],"summary":"Get Conversation Transcript","description":"Fetch the conversation's transcript JSON file from S3.","operationId":"campaigns_service_get_conversation_transcript_v1_conversations__conversation_id__transcript_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","description":"Conversation ID","title":"Conversation Id"},"description":"Conversation ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}},"/campaigns/v1/conversations/{conversation_id}/analysis":{"get":{"tags":["Conversations"],"summary":"Get Conversation Analysis","description":"Fetch the conversation's analysis JSON file from S3.","operationId":"campaigns_service_get_conversation_analysis_v1_conversations__conversation_id__analysis_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","description":"Conversation ID","title":"Conversation Id"},"description":"Conversation ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]}]}}},"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"Bearer","type":"http","description":"Retrieve your API Key from [Dashboard API Keys Section](https://dashboard-qa.interactly.ai/api-keys)."}},"schemas":{"Action":{"type":"string","enum":["pause","launch","abort","resume"],"title":"Action","description":"Enum representing the actions that can be requested for a campaign.\nThis enum is used to control the lifecycle of campaigns."},"ActionRequest":{"properties":{"action":{"$ref":"#/components/schemas/Action"}},"type":"object","required":["action"],"title":"ActionRequest","description":"Represents a request to perform an action on a campaign.\nThis model includes the action to be performed, such as pausing, launching,\naborting, or resuming a campaign.\nThe action is represented as an enum for better validation and clarity."},"AfterCallMessages":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Enable/disable after call messages","default":false},"callAnswered":{"$ref":"#/components/schemas/CallMessage","description":"Message for answered calls"},"callNotAnswered":{"$ref":"#/components/schemas/CallMessage","description":"Message for unanswered calls"},"callDeclined":{"$ref":"#/components/schemas/CallMessage","description":"Message for declined calls"},"voicemail":{"$ref":"#/components/schemas/CallMessage","description":"Message for voicemail"},"callDropped":{"$ref":"#/components/schemas/CallMessage","description":"Message for dropped calls"}},"type":"object","title":"AfterCallMessages","description":"Represents the messages sent after a call is processed.\nThis model includes messages for various outcomes of the call,\nsuch as answered, not answered, declined, voicemail, and dropped calls."},"BenefitsVerificationConfigRequest":{"properties":{"callType":{"type":"string","title":"Calltype","description":"**Deprecated.** Do not use — this field has no effect and will be removed in a future version.","default":"common","deprecated":true},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Name of the benefits verification configuration"},"campaignType":{"type":"string","title":"Campaigntype","description":"Type of campaign (single/batch)","default":"single"},"assistantNumbers":{"items":{"type":"string"},"type":"array","title":"Assistantnumbers","description":"List of assistant phone numbers"},"timezone":{"type":"string","title":"Timezone","description":"Timezone for scheduling","default":"America/New_York"},"schedule":{"items":{"$ref":"#/components/schemas/Schedule"},"type":"array","title":"Schedule","description":"List of schedule configurations"},"reportEmails":{"items":{"type":"string"},"type":"array","title":"Reportemails","description":"Email addresses for reports"},"status":{"type":"string","title":"Status","description":"Current status of configuration","default":"pending"},"statusHistory":{"items":{"$ref":"#/components/schemas/StatusHistory-Input"},"type":"array","title":"Statushistory","description":"History of status changes"},"processTimings":{"$ref":"#/components/schemas/ProcessTimings-Input","description":"Process timing configurations"},"maxParallelCalls":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxparallelcalls","description":"Maximum number of concurrent calls","default":2},"isReviewRequired":{"type":"boolean","title":"Isreviewrequired","description":"Review requirement flag","default":false},"validateOnUpload":{"type":"boolean","title":"Validateonupload","description":"Validate calls immediately after upload and before launch","default":false},"preCallMessage":{"$ref":"#/components/schemas/PreCallMessage","description":"Pre-call message configuration"},"afterCallMessages":{"$ref":"#/components/schemas/AfterCallMessages","description":"After-call message configuration"},"webhook":{"$ref":"#/components/schemas/WebhookConfig","title":"Webhook Settings","description":"Configuration settings for webhook integrations. Includes the webhook endpoint URL, secret key, custom headers, and retry policies for handling failed webhook deliveries."},"retryPolicy":{"$ref":"#/components/schemas/RetryPolicy-Input","description":"Retry policy for configuring outcome/call-status-based retry rules."},"pausePolicy":{"$ref":"#/components/schemas/PausePolicy","description":"Pause policy for configuring outcome & call-statuses"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Tags attached to this campaign"}},"type":"object","title":"BenefitsVerificationConfigRequest"},"BulkCampaignCallsRequest":{"properties":{"config":{"$ref":"#/components/schemas/CampaignConfig"},"data":{"items":{"$ref":"#/components/schemas/UploadCallItem"},"type":"array","title":"Data","description":"List of call records to create. Each item must include phone_number; all other fields are optional. Extra fields are stored as call payload."}},"type":"object","title":"BulkCampaignCallsRequest"},"BulkCreateCallsData":{"properties":{"campaignId":{"type":"string","title":"Campaignid","description":"ID of the campaign created or used for this batch"},"campaignName":{"type":"string","title":"Campaignname","description":"Name of the campaign"},"callIds":{"items":{"type":"string"},"type":"array","title":"Callids","description":"IDs of the call records created in this batch"},"requestId":{"type":"string","title":"Requestid","description":"Unique batch identifier — use for tracing and support"}},"type":"object","required":["campaignId","campaignName","callIds","requestId"],"title":"BulkCreateCallsData"},"BulkCreateCallsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Received batch calls triggers successfully."]},"data":{"$ref":"#/components/schemas/BulkCreateCallsData","description":"Details of the accepted batch"}},"type":"object","required":["message","data"],"title":"BulkCreateCallsResponse"},"CallCountResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Calls count fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/CallStatusCount"},"type":"array","title":"Data","description":"Call counts broken down by status. One entry per distinct status present in the campaign."}},"type":"object","required":["message","data"],"title":"CallCountResponse"},"CallMessage":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Enable/disable message","default":false},"messageType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messagetype","description":"Type of message"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Message content"}},"type":"object","title":"CallMessage","description":"Represents a message associated with a call.\nThis model includes fields for enabling/disabling the message,\nspecifying the type of message, and the content of the message."},"CallStatusCode":{"type":"string","enum":["call_declined","call_not_answered","call_dropped"],"title":"CallStatusCode","description":"Enum representing the status code of a call.\nThis enum is used to categorize the status code of a call,\nallowing for better organization and handling of calls.\nAttributes:\n    CALL_DECLINED (str): Represents a call that was declined.\n    CALL_NOT_ANSWERED (str): Represents a call that was not answered.\n    CALL_DROPPED (str): Represents a call that was dropped."},"CallStatusCount":{"properties":{"status":{"type":"string","title":"Status","description":"Call status. Possible values: 'received', 'ready', 'queued', 'ringing', 'processing', 'ended', 'completed', 'failed'"},"count":{"type":"integer","title":"Count","description":"Number of calls in this status"}},"type":"object","required":["status","count"],"title":"CallStatusCount"},"CampaignCallDataResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Call fetched successfully."]},"data":{"$ref":"#/components/schemas/CampaignCallResponse","description":"Call record object"}},"type":"object","required":["message","data"],"title":"CampaignCallDataResponse"},"CampaignCallDetailsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Call details fetched successfully."]},"data":{"$ref":"#/components/schemas/CampaignCallExtendedResponse","description":"Call record object with decrypted payload"}},"type":"object","required":["message","data"],"title":"CampaignCallDetailsResponse"},"CampaignCallExtendedResponse":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Unique call record identifier"},"configId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configid","description":"ID of the campaign configuration this call belongs to"},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phonenumber","description":"Target phone number for this call"},"status":{"type":"string","title":"Status","description":"Current call status. Possible values: 'received', 'ready', 'queued', 'ringing', 'processing', 'ended', 'completed', 'failed'","default":"received"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Call outcome label set by the AI assistant (e.g. 'conveyed', 'voicemail', 'no_answer', 'callback_requested')"},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errorcode","description":"Error code when the call status is 'failed'"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage","description":"Human-readable error description when the call failed"},"collectedInformation":{"additionalProperties":true,"type":"object","title":"Collectedinformation","description":"Structured data collected by the AI assistant during the call conversation"},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversationid","description":"Unique conversation identifier assigned by the AI assistant platform"},"retryCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retrycount","description":"Number of retry attempts made for this call so far"},"maxRetries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxretries","description":"Maximum number of retry attempts allowed for this call"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Tags attached to this call for filtering"},"review":{"anyOf":[{"$ref":"#/components/schemas/Review"},{"type":"null"}],"description":"Manual review details. review.status values: 'not_required', 'pending', 'in_progress', 'rejected', 'approved'"},"processTimings":{"anyOf":[{"$ref":"#/components/schemas/campaigns_service__src__models__BenefitsVerificationCalls__ProcessTimings"},{"type":"null"}],"description":"Actual call execution timestamps: startAt and endAt (ISO 8601 UTC)"},"statusHistory":{"anyOf":[{"items":{"$ref":"#/components/schemas/StatusHistory-Output"},"type":"array"},{"type":"null"}],"title":"Statushistory","description":"Chronological list of status transitions with timestamps and optional reasons"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat","description":"UTC timestamp when this call record was created"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedat","description":"UTC timestamp of the most recent update to this call record"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"Decrypted call payload — the data submitted at upload time"}},"type":"object","title":"CampaignCallExtendedResponse","description":"Extended call response including sensitive fields that require special handling."},"CampaignCallListResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Calls fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/CampaignCallResponse"},"type":"array","title":"Data","description":"Paginated list of call record objects"},"totalCount":{"type":"integer","title":"Totalcount","description":"Total number of calls matching the applied filters"},"page":{"type":"integer","title":"Page","description":"Current page number (1-indexed)"},"size":{"type":"integer","title":"Size","description":"Number of items returned on this page"}},"type":"object","required":["message","data","totalCount","page","size"],"title":"CampaignCallListResponse"},"CampaignCallPatchRequest":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Override the call status manually. Valid values for manual override: 'completed', 'failed'. Use only for correcting records where automated processing produced an incorrect result."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Free-text reason for the status change or review decision"},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errorcode","description":"Error code to attach when marking a call as failed"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage","description":"Human-readable error description when marking a call as failed"},"collectedInformation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Collectedinformation","description":"Override or extend the structured data collected during the call conversation"},"reviewStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewstatus","description":"Set the manual review status. Possible values: 'not_required', 'pending', 'in_progress', 'rejected', 'approved'"},"retry":{"type":"boolean","title":"Retry","description":"When true, resets this call to 'ready' status so it is picked up for another dial attempt","default":false},"reviewChecklist":{"additionalProperties":true,"type":"object","title":"Reviewchecklist","description":"Key-value pairs for the review checklist (e.g. {\"verified_insurance\": true, \"confirmed_dob\": true})"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Replace the call's tag list with this list. Pass an empty list to clear all tags."}},"type":"object","title":"CampaignCallPatchRequest"},"CampaignCallResponse":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Unique call record identifier"},"configId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configid","description":"ID of the campaign configuration this call belongs to"},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phonenumber","description":"Target phone number for this call"},"status":{"type":"string","title":"Status","description":"Current call status. Possible values: 'received', 'ready', 'queued', 'ringing', 'processing', 'ended', 'completed', 'failed'","default":"received"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Call outcome label set by the AI assistant (e.g. 'conveyed', 'voicemail', 'no_answer', 'callback_requested')"},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errorcode","description":"Error code when the call status is 'failed'"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage","description":"Human-readable error description when the call failed"},"collectedInformation":{"additionalProperties":true,"type":"object","title":"Collectedinformation","description":"Structured data collected by the AI assistant during the call conversation"},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversationid","description":"Unique conversation identifier assigned by the AI assistant platform"},"retryCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retrycount","description":"Number of retry attempts made for this call so far"},"maxRetries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxretries","description":"Maximum number of retry attempts allowed for this call"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Tags attached to this call for filtering"},"review":{"anyOf":[{"$ref":"#/components/schemas/Review"},{"type":"null"}],"description":"Manual review details. review.status values: 'not_required', 'pending', 'in_progress', 'rejected', 'approved'"},"processTimings":{"anyOf":[{"$ref":"#/components/schemas/campaigns_service__src__models__BenefitsVerificationCalls__ProcessTimings"},{"type":"null"}],"description":"Actual call execution timestamps: startAt and endAt (ISO 8601 UTC)"},"statusHistory":{"anyOf":[{"items":{"$ref":"#/components/schemas/StatusHistory-Output"},"type":"array"},{"type":"null"}],"title":"Statushistory","description":"Chronological list of status transitions with timestamps and optional reasons"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat","description":"UTC timestamp when this call record was created"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedat","description":"UTC timestamp of the most recent update to this call record"}},"type":"object","title":"CampaignCallResponse","description":"Public-facing call fields returned in API responses."},"CampaignCloneRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Name for the cloned campaign (required)"},"schedule":{"items":{"$ref":"#/components/schemas/Schedule"},"type":"array","title":"Schedule","description":"Schedule for the cloned campaign; uses original if empty"},"include_outcomes":{"items":{"type":"string"},"type":"array","title":"Include Outcomes","description":"Only clone calls with these outcomes"},"exclude_outcomes":{"items":{"type":"string"},"type":"array","title":"Exclude Outcomes","description":"Skip calls with these outcomes"},"include_status":{"items":{"type":"string"},"type":"array","title":"Include Status","description":"Only clone calls with these statuses"},"exclude_status":{"items":{"type":"string"},"type":"array","title":"Exclude Status","description":"Skip calls with these statuses"}},"type":"object","required":["name"],"title":"CampaignCloneRequest"},"CampaignCloneResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Campaign cloned successfully."]},"data":{"$ref":"#/components/schemas/CampaignClonedDataResponse","description":"Clone result containing the new campaign ID"}},"type":"object","required":["message","data"],"title":"CampaignCloneResponse"},"CampaignClonedDataResponse":{"properties":{"campaign_id":{"type":"string","title":"Campaign Id","description":"ID of the newly created campaign (the clone)"}},"type":"object","required":["campaign_id"],"title":"CampaignClonedDataResponse"},"CampaignConfig":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Campaign name"},"callType":{"type":"string","title":"Calltype","default":"common"},"campaignType":{"type":"string","title":"Campaigntype","default":"single"},"timezone":{"type":"string","title":"Timezone","default":"America/New_York"},"startHours":{"type":"integer","title":"Starthours","default":9},"endHours":{"type":"integer","title":"Endhours","default":17},"reportEmails":{"items":{"type":"string"},"type":"array","title":"Reportemails"},"maxParallelCalls":{"type":"integer","title":"Maxparallelcalls","default":2},"isReviewRequired":{"type":"boolean","title":"Isreviewrequired","default":true},"validateOnUpload":{"type":"boolean","title":"Validateonupload","default":false},"reviewEmails":{"items":{"type":"string"},"type":"array","title":"Reviewemails"},"maxRetries":{"type":"integer","title":"Maxretries","default":0},"uidExtension":{"type":"string","title":"Uidextension","default":"datetime"},"schedule":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Schedule"},"assistantNumbers":{"items":{"type":"string"},"type":"array","title":"Assistantnumbers"},"webhook":{"$ref":"#/components/schemas/WebhookConfig"},"retryPolicy":{"$ref":"#/components/schemas/RetryPolicy-Input"},"preCallMessage":{"$ref":"#/components/schemas/PreCallMessage"},"afterCallMessages":{"$ref":"#/components/schemas/AfterCallMessages"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","title":"CampaignConfig"},"CampaignDataResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Campaign fetched successfully."]},"data":{"$ref":"#/components/schemas/CampaignResponse","description":"Campaign configuration object"}},"type":"object","required":["message","data"],"title":"CampaignDataResponse"},"CampaignListResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Campaigns fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/CampaignResponse"},"type":"array","title":"Data","description":"Paginated list of campaign configuration objects"},"totalCount":{"type":"integer","title":"Totalcount","description":"Total number of campaigns matching the applied filters"},"page":{"type":"integer","title":"Page","description":"Current page number (1-indexed)"},"size":{"type":"integer","title":"Size","description":"Number of items returned on this page"}},"type":"object","required":["message","data","totalCount","page","size"],"title":"CampaignListResponse"},"CampaignResponse":{"properties":{"_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Unique campaign identifier"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Campaign name"},"campaignType":{"type":"string","title":"Campaigntype","description":"Campaign type. Possible values: 'single', 'multi'","default":"single"},"status":{"type":"string","title":"Status","description":"Current campaign status. Possible values: 'pending', 'processing', 'paused', 'aborted', 'completed'","default":"pending"},"assistantNumbers":{"items":{"type":"string"},"type":"array","title":"Assistantnumbers","description":"AI assistant phone numbers assigned to place calls for this campaign"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone used for scheduling call windows (e.g. 'America/Chicago', 'US/Pacific')","default":"America/New_York"},"schedule":{"items":{"$ref":"#/components/schemas/Schedule"},"type":"array","title":"Schedule","description":"Active call windows. Each entry has 'startAt' and 'endAt' as ISO 8601 datetime strings."},"reportEmails":{"items":{"type":"string"},"type":"array","title":"Reportemails","description":"Email addresses that receive the campaign summary report on completion"},"maxParallelCalls":{"type":"integer","title":"Maxparallelcalls","description":"Maximum number of calls that can run simultaneously","default":2},"isReviewRequired":{"type":"boolean","title":"Isreviewrequired","description":"When true, completed calls are held in review status until manually approved","default":false},"validateOnUpload":{"type":"boolean","title":"Validateonupload","description":"When true, calls are validated immediately after upload and before the campaign is launched","default":false},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Tags for filtering and categorizing the campaign (e.g. 'region:west', 'priority:high')"},"groupId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Groupid","description":"Group identifier shared by all runs (original + clones) of this campaign"},"runNumber":{"type":"integer","title":"Runnumber","description":"Sequential run index within the group — 1 for the original, increments for each clone","default":1},"totalRunsCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Totalrunscount","description":"Total number of runs in this campaign group (populated on the base campaign only)"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Origin of the campaign record (e.g. 'internal', 'api')"},"processTimings":{"anyOf":[{"$ref":"#/components/schemas/campaigns_service__src__models__BenefitsVerificationConfigurations__ProcessTimings"},{"type":"null"}],"description":"Campaign lifecycle timestamps: launchAt, resumeAt, completedAt (ISO 8601 UTC)"},"preCallMessage":{"anyOf":[{"$ref":"#/components/schemas/PreCallMessage"},{"type":"null"}],"description":"Pre-call SMS/message configuration: enabled flag, messageType, message content"},"afterCallMessages":{"anyOf":[{"$ref":"#/components/schemas/AfterCallMessages"},{"type":"null"}],"description":"Post-call message configuration keyed by call outcome (callAnswered, callNotAnswered, voicemail, etc.)"},"webhook":{"anyOf":[{"$ref":"#/components/schemas/WebhookConfig"},{"type":"null"}],"description":"Webhook endpoint and delivery settings for campaign event notifications"},"retryPolicy":{"anyOf":[{"$ref":"#/components/schemas/RetryPolicy-Output"},{"type":"null"}],"description":"Retry configuration — enabled flag, maxNumberOfRetries, maxRetriesPerDay, retry rules"},"cloneDetails":{"anyOf":[{"$ref":"#/components/schemas/CloneDetails"},{"type":"null"}],"description":"Clone metadata — present only when this campaign was created by cloning another campaign. cloneStatus values: 'pending', 'in-progress', 'completed', 'failed'"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat","description":"UTC timestamp when this campaign was created"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedat","description":"UTC timestamp of the most recent update"},"createdBy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdby","description":"User ID of the person who created this campaign"}},"type":"object","title":"CampaignResponse","description":"Public-facing campaign fields returned in API responses."},"ChannelPreference":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Whether this channel is opted in","default":true},"dnd":{"anyOf":[{"items":{"$ref":"#/components/schemas/DNDEntry"},"type":"array"},{"type":"null"}],"title":"Do Not Disturb","description":"Per-resource DND settings keyed by resource ID"}},"type":"object","title":"ChannelPreference"},"CloneDetails":{"properties":{"isCloned":{"type":"boolean","title":"Iscloned","description":"Whether this campaign was cloned from another campaign","default":false},"sourceCampaignId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcecampaignid","description":"Original campaign ID this was cloned from"},"cloneStatus":{"type":"string","title":"Clonestatus","description":"Status of the background cloning process","default":"pending"},"successCount":{"type":"integer","title":"Successcount","description":"Number of calls successfully cloned","default":0},"failedCount":{"type":"integer","title":"Failedcount","description":"Number of calls that failed to clone","default":0}},"type":"object","title":"CloneDetails","description":"Tracks the clone status and call counts for a cloned campaign."},"ContactCreateRequest":{"properties":{"first_name":{"type":"string","title":"First Name","description":"Contact's first name"},"last_name":{"type":"string","title":"Last Name","description":"Contact's last name"},"phone_number":{"type":"string","title":"Phone Number","description":"Contact's phone number"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact's email address"},"dob":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dob","description":"Contact's date of birth in YYYY-MM-DD format"},"notification_preferences":{"anyOf":[{"$ref":"#/components/schemas/NotificationPreferences"},{"type":"null"}],"description":"Notification preferences for the contact"}},"type":"object","required":["first_name","last_name","phone_number"],"title":"ContactCreateRequest"},"ContactStatsResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total number of contacts"},"dnd_active":{"type":"integer","title":"Dnd Active","description":"Number of contacts with active DND"},"reachable":{"type":"integer","title":"Reachable","description":"Number of contacts with reachable"}},"type":"object","required":["total","dnd_active","reachable"],"title":"ContactStatsResponse"},"ContactUpdateRequest":{"properties":{"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name","description":"Contact's first name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name","description":"Contact's last name"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Contact's phone number"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact's email address"},"dob":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dob","description":"Contact's date of birth in YYYY-MM-DD format"},"notification_preferences":{"anyOf":[{"$ref":"#/components/schemas/NotificationPreferences"},{"type":"null"}],"description":"Notification preferences for the contact"}},"type":"object","title":"ContactUpdateRequest"},"DNDEntry":{"properties":{"sourceId":{"type":"string","title":"Sourceid","description":"Source ID that set the DND"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether DND is active for this resource"},"sourceType":{"$ref":"#/components/schemas/DNDSourceType","title":"Source Type","description":"The source that set the DND"},"sourceName":{"type":"string","title":"Sourcename","description":"Source name that set the DND"},"reason":{"type":"string","title":"Reason","description":"Reason for setting DND"},"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until","description":"DND expiry time; None means indefinite"}},"type":"object","required":["sourceId","enabled","sourceType","sourceName","reason"],"title":"DNDEntry"},"DNDSourceType":{"type":"string","enum":["team","assistant","campaign","workflow","other"],"title":"DNDSourceType"},"DownloadCallsBody":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"status":{"type":"string","title":"Status"},"callType":{"type":"string","title":"Calltype"},"callIds":{"items":{},"type":"array","title":"Callids","default":[]},"teamId":{"type":"string","title":"Teamid"},"search":{"type":"string","title":"Search"}},"type":"object","title":"DownloadCallsBody"},"DownloadCallsData":{"properties":{"calls":{"items":{"$ref":"#/components/schemas/CampaignCallResponse"},"type":"array","title":"Calls","description":"Call records matching the filter criteria"}},"type":"object","required":["calls"],"title":"DownloadCallsData"},"DownloadCallsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Calls fetched successfully."]},"data":{"$ref":"#/components/schemas/DownloadCallsData","description":"Download result container"}},"type":"object","required":["message","data"],"title":"DownloadCallsResponse"},"ErrorResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Human-readable error description","examples":["Resource not found."]}},"type":"object","required":["message"],"title":"ErrorResponse"},"FrequentCallerEntry":{"properties":{"userNumber":{"type":"string","title":"Usernumber","description":"Caller phone number"},"count":{"type":"integer","title":"Count","description":"Number of calls placed by this number in the date range"}},"type":"object","required":["userNumber","count"],"title":"FrequentCallerEntry"},"FrequentCallersStatsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Stats fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/FrequentCallerEntry"},"type":"array","title":"Data","description":"Phone numbers that called more than once, sorted by call count descending"}},"type":"object","required":["message","data"],"title":"FrequentCallersStatsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Human-readable result message","examples":["Operation completed successfully."]}},"type":"object","required":["message"],"title":"MessageResponse"},"NotificationPreferences":{"properties":{"call":{"$ref":"#/components/schemas/ChannelPreference","title":"Call","description":"Phone call notification preferences"},"sms":{"$ref":"#/components/schemas/ChannelPreference","title":"SMS","description":"SMS notification preferences"},"email":{"$ref":"#/components/schemas/ChannelPreference","title":"Email","description":"Email notification preferences"}},"type":"object","title":"Notification Preferences","description":"Notification preferences"},"OutcomeCategory":{"properties":{"name":{"type":"string","title":"Category Name","description":"Name of the outcome category"},"theme":{"type":"string","title":"Color Theme","description":"Theme of the outcome category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the outcome category"},"displayOrder":{"type":"integer","title":"Display Order","description":"Lower values are displayed first.","default":0}},"type":"object","required":["name","theme"],"title":"OutcomeCategory"},"OutcomeCategoryStat":{"properties":{"category":{"$ref":"#/components/schemas/OutcomeCategorySummary","description":"Category this stat entry belongs to"},"count":{"type":"integer","title":"Count","description":"Total number of conversations in this category"},"subCategories":{"items":{"$ref":"#/components/schemas/OutcomeSubCategoryStat"},"type":"array","title":"Subcategories","description":"Sub category breakdown within this category"}},"type":"object","required":["category","count","subCategories"],"title":"OutcomeCategoryStat"},"OutcomeCategorySummary":{"properties":{"name":{"type":"string","title":"Name","description":"Outcome category name"},"theme":{"type":"string","title":"Theme","description":"Color theme for the category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Category description"}},"type":"object","required":["name","theme"],"title":"OutcomeCategorySummary"},"OutcomeMapping":{"properties":{"outcome":{"type":"string","title":"Outcome","description":"Name of the outcome"},"category_name":{"type":"string","title":"Category Name","description":"Name of the outcome category"},"sub_category_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sub Category Name","description":"Name of the outcome sub category"}},"type":"object","required":["outcome","category_name"],"title":"OutcomeMapping"},"OutcomeMappingsCreateRequest":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/OutcomeCategory"},"type":"array","title":"Categories","description":"List of outcome categories"},"subCategories":{"items":{"$ref":"#/components/schemas/OutcomeSubCategory"},"type":"array","title":"Subcategories","description":"List of outcome sub categories"},"mappings":{"items":{"$ref":"#/components/schemas/OutcomeMapping"},"type":"array","title":"Mappings","description":"List of outcome mappings"}},"type":"object","required":["categories","subCategories","mappings"],"title":"OutcomeMappingsCreateRequest"},"OutcomeMappingsUpdateRequest":{"properties":{"categories":{"anyOf":[{"items":{"$ref":"#/components/schemas/OutcomeCategory"},"type":"array"},{"type":"null"}],"title":"Categories","description":"List of outcome categories"},"subCategories":{"anyOf":[{"items":{"$ref":"#/components/schemas/OutcomeSubCategory"},"type":"array"},{"type":"null"}],"title":"Subcategories","description":"List of outcome sub categories"},"mappings":{"anyOf":[{"items":{"$ref":"#/components/schemas/OutcomeMapping"},"type":"array"},{"type":"null"}],"title":"Mappings","description":"List of outcome mappings"}},"type":"object","title":"OutcomeMappingsUpdateRequest"},"OutcomeStatsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Stats fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/OutcomeCategoryStat"},"type":"array","title":"Data","description":"Conversation counts grouped by outcome category and sub category"}},"type":"object","required":["message","data"],"title":"OutcomeStatsResponse"},"OutcomeSubCategory":{"properties":{"category_name":{"type":"string","title":"Category Name","description":"Name of the outcome category"},"name":{"type":"string","title":"Sub Category Name","description":"Name of the outcome sub category"},"theme":{"type":"string","title":"Color Theme","description":"Theme of the outcome sub category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the outcome sub category"},"displayOrder":{"type":"integer","title":"Display Order","description":"Lower values are displayed first.","default":0}},"type":"object","required":["category_name","name","theme"],"title":"OutcomeSubCategory"},"OutcomeSubCategoryStat":{"properties":{"name":{"type":"string","title":"Name","description":"Outcome sub category name"},"theme":{"type":"string","title":"Theme","description":"Color theme for the sub category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Sub category description"},"count":{"type":"integer","title":"Count","description":"Number of conversations in this sub category"}},"type":"object","required":["name","theme","count"],"title":"OutcomeSubCategoryStat"},"OutcomeTrendWindow":{"properties":{"start":{"type":"string","title":"Start","description":"Inclusive window start (ISO 8601 UTC, 'Z' suffix)"},"end":{"type":"string","title":"End","description":"Inclusive window end (ISO 8601 UTC, 'Z' suffix)"},"totalCount":{"type":"integer","title":"Totalcount","description":"Total conversations in this window"},"categories":{"items":{"$ref":"#/components/schemas/OutcomeCategoryStat"},"type":"array","title":"Categories","description":"Outcome category / sub category breakdown within this window"}},"type":"object","required":["start","end","totalCount","categories"],"title":"OutcomeTrendWindow"},"OutcomeTrendsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Stats fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/OutcomeTrendWindow"},"type":"array","title":"Data","description":"Outcome category / sub category counts bucketed into contiguous time windows. Window size adapts to the requested period: 6-hour windows for up to 2 days, daily up to 14 days, weekly up to ~1 month, and monthly beyond that."}},"type":"object","required":["message","data"],"title":"OutcomeTrendsResponse"},"PausePolicy":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Enable/disable pause policy","default":false},"statuses":{"items":{"$ref":"#/components/schemas/CallStatusCode"},"type":"array","title":"Statuses","description":"List of call statuses to include"},"outcomes":{"items":{"type":"string"},"type":"array","title":"Outcomes","description":"List of outcomes to include"},"thresholdType":{"$ref":"#/components/schemas/PauseThresholdType","description":"Threshold mode: count or percentage","default":"percentage"},"thresholdValue":{"type":"integer","title":"Thresholdvalue","description":"Threshold value: count or percentage (0-100 for percentage)","default":0}},"type":"object","title":"PausePolicy","description":"Represents the pause policy for a campaign."},"PauseThresholdType":{"type":"string","enum":["count","percentage"],"title":"PauseThresholdType"},"PreCallMessage":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Enable/disable pre-call message","default":false},"scheduledBefore":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduledbefore","description":"Time before call to schedule message"},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduledat","description":"Scheduled time for message"},"messageType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messagetype","description":"Type of pre-call message"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Pre-call message content"}},"type":"object","title":"PreCallMessage","description":"Represents the message sent before a call is initiated.\nThis model includes fields for enabling/disabling the pre-call message,\nscheduling the message, and the content of the message."},"ProcessTimings-Input":{"properties":{"launchAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Launchat","description":"Process launch time"},"resumeAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resumeat","description":"Process resume time"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completedat","description":"Process completion time"}},"type":"object","title":"ProcessTimings","description":"Represents the actual timings of the call process.\nThis model includes timestamps for various stages of the call process,\nsuch as when the process started, ended, was launched, resumed, or completed."},"PydanticObjectId":{"type":"string","maxLength":24,"minLength":24,"pattern":"^[0-9a-f]{24}$","example":"5eb7cf5a86d9755df3a6c593"},"RawOutcomeEntry":{"properties":{"outcome":{"type":"string","title":"Outcome","description":"Raw conversation outcome value, or 'no-outcome-recorded' if unset"},"count":{"type":"integer","title":"Count","description":"Number of conversations with this outcome"}},"type":"object","required":["outcome","count"],"title":"RawOutcomeEntry"},"RawOutcomeStatsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Stats fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/RawOutcomeEntry"},"type":"array","title":"Data","description":"Conversation counts grouped by raw outcome value"}},"type":"object","required":["message","data"],"title":"RawOutcomeStatsResponse"},"RetryPolicy-Input":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Enable/disable retry policy","default":false},"maxNumberOfRetries":{"type":"integer","title":"Maxnumberofretries","description":"Maximum number of retries","default":2},"maxRetriesPerDay":{"type":"integer","title":"Maxretriesperday","description":"Max retries per day","default":2},"rules":{"items":{"$ref":"#/components/schemas/RetryRule"},"type":"array","title":"Rules","description":"List of retry rules"}},"type":"object","title":"RetryPolicy","description":"Represents the retry policy for a call.\nThis model includes fields for enabling/disabling the retry policy,\nsetting the maximum number of retries, and the rules."},"RetryPolicy-Output":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Enable/disable retry policy","default":false},"maxNumberOfRetries":{"type":"integer","title":"Maxnumberofretries","description":"Maximum number of retries","default":2},"maxRetriesPerDay":{"type":"integer","title":"Maxretriesperday","description":"Max retries per day","default":2},"rules":{"items":{"$ref":"#/components/schemas/RetryRule"},"type":"array","title":"Rules","description":"List of retry rules"}},"type":"object","title":"RetryPolicy","description":"Represents the retry policy for a call.\nThis model includes fields for enabling/disabling the retry policy,\nsetting the maximum number of retries, and the rules."},"RetryRule":{"properties":{"ruleId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ruleid","description":"Rule id for the retry attempt"},"ruleType":{"anyOf":[{"$ref":"#/components/schemas/RetryRuleType"},{"type":"null"}],"description":"Rule type"},"callStatusCode":{"anyOf":[{"$ref":"#/components/schemas/CallStatusCode"},{"type":"null"}],"description":"Call status code to trigger retry"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Custom outcome string from call processing to trigger retry"},"delayStartInMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delaystartinminutes","description":"Delay period's start in minutes"},"delayEndInMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delayendinminutes","description":"Delay period's end in minutes"}},"type":"object","title":"RetryRule","description":"Represents a retry rule for a call.\nThis model is used to store the retry rules for a call."},"RetryRuleType":{"type":"string","enum":["call_status_based","outcome_based"],"title":"RetryRuleType","description":"Enum representing the type of retry rule.\nThis enum is used to categorize the type of retry rule being applied to a call.\nEach type represents a different category of retry rule, allowing for better organization and handling of retries.\nAttributes:\n    CALL_STATUS_BASED (str): Represents a retry rule based on the status of the call.\n    OUTCOME_BASED (str): Represents a retry rule based on the outcome of the call."},"Review":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Review status","default":"not_required"},"by":{"anyOf":[{"$ref":"#/components/schemas/PydanticObjectId"},{"type":"null"}],"description":"Reviewer identifier"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp","description":"Review timestamp"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Review reason"},"emails":{"items":{"type":"string"},"type":"array","title":"Emails","description":"List of notification emails"},"emailSent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Emailsent","description":"Whether notification email was sent","default":false},"emailSentAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Emailsentat","description":"Timestamp of email sent"},"checklist":{"additionalProperties":true,"type":"object","title":"Checklist","description":"Review checklist items"}},"type":"object","title":"Review","description":"Represents the review details for a call."},"Schedule":{"properties":{"startAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Startat","description":"Schedule start datetime"},"endAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Endat","description":"Schedule end datetime"}},"type":"object","title":"Schedule","description":"Represents a schedule for processing calls.\nThis model includes the start and end times for the schedule,\nallowing for flexible scheduling of call processing."},"StatEntry":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of items in this group"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Call/campaign status (group_by=status or status_outcome)"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"Call outcome label (group_by=outcome or status_outcome)"},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag","description":"Tag string (group_by=tag)"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Campaign source (group_by=source; campaigns endpoint only)"},"campaignType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaigntype","description":"Campaign type (group_by=campaignType; campaigns endpoint only)"}},"additionalProperties":true,"type":"object","required":["count"],"title":"StatEntry","description":"A single aggregation bucket returned by stats endpoints.\n\nExactly one group-key field is present per entry — which field depends on the group_by parameter:\n  - group_by=outcome       → outcome\n  - group_by=status        → status\n  - group_by=status_outcome → status + outcome\n  - group_by=tag           → tag\n  - group_by=source        → source  (campaigns only)\n  - group_by=campaignType  → campaignType  (campaigns only)"},"StatsGroupBy":{"type":"string","enum":["outcome","status","status_outcome","tag","source","campaignType"],"title":"StatsGroupBy"},"StatsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Stats fetched successfully."]},"data":{"items":{"$ref":"#/components/schemas/StatEntry"},"type":"array","title":"Data","description":"Aggregated counts grouped by the requested dimension ('outcome', 'status', 'status_outcome', 'tag', 'source', 'campaignType'). Each entry contains a 'count' field and a group key field named after the dimension."}},"type":"object","required":["message","data"],"title":"StatsResponse"},"StatusHistory-Input":{"properties":{"status":{"type":"string","title":"Status","description":"Status of the configuration"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"Timestamp of status change"}},"type":"object","required":["status","timestamp"],"title":"StatusHistory","description":"Represents the history of status changes for a call configuration.\nThis model tracks the status of the configuration over time,"},"StatusHistory-Output":{"properties":{"status":{"type":"string","title":"Status","description":"Current status of the call"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"Timestamp when status was updated"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for status change"}},"type":"object","required":["status","timestamp"],"title":"StatusHistory","description":"Represents the history of status changes for a call."},"TagEntry":{"properties":{"tag":{"type":"string","title":"Tag","description":"Tag string (e.g. 'region:west', 'priority:high')"},"count":{"type":"integer","title":"Count","description":"Total occurrences of this tag across campaigns and their calls"}},"type":"object","required":["tag","count"],"title":"TagEntry"},"TagsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description"},"data":{"items":{"$ref":"#/components/schemas/TagEntry"},"type":"array","title":"Data","description":"Distinct tags with aggregated occurrence counts"}},"type":"object","required":["message","data"],"title":"TagsResponse"},"Templates":{"type":"string","enum":["template_v1","template_v2"],"title":"Templates"},"UploadCallItem":{"properties":{"phone_number":{"type":"string","title":"Phone Number","description":"Target phone number (E.164 format recommended, e.g. '+12065551234')"},"override_assistant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Override Assistant Id","description":"Override the campaign's default AI assistant for this specific call"},"override_timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Override Timezone","description":"IANA timezone override for this call's scheduling window (e.g. 'America/Chicago')"},"override_schedule":{"anyOf":[{"items":{"$ref":"#/components/schemas/Schedule"},"type":"array"},{"type":"null"}],"title":"Override Schedule","description":"Call window override — each entry has 'startAt' and 'endAt' as ISO 8601 strings"}},"additionalProperties":true,"type":"object","required":["phone_number"],"title":"UploadCallItem","description":"One call record in an upload batch. Extra fields are stored as call payload."},"UploadCallsBatchData":{"properties":{"callIds":{"items":{"type":"string"},"type":"array","title":"Callids","description":"IDs of the call records created in this batch"},"requestId":{"type":"string","title":"Requestid","description":"Unique batch identifier — use for tracing and support"}},"type":"object","required":["callIds","requestId"],"title":"UploadCallsBatchData"},"UploadCallsResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Result description","examples":["Received batch calls triggers successfully."]},"data":{"$ref":"#/components/schemas/UploadCallsBatchData","description":"Details of the accepted upload batch"}},"type":"object","required":["message","data"],"title":"UploadCallsResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookConfig":{"properties":{"enabled":{"type":"boolean","title":"Webhooks Enabled","description":"Enable/disable webhooks. When enabled, webhook notifications will be sent based on the configured events.","default":false},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook URL","description":"The endpoint URL where Interactly will send webhook notifications about campaign and call events using HTTP POST requests.","input_field_type":"external_url_link"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret Key","description":"An optional secret key used for authenticating webhook requests. Each request will include this key in the 'x-interactly-secret' header to help you verify that the request originated from Interactly.","input_field_type":"password"},"headers":{"anyOf":[{"items":{"$ref":"#/components/schemas/WebhookHeader"},"type":"array"},{"type":"null"}],"title":"Custom HTTP Headers","description":"A list of additional HTTP headers to include with each webhook request. These headers can be used to authenticate your webhook endpoint or send custom metadata. Headers marked as sensitive will have their values encrypted before storage. All headers will be automatically included in every webhook request."},"events":{"items":{"$ref":"#/components/schemas/WebhookEvents"},"type":"array","title":"Subscribed Webhook Events","description":"The list of events for which webhook notifications will be sent. You can choose one or more events to receive notifications about specific campaign and call activities."}},"type":"object","title":"WebhookConfig","description":"Represents the configuration for webhooks."},"WebhookEvents":{"type":"string","enum":["call_status","campaign_report","campaign_status"],"title":"WebhookEvents","description":"Enum representing different webhook events."},"WebhookHeader":{"properties":{"key":{"type":"string","title":"Header Key","description":"The name of the HTTP header to include in the webhook request (e.g., 'Authorization')."},"value":{"type":"string","title":"Header Value","description":"The value of the HTTP header (e.g., 'Bearer token'). This value will be encrypted if marked as sensitive.","input_field_type":"password"},"sensitive":{"type":"boolean","title":"Sensitive","description":"If true, the header value will be encrypted and stored securely in the database.","default":false}},"type":"object","title":"WebhookHeader"},"campaigns_service__src__models__BenefitsVerificationCalls__ProcessTimings":{"properties":{"startAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Startat","description":"Process start timestamp"},"endAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Endat","description":"Process end timestamp"}},"type":"object","title":"ProcessTimings","description":"Presents the actual timings of the call process."},"campaigns_service__src__models__BenefitsVerificationConfigurations__ProcessTimings":{"properties":{"launchAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Launchat","description":"Process launch time"},"resumeAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resumeat","description":"Process resume time"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completedat","description":"Process completion time"}},"type":"object","title":"ProcessTimings","description":"Represents the actual timings of the call process.\nThis model includes timestamps for various stages of the call process,\nsuch as when the process started, ended, was launched, resumed, or completed."}}}}