{"openapi":"3.1.0","info":{"title":"salesbot.tech","version":"0.1.0"},"paths":{"/api/v1/campaigns/":{"get":{"tags":["campaigns"],"summary":"Read Campaigns","description":"Retrieve campaigns with optional filtering and pagination.\n\nFilters:\n- title: substring match on campaign title (case-insensitive)\n- id: one or more campaign ids (exact match)\n- sub_user_id: one or more sub_user ids (campaigns that any of them have access to)","operationId":"campaigns-read_campaigns","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"title","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Фильтр по ID кампании (можно передать несколько)","title":"Id"},"description":"Фильтр по ID кампании (можно передать несколько)"},{"name":"sub_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Фильтр по сабюзеру (кампании, к которым есть доступ у любого из выбранных)","title":"Sub User Id"},"description":"Фильтр по сабюзеру (кампании, к которым есть доступ у любого из выбранных)"},{"name":"include_archived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"title":"Include Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true},"post":{"tags":["campaigns"],"summary":"Create Campaign","description":"Create new campaign.","operationId":"campaigns-create_campaign","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/campaigns/{id}":{"get":{"tags":["campaigns"],"summary":"Read Campaign","description":"Get campaign by ID.","operationId":"campaigns-read_campaign","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true},"put":{"tags":["campaigns"],"summary":"Update Campaign","description":"Update an campaign.","operationId":"campaigns-update_campaign","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/campaigns/enqueue_calls/{campaign_id}":{"post":{"tags":["campaigns"],"summary":"Initiate Queue Creation","description":"Initiate queue creation for all contacts in a campaign.","operationId":"campaigns-initiate_queue_creation","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"integer","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/contacts/":{"get":{"tags":["contacts"],"summary":"Read Contacts","description":"Retrieve contacts with optional filtering by campaign ID, phone number, status, creation date, and calls attempts.\nSupports pagination.","operationId":"contacts-read_contacts","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Фильтр по ID кампании (можно передать несколько)","title":"Campaign Id"},"description":"Фильтр по ID кампании (можно передать несколько)"},{"name":"phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ContactStatus"}},{"type":"null"}],"title":"Status"}},{"name":"created_at_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At From"}},{"name":"created_at_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At To"}},{"name":"calls_attempts_from","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Attempts From"}},{"name":"calls_attempts_to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Attempts To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true},"post":{"tags":["contacts"],"summary":"Create Contact","description":"Create new contact.","operationId":"contacts-create_contact","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/contacts/campaign/{campaign_id}":{"get":{"tags":["contacts"],"summary":"Read Contacts By Campaign","description":"Retrieve contacts by campaign ID with optional filtering by phone number, status, and calls attempts.\nSupports pagination.","operationId":"contacts-read_contacts_by_campaign","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"integer","title":"Campaign Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":400,"title":"Limit"}},{"name":"phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ContactStatus"}},{"type":"null"}],"title":"Status"}},{"name":"calls_attempts_from","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Attempts From"}},{"name":"calls_attempts_to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Attempts To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/contacts/{id}":{"get":{"tags":["contacts"],"summary":"Read Contact","description":"Get contact by ID.","operationId":"contacts-read_contact","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true},"put":{"tags":["contacts"],"summary":"Update Contact","description":"Update contact.","operationId":"contacts-update_contact","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true},"delete":{"tags":["contacts"],"summary":"Delete Contact","description":"Delete contact.","operationId":"contacts-delete_contact","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/contacts/enqueue_calls/{campaign_id}":{"post":{"tags":["contacts"],"summary":"Enqueue Calls","description":"Enqueue calls for contacts in a campaign with specific status and limit.","operationId":"contacts-enqueue_calls","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"integer","title":"Campaign Id"}},{"name":"status","in":"query","required":true,"schema":{"$ref":"#/components/schemas/ContactStatus"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/contacts/bulk":{"post":{"tags":["contacts"],"summary":"Import Contacts","description":"Создает фоновую задачу для импорта контактов.\nВозвращает ID задачи для отслеживания прогресса.","operationId":"contacts-import_contacts","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ContactBulkCreate"},"type":"array","title":"Contacts"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Contacts-Import Contacts"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"x-public-docs":true}},"/api/v1/calls/":{"get":{"tags":["calls"],"summary":"Read Calls","description":"Retrieve calls with comprehensive filtering options.\nSupports pagination. Only shows calls from campaigns owned by the current user.\n\nAvailable filters:\n- phone_number: Filter by destination phone number\n- from_number: Filter by caller phone number\n- status: Filter by call status\n- action_status: Filter by action status\n- start_time_from/to: Filter by start time range\n- end_time_from/to: Filter by end time range\n- duration_from/to: Filter by call duration range\n- cost_from/to: Filter by call cost range\n- campaign_id: Filter by campaign ID\n- contact_id: Filter by contact ID\n- call_id: Filter by specific call ID\n- call_type: Filter by call type\n- call_data: Search in call data JSON (text search)","operationId":"calls-read_calls","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},{"name":"from_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CallStatus"}},{"type":"null"}],"title":"Status"}},{"name":"start_time_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time From"}},{"name":"start_time_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time To"}},{"name":"end_time_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time From"}},{"name":"end_time_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time To"}},{"name":"duration_from","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration From"}},{"name":"duration_to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration To"}},{"name":"action_status","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ActionStatus"}},{"type":"null"}],"title":"Action Status"}},{"name":"call_data","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Data"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Фильтр по ID кампании (можно передать несколько)","title":"Campaign Id"},"description":"Фильтр по ID кампании (можно передать несколько)"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Contact Id"}},{"name":"call_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Call Id"}},{"name":"call_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Type"}},{"name":"cost_from","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost From"}},{"name":"cost_to","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/calls/{id}":{"get":{"tags":["calls"],"summary":"Read Call","description":"Get a call by ID. Only shows calls from campaigns owned by the current user.","operationId":"calls-read_call","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/contact-creation-integration/create-contact":{"post":{"tags":["contact-creation-integration"],"summary":"Create Contact External","description":"Публичный endpoint для создания контакта(ов) через API интеграцию.\n\nИспользование:\nGET/POST /api/v1/contact-creation-integration/create-contact\n\nАвторизация (приоритет):\n1. Authorization: Bearer <token>\n2. token в JSON body\n3. token в query (legacy, для простых форм)\n\nПоддерживает два режима:\n1. Один контакт: query / JSON object\n2. Массив контактов: JSON array в теле POST\n\nПараметры (для одного контакта):\n- token (обязательно): Токен интеграции из настроек (можно в query или в теле запроса)\n- campaign_id (опционально): ID кампании. Если не указан, используется первая кампания из интеграции\n- name (опционально): Имя контакта (можно в query или в теле запроса). Если не указано, берём из contact_data.name, fio, FIO или famili\n- phone или msisdn (обязательно): Номер телефона контакта (можно в query или в теле запроса). Поддерживаются оба варианта для совместимости\n- contact_data (опционально): Дополнительные поля контакта в JSON-формате\n- timezone (опционально): IANA часовой пояс (Europe/Moscow). Пишется в Contact.timezone, не в contact_data\n- determine_timezone (опционально): true/false — переопределяет настройку интеграции\n\nstart_call:\n- только в JSON body (POST), не из query;\n- если не передан — берётся настройка интеграции «Автоматически начинать звонок»;\n- при обновлении существующего контакта звонок НЕ ставится в очередь повторно.\n\nВозвращает JSON с информацией о созданном/обновлённом контакте и call_enqueued.","operationId":"contact-creation-integration-create_contact_external","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Токен интеграции (legacy). Предпочтительно Authorization: Bearer <token>","title":"Token"},"description":"Токен интеграции (legacy). Предпочтительно Authorization: Bearer <token>"},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"ID кампании (опционально)","title":"Campaign Id"},"description":"ID кампании (опционально)"},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Имя контакта","title":"Name"},"description":"Имя контакта"},{"name":"contact_data","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Дополнительные поля контакта в формате JSON. Пример: {\"source\": \"Landing\"}","title":"Contact Data"},"description":"Дополнительные поля контакта в формате JSON. Пример: {\"source\": \"Landing\"}"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Contact-Creation-Integration-Create Contact External"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true},"get":{"tags":["contact-creation-integration"],"summary":"Create Contact External","description":"Публичный endpoint для создания контакта(ов) через API интеграцию.\n\nИспользование:\nGET/POST /api/v1/contact-creation-integration/create-contact\n\nАвторизация (приоритет):\n1. Authorization: Bearer <token>\n2. token в JSON body\n3. token в query (legacy, для простых форм)\n\nПоддерживает два режима:\n1. Один контакт: query / JSON object\n2. Массив контактов: JSON array в теле POST\n\nПараметры (для одного контакта):\n- token (обязательно): Токен интеграции из настроек (можно в query или в теле запроса)\n- campaign_id (опционально): ID кампании. Если не указан, используется первая кампания из интеграции\n- name (опционально): Имя контакта (можно в query или в теле запроса). Если не указано, берём из contact_data.name, fio, FIO или famili\n- phone или msisdn (обязательно): Номер телефона контакта (можно в query или в теле запроса). Поддерживаются оба варианта для совместимости\n- contact_data (опционально): Дополнительные поля контакта в JSON-формате\n- timezone (опционально): IANA часовой пояс (Europe/Moscow). Пишется в Contact.timezone, не в contact_data\n- determine_timezone (опционально): true/false — переопределяет настройку интеграции\n\nstart_call:\n- только в JSON body (POST), не из query;\n- если не передан — берётся настройка интеграции «Автоматически начинать звонок»;\n- при обновлении существующего контакта звонок НЕ ставится в очередь повторно.\n\nВозвращает JSON с информацией о созданном/обновлённом контакте и call_enqueued.","operationId":"contact-creation-integration-create_contact_external","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Токен интеграции (legacy). Предпочтительно Authorization: Bearer <token>","title":"Token"},"description":"Токен интеграции (legacy). Предпочтительно Authorization: Bearer <token>"},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"ID кампании (опционально)","title":"Campaign Id"},"description":"ID кампании (опционально)"},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Имя контакта","title":"Name"},"description":"Имя контакта"},{"name":"contact_data","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Дополнительные поля контакта в формате JSON. Пример: {\"source\": \"Landing\"}","title":"Contact Data"},"description":"Дополнительные поля контакта в формате JSON. Пример: {\"source\": \"Landing\"}"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Contact-Creation-Integration-Create Contact External"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/analytics/detailed":{"get":{"tags":["analytics"],"summary":"Get Detailed Analytics","description":"Получить детальную аналитику с возможностью фильтрации и сравнения периодов.\n\nПараметры:\n- start_date: Начальная дата для анализа (по умолчанию - месяц назад)\n- end_date: Конечная дата для анализа (по умолчанию - сегодня)\n- campaign_id: ID кампании для фильтрации (по умолчанию - все кампании)\n- call_types: Список типов звонков для фильтрации (можно выбрать несколько)\n- compare_with_previous: Сравнить с предыдущим периодом той же длины","operationId":"analytics-get_detailed_analytics","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Campaign Id"}},{"name":"call_types","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Типы звонков: 'outbound', 'inbound', 'none' (тестовые). Можно выбрать несколько","title":"Call Types"},"description":"Типы звонков: 'outbound', 'inbound', 'none' (тестовые). Можно выбрать несколько"},{"name":"compare_with_previous","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Compare With Previous"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Analytics-Get Detailed Analytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}},"/api/v1/analytics/trends":{"get":{"tags":["analytics"],"summary":"Get Analytics Trends","description":"Получить тренды аналитики за указанный период.\n\nПараметры:\n- start_date: Дата начала периода (ISO формат)\n- end_date: Дата окончания периода (ISO формат)\n- campaign_id: ID кампании для фильтрации (по умолчанию - все кампании)\n- call_types: Список типов звонков для фильтрации (можно выбрать несколько)\n- metric: Метрика для анализа (calls, cost, duration, successful)","operationId":"analytics-get_analytics_trends","security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"campaign_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Campaign Id"}},{"name":"call_types","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Типы звонков: 'outbound', 'inbound', 'none' (тестовые). Можно выбрать несколько","title":"Call Types"},"description":"Типы звонков: 'outbound', 'inbound', 'none' (тестовые). Можно выбрать несколько"},{"name":"metric","in":"query","required":false,"schema":{"type":"string","pattern":"^(calls|cost|duration|successful)$","default":"calls","title":"Metric"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Analytics-Get Analytics Trends"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-public-docs":true}}},"components":{"schemas":{"ActionStatus":{"type":"string","enum":["transferred","scheduled","interested"],"title":"ActionStatus"},"CallEndedBy":{"type":"string","enum":["HUMAN","AI"],"title":"CallEndedBy","description":"Перечисление для определения инициатора завершения звонка.\nИспользуется для аналитики и понимания поведения клиентов."},"CallPublic":{"properties":{"contact_id":{"type":"integer","title":"Contact Id"},"status":{"$ref":"#/components/schemas/CallStatus"},"action_status":{"anyOf":[{"$ref":"#/components/schemas/ActionStatus"},{"type":"null"}]},"action_status_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Status Reason"},"is_archive":{"type":"boolean","title":"Is Archive"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number"},"to_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Number"},"start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"},"id":{"type":"integer","title":"Id"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"cost":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost"},"call_duration":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Call Duration"},"external_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Session Id"},"record_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Url"},"call_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Call Data"},"contact_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Contact Data"},"campaign_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Title"},"call_type":{"anyOf":[{"$ref":"#/components/schemas/CallType"},{"type":"null"}]},"owner_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner Id"},"call_ended_by":{"anyOf":[{"$ref":"#/components/schemas/CallEndedBy"},{"type":"null"}]},"call_ended_by_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Ended By Reason"}},"type":"object","required":["contact_id","status","is_archive","id"],"title":"CallPublic"},"CallStatus":{"type":"string","enum":["new","in progress","finished","failed","busy_or_rejected","invalid number","insufficient funds","rejected","terminated","unavailable","voicemail","silence"],"title":"CallStatus"},"CallType":{"type":"string","enum":["outbound","inbound"],"title":"CallType"},"CallsPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CallPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"type":"object","required":["data","count","pagination"],"title":"CallsPublic"},"CampaignCreate":{"properties":{"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"campaign_type":{"$ref":"#/components/schemas/CampaignType"},"campaign_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Campaign Data"},"campaign_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Phone"},"campaign_sip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Sip"},"assistant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assistant Id"},"max_call_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Call Attempts"},"concurrent_call_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Concurrent Call Limit","default":0},"call_interval":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Call Interval"},"call_allowed_from_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed From Time"},"call_allowed_to_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed To Time"},"work_schedule":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Work Schedule","description":"Расписание работы звонков"},"auto_calls":{"type":"boolean","title":"Auto Calls","default":false},"is_auto_ai_message":{"type":"boolean","title":"Is Auto Ai Message","default":false},"is_archive":{"type":"boolean","title":"Is Archive","default":false},"is_paused":{"type":"boolean","title":"Is Paused","default":false},"limit_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit Start"},"limit_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit End"},"limit_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Value"},"limit_unit":{"anyOf":[{"$ref":"#/components/schemas/LimitUnit"},{"type":"null"}]}},"type":"object","required":["title","campaign_type"],"title":"CampaignCreate"},"CampaignListPublic":{"properties":{"id":{"type":"integer","title":"Id"},"owner_id":{"type":"integer","title":"Owner Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"campaign_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Phone"},"campaign_sip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Sip"},"max_call_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Call Attempts"},"concurrent_call_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Concurrent Call Limit","default":0},"call_interval":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Call Interval"},"campaign_type":{"$ref":"#/components/schemas/CampaignType"},"assistant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assistant Id"},"phone_numbers":{"items":{"$ref":"#/components/schemas/PhoneNumberPublic"},"type":"array","title":"Phone Numbers"},"call_allowed_from_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed From Time"},"call_allowed_to_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed To Time"},"work_schedule":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Work Schedule"},"auto_calls":{"type":"boolean","title":"Auto Calls","default":false},"is_auto_ai_message":{"type":"boolean","title":"Is Auto Ai Message","default":false},"is_archive":{"type":"boolean","title":"Is Archive","default":false},"is_paused":{"type":"boolean","title":"Is Paused","default":false},"limit_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Value"},"limit_unit":{"anyOf":[{"$ref":"#/components/schemas/LimitUnit"},{"type":"null"}]},"limit_usage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Usage"},"limit_reached":{"type":"boolean","title":"Limit Reached","default":false},"sub_users":{"items":{"$ref":"#/components/schemas/SubUserBrief"},"type":"array","title":"Sub Users"}},"type":"object","required":["id","owner_id","title","campaign_type"],"title":"CampaignListPublic","description":"Облегчённая модель для списка кампаний (без campaign_data и prompt_history)."},"CampaignPromptHistoryPublic":{"properties":{"id":{"type":"integer","title":"Id"},"campaign_id":{"type":"integer","title":"Campaign Id"},"prompt_data":{"type":"object","title":"Prompt Data"},"created_by_sub_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By Sub User Id"},"created_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"status":{"$ref":"#/components/schemas/PromptHistoryStatus"},"created_by_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Email"},"created_by_user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Full Name"},"created_by_sub_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Sub User Email"},"created_by_sub_user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Sub User Full Name"},"approved_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approved By User Id"},"approved_by_sub_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Approved By Sub User Id"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"approval_comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Comment"},"approved_by_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Email"},"approved_by_user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By User Full Name"},"approved_by_sub_user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By Sub User Email"},"approved_by_sub_user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By Sub User Full Name"}},"type":"object","required":["id","campaign_id","prompt_data","created_at","status"],"title":"CampaignPromptHistoryPublic"},"CampaignPublic":{"properties":{"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"campaign_type":{"$ref":"#/components/schemas/CampaignType"},"campaign_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Campaign Data"},"id":{"type":"integer","title":"Id"},"owner_id":{"type":"integer","title":"Owner Id"},"campaign_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Phone"},"campaign_sip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Sip"},"max_call_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Call Attempts"},"concurrent_call_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Concurrent Call Limit","default":0},"call_interval":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Call Interval"},"assistant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assistant Id"},"phone_numbers":{"items":{"$ref":"#/components/schemas/PhoneNumberPublic"},"type":"array","title":"Phone Numbers"},"call_allowed_from_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed From Time"},"call_allowed_to_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed To Time"},"work_schedule":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Work Schedule","description":"Расписание работы звонков"},"auto_calls":{"type":"boolean","title":"Auto Calls","default":false},"is_auto_ai_message":{"type":"boolean","title":"Is Auto Ai Message","default":false},"is_archive":{"type":"boolean","title":"Is Archive","default":false},"is_paused":{"type":"boolean","title":"Is Paused","default":false},"limit_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit Start"},"limit_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit End"},"limit_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Value"},"limit_unit":{"anyOf":[{"$ref":"#/components/schemas/LimitUnit"},{"type":"null"}]},"limit_usage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Usage"},"limit_reached":{"type":"boolean","title":"Limit Reached","default":false},"sub_users":{"items":{"$ref":"#/components/schemas/SubUserBrief"},"type":"array","title":"Sub Users"},"prompt_history":{"items":{"$ref":"#/components/schemas/CampaignPromptHistoryPublic"},"type":"array","title":"Prompt History"}},"type":"object","required":["title","campaign_type","id","owner_id"],"title":"CampaignPublic"},"CampaignType":{"type":"string","enum":["Outbound","Inbound"],"title":"CampaignType"},"CampaignUpdate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"campaign_type":{"anyOf":[{"$ref":"#/components/schemas/CampaignType"},{"type":"null"}]},"campaign_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Campaign Data"},"campaign_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Phone"},"campaign_sip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Sip"},"assistant_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assistant Id"},"max_call_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Call Attempts"},"concurrent_call_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Concurrent Call Limit","default":0},"call_interval":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Call Interval"},"call_allowed_from_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed From Time"},"call_allowed_to_time":{"anyOf":[{"type":"string","format":"time"},{"type":"null"}],"title":"Call Allowed To Time"},"work_schedule":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Work Schedule","description":"Расписание работы звонков"},"auto_calls":{"type":"boolean","title":"Auto Calls","default":false},"is_auto_ai_message":{"type":"boolean","title":"Is Auto Ai Message","default":false},"is_archive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Archive"},"is_paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Paused"},"limit_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit Start"},"limit_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit End"},"limit_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Value"},"limit_unit":{"anyOf":[{"$ref":"#/components/schemas/LimitUnit"},{"type":"null"}]}},"type":"object","title":"CampaignUpdate"},"CampaignsPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CampaignListPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"CampaignsPublic"},"ContactBulkCreate":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"status":{"type":"string","title":"Status","default":"new"},"campaign_id":{"type":"integer","title":"Campaign Id"},"contact_data":{"type":"object","title":"Contact Data"}},"type":"object","required":["phone_number","campaign_id"],"title":"ContactBulkCreate"},"ContactCreate":{"properties":{"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"status":{"$ref":"#/components/schemas/ContactStatus"},"contact_data":{"type":"object","title":"Contact Data"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"creation_method":{"anyOf":[{"$ref":"#/components/schemas/ContactCreationMethod"},{"type":"null"}]},"campaign_id":{"type":"integer","title":"Campaign Id"},"phone_number":{"type":"string","title":"Phone Number"},"next_action_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action Time"},"next_action_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Action Reason"}},"type":"object","required":["status","campaign_id","phone_number"],"title":"ContactCreate"},"ContactCreationMethod":{"type":"string","enum":["manual","import","integration","external_api","integration_messaging"],"title":"ContactCreationMethod"},"ContactPublic":{"properties":{"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"status":{"type":"string","title":"Status"},"contact_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Contact Data"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"creation_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Creation Method"},"id":{"type":"integer","title":"Id"},"campaign_id":{"type":"integer","title":"Campaign Id"},"phone_number":{"type":"string","title":"Phone Number"},"campaign_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Title"},"calls_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Attempts"},"message_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Attempts"},"next_action_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action Time"},"next_action_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Action Reason"}},"type":"object","required":["status","id","campaign_id","phone_number"],"title":"ContactPublic"},"ContactStatus":{"type":"string","enum":["new","in progress","finished","failed","busy","not_reached","invalid_number","do_not_disturb","paused","added_to_queue","call_scheduled","no_answer","awaiting_queue"],"title":"ContactStatus"},"ContactUpdate":{"properties":{"status":{"$ref":"#/components/schemas/ContactStatus"},"phone_number":{"type":"string","title":"Phone Number"},"contact_data":{"type":"object","title":"Contact Data"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"next_action_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action Time"},"next_action_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Action Reason"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","title":"ContactUpdate"},"ContactsPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ContactPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"ContactsPublic"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LimitUnit":{"type":"string","enum":["contacts","minutes","cost"],"title":"LimitUnit"},"Message":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"message":{"type":"string","title":"Message"},"user_id":{"type":"integer","title":"User Id"},"campaign_id":{"type":"integer","title":"Campaign Id"},"contact_id":{"type":"integer","title":"Contact Id"},"call_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Call Id"},"role_id":{"type":"string","title":"Role Id"},"source":{"type":"string","title":"Source"},"create_datetime":{"type":"string","format":"date-time","title":"Create Datetime"},"message_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Message Data"}},"type":"object","required":["message","user_id","campaign_id","contact_id","call_id","role_id","source"],"title":"Message"},"Pagination":{"properties":{"current_page":{"type":"integer","title":"Current Page"},"total_pages":{"type":"integer","title":"Total Pages"},"total_count":{"type":"integer","title":"Total Count"}},"type":"object","required":["current_page","total_pages","total_count"],"title":"Pagination"},"PhoneNumberPublic":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"campaign_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Campaign Id"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"owner_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner Id"},"id":{"type":"integer","title":"Id"},"campaign_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Title"}},"type":"object","required":["phone_number","id"],"title":"PhoneNumberPublic"},"PromptHistoryStatus":{"type":"string","enum":["pending","approved","rejected","auto_approved"],"title":"PromptHistoryStatus"},"SubUserBrief":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id","username"],"title":"SubUserBrief"},"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"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}}}}