# Adapt Mail API 0.16.0 https://adapt-mail.com/ru/docs/ # Документация Adapt Mail ## Почта для вашего продукта Подключите свой интерфейс к ящикам Adapt Mail: читайте и отправляйте письма, показывайте диалоги, управляйте файлами, контактами и правилами отправителей. Создавайте аккаунты, подключайте домены, оплачивайте ящики и увеличивайте их объём в личном кабинете, где вы подключили почту. Почтовый API позволяет работать с уже созданными ящиками. ## Начните с авторизации Для серверной интеграции используйте почтовый API-ключ вместе с X-Customer-ID. Для входа конкретного пользователя получите Bearer-токен по его логину и паролю. ``` GET /v1/mailboxes X-API-Key: X-Customer-ID: ``` ## Первый запрос Базовый адрес API — https://adapt-mail.com. Все запросы выполняются по HTTPS. Для JSON-запросов укажите Content-Type: application/json. Получите токен по логину и паролю почтового аккаунта. Затем запросите список ящиков и сохраните id нужного ящика: он используется как mailbox_id в адресах запросов. Значения в угловых скобках замените своими данными. ``` curl https://adapt-mail.com/v1/auth/token \ -H "Content-Type: application/json" \ --data '{"login":"","password":"","mode":"account"}' curl https://adapt-mail.com/v1/mailboxes \ -H "Authorization: Bearer " ``` ## Форматы документации Схема OpenAPI описывает параметры запросов и ответы. Файл llms-full.txt содержит полный справочник в текстовом формате. Ссылки для скачивания доступны в начале каждой страницы. # Авторизация и области доступа ## Вход по ссылке Сервер партнёра вызывает POST /v1/auth/login-link с X-API-Key и X-Customer-ID. Укажите mailbox_id для входа только в этот ящик; без него откроется весь аккаунт. locale выбирает язык интерфейса. Ответ содержит login_url, expires_in=300, expires_at (UTC), account_id и mailbox_id. Кнопка «Войти в почту» открывает login_url целиком, включая #token. Ссылка действует 5 минут и только один раз. Не сохраняйте её в логах и не передавайте API-ключ в браузер. Страница входа удаляет токен из адресной строки и обменивает его на HttpOnly cookies. При ошибке или истечении срока создайте новую ссылку. Область доступа, состояние аккаунта и ящика проверяются повторно. Пользовательские сессии не могут выпускать ссылки. ``` curl https://adapt-mail.com/v1/auth/login-link \ -H "X-API-Key: " \ -H "X-Customer-ID: " \ -H "Content-Type: application/json" \ --data '{"mailbox_id":42,"locale":"en"}' { "login_url": "https://adapt-mail.com/auth/#token=", "expires_in": 300, "expires_at": "2026-10-20T12:05:00Z", "account_id": 123, "mailbox_id": 42 } ``` ## Ключ партнёра Используйте почтовый API-ключ вашей интеграции. Передавайте его в X-API-Key, а ID почтового аккаунта — в обязательном заголовке X-Customer-ID. Это ID аккаунта, а не external_id и не ID ящика. Ключ открывает доступ только к клиентам вашей интеграции. Храните ключ на сервере партнёра. Не помещайте общий ключ интеграции в браузер или мобильное приложение. ``` curl 'https://adapt-mail.com/v1/mailboxes' \ -H 'X-API-Key: ' \ -H 'X-Customer-ID: ' ``` ## Токен пользователя POST /v1/auth/token принимает login, password и mode. Для mode=account используется логин user-ID, для mode=mailbox — полный адрес ящика. Пароли аккаунта и ящика независимы. Ответ содержит access_token, token_type=Bearer и expires_in=3600. Токен аккаунта открывает его ящики; токен ящика — только один ящик. После истечения получите новый токен. ``` POST /v1/auth/token Content-Type: application/json {"login":"user-123","password":"","mode":"account"} GET /v1/mailboxes Authorization: Bearer ``` ## Браузерные сессии POST /v1/auth/login предназначен для собственного сайта adapt-mail.com. Он требует правильный Origin и устанавливает HttpOnly cookies. Несекретный X-Mail-Session выбирает один из сохранённых входов, но без cookie не даёт доступа. Для стороннего фронтенда используйте свой сервер и токен пользователя. Не рассчитывайте на произвольный междоменный доступ с cookie: публичного CORS для любого сайта нет. # Отправка и операции ## Поставить письмо в очередь Получите ID ящика из GET /v1/mailboxes. Создайте уникальный Idempotency-Key для одной отправки и сохраните его до окончательного результата. При сетевом повторе используйте тот же ключ и то же тело. HTTP 202 возвращает объект операции, а не подтверждение доставки. Поле id содержит ID операции. Опросите GET /v1/operations/{operation_id}. ``` POST /v1/mailboxes/42/send Idempotency-Key: message-20261019-0001 Content-Type: application/json {"to":["team@example.com"],"subject":"Hello","text":"A message from Adapt Mail"} ``` ## Как понимать результат - `queued` — Письмо ожидает отправки. - `running` — Отправка выполняется. - `succeeded` — Почтовый сервер принял отправку. Проверьте результат для каждого получателя. - `failed` — Отправка завершилась ошибкой. Причина указана в error. - `cancelled` — Отправка отменена. - `uncertain` — Не удалось подтвердить результат отправки. Проверьте операцию и папку отправленных перед новой попыткой. После успешной отправки поле result содержит accepted_recipients — принятых получателей, rejected_recipients — отклонённых получателей и sent_saved — результат сохранения копии в отправленных. Принятие письма почтовым сервером не гарантирует доставку во входящие получателя. Для отмены ожидающей отправки выполните POST /v1/operations/{operation_id}/cancel. Метод /retry не отправляет письма повторно. ## Ответ, пересылка и отложенная отправка Для ответа укажите message_id исходного письма в reply_to_message_id и передайте его references. В to укажите адрес для ответа из reply_to или адрес отправителя. Для ответа всем добавьте остальных участников в to и cc, исключив собственный адрес. Для пересылки вложений передайте forward_message с folder, uidvalidity и uid. Для своих загруженных файлов используйте file_ids. Общий размер вложений ограничен 25 МиБ. send_at задаётся с часовым поясом, хранится в UTC; отложенная отправка доступна в пределах года. Лимиты проверяются при фактической отправке, а не при создании очереди. # Отправка через SMTP ## Что нужно для подключения Отправляйте письма из приложения через SMTP с логином и паролем ящика. API-ключ и токен аккаунта для SMTP не подходят. Создайте активный ящик на подключённом домене и завершите проверку его DNS-записей. Логин — полный адрес, например noreply@example.com. Пароль — пароль этого ящика, а не почтового аккаунта. В примерах замените адреса своими; пароль вводится скрыто при запуске. ## Сервер, порты и шифрование Используйте mail.adapt-mail.com для любого подключённого домена. На порту 465 TLS включается сразу; на порту 587 сначала выполняется STARTTLS, затем авторизация. Выберите один вариант. Проверку сертификата отключать не нужно. Адрес From и SMTP-отправитель в примерах совпадают с логином ящика. Имя отправителя можно изменить. Порт 25 предназначен для обмена между почтовыми серверами, для приложения используйте 465 или 587. ``` SMTP_HOST = "mail.adapt-mail.com" SMTP_PORT = 465 SMTP_USER = "noreply@example.com" SMTP_PASSWORD = "" SMTP_FROM = "noreply@example.com" SMTP_FROM_NAME = "Example" 465: implicit TLS 587: STARTTLS ``` ## Python: отправка через порт 465 Пример использует только стандартную библиотеку Python 3. Сохраните его в send_mail.py и запустите python3 send_mail.py. Для автоматической отправки получайте пароль из защищённой конфигурации вашего приложения; не сохраняйте его в Git или логах. ``` import smtplib import ssl from getpass import getpass from email.message import EmailMessage from email.utils import formataddr, make_msgid, formatdate username = "noreply@example.com" password = getpass("SMTP password: ") recipient = "recipient@example.net" message = EmailMessage() message["From"] = formataddr(("Example", username)) message["To"] = recipient message["Subject"] = "SMTP test" message["Date"] = formatdate(localtime=False, usegmt=True) message["Message-ID"] = make_msgid(domain=username.split("@")[1]) message.set_content("Hello! This message was sent through Adapt Mail SMTP.") with smtplib.SMTP_SSL( "mail.adapt-mail.com", 465, timeout=30, context=ssl.create_default_context(), ) as smtp: smtp.login(username, password) refused = smtp.send_message( message, from_addr=username, to_addrs=[recipient], ) print("Rejected recipients:", refused) ``` ## Python: подключение через порт 587 Для STARTTLS используйте подготовку письма из предыдущего примера и замените блок with smtplib.SMTP_SSL на следующий. В smtplib.SMTP пароль передаётся только после успешного STARTTLS. ``` with smtplib.SMTP("mail.adapt-mail.com", 587, timeout=30) as smtp: smtp.ehlo() smtp.starttls(context=ssl.create_default_context()) smtp.ehlo() smtp.login(username, password) refused = smtp.send_message( message, from_addr=username, to_addrs=[recipient], ) print("Rejected recipients:", refused) ``` ## HTML и вложения Добавьте HTML-версию после set_content, а вложение — перед отправкой. Текстовую версию оставьте для клиентов без HTML. Передавайте только доверенный HTML или экранируйте подставляемые данные. ``` message.add_alternative( "

Hello! This message was sent through Adapt Mail.

", subtype="html", ) with open("document.pdf", "rb") as attachment: message.add_attachment( attachment.read(), maintype="application", subtype="pdf", filename="document.pdf", ) ``` ## Результат, лимиты и отправленные Успешный send_message означает, что SMTP-сервер принял письмо, а не что оно попало во входящие получателя. Словарь refused содержит отклонённых получателей; при отказе всем получателям Python выбросит SMTPRecipientsRefused. SMTP и API используют общие лимиты одного ящика: до 30 писем за скользящие 60 секунд, до 50 получателей в одном письме и до 1000 получателей за скользящие 24 часа; при включённом повышенном лимите — 5000. Считаются все адресаты To, Cc и Bcc. Прямая отправка через SMTP сама по себе не сохраняет копию в папке «Отправленные». Это делает почтовый клиент через IMAP; отправка через API Adapt Mail сохраняет копию отдельно. ## Ошибки SMTP - `535` — Авторизация не прошла: проверьте полный адрес, пароль ящика и доступность ящика. - `451` — Временный отказ, в том числе при превышении лимита отправки. Повторите позже с задержкой. - `550 / 5xx` — Постоянный отказ: проверьте адреса, права отправителя и текст ответа. Более 50 получателей отклоняются после DATA. Исправьте причину перед повтором. - `TLS / timeout` — Проверьте имя mail.adapt-mail.com, порт, режим TLS и исходящий доступ с сервера приложения. На 465 используйте SMTP_SSL, на 587 — SMTP с STARTTLS. Читайте полный ответ SMTP-сервера. Временный отказ повторяйте с задержкой. Если соединение оборвалось после передачи письма и итог неизвестен, не отправляйте его повторно вслепую: в SMTP нет Idempotency-Key, повтор может создать дубликат. # Письма и диалоги ## Список и страницы GET /v1/mailboxes/{mailbox_id}/folders возвращает папки с общим количеством писем total, количеством непрочитанных unread и значением uidvalidity. Для списка писем используйте GET /v1/mailboxes/{mailbox_id}/messages: ответ содержит items, next_before и uidvalidity, до 40 писем на страницу. Передавайте next_before как before следующего запроса. null означает конец списка. Поиск q ограничен 200 символами и выполняется по содержимому почты. ``` GET /v1/mailboxes/42/messages?folder=INBOX GET /v1/mailboxes/42/messages?folder=INBOX&before=120 ``` ## Идентификаторы писем uid — идентификатор письма внутри папки, folder — имя папки, mailbox_id — ID ящика. Значение uidvalidity определяет версию нумерации писем в папке. Берите все четыре значения из ответа API и храните вместе. Если uidvalidity изменился, заново загрузите список писем этой папки: старые uid больше нельзя использовать. Чтение содержимого не отмечает письмо прочитанным. Для отметки выполните POST /v1/mailboxes/{mailbox_id}/messages/actions с action=read. ``` POST /v1/mailboxes/42/messages/actions {"folder":"INBOX","uidvalidity":123456,"uids":[120],"action":"read"} ``` ## Переписка как диалог GET /v1/mailboxes/{mailbox_id}/threads возвращает до 100 диалогов. Передайте thread_id выбранного диалога в GET /v1/mailboxes/{mailbox_id}/threads/{thread_id}, чтобы получить его письма от старых к новым. Новое письмо может появиться в диалоге с небольшой задержкой. Обновите список; для проверки отправки используйте состояние операции. Повторно отправлять письмо из-за задержки отображения не нужно. # Лимиты и хранение ## Общие лимиты SMTP и API Обычный ящик: 1000 получателей за скользящие 24 часа. Ящик с outbound_high_limit=true: 5000. До 30 писем за скользящие 60 секунд; до 50 получателей суммарно в To, Cc и Bcc одного письма. Учитываются принятые SMTP-получатели, включая внутренние адреса и повторы адресатов в разных письмах. Отдельного часового ограничения нет. Это расход разрешений на отправку, а не статистика доставленных писем. GET /v1/mailboxes возвращает предел, расход и остаток обоих окон. Для лимита получателей одного письма накопительного расхода нет. При недоступности счётчика сервер возвращает 503, а не нулевой расход. ``` { "outbound_daily_recipient_limit": 1000, "outbound_daily_recipients_used": 120, "outbound_daily_recipients_remaining": 880, "outbound_messages_per_minute": 30, "outbound_minute_messages_used": 2, "outbound_minute_messages_remaining": 28, "outbound_recipients_per_message": 50 } ``` ## Превышение лимита API-отправка может получить 202, а позднее завершиться failed с mail_daily_limit_exceeded или mail_minute_limit_exceeded. Более 50 адресатов отклоняются сразу с 422. SMTP возвращает временный отказ 451 при превышении окна и 550 после DATA при более чем 50 получателях. Обхода лимита через другой протокол нет. ## Почта и файлы quota_mb — общий объём для писем и файлов в МиБ. used_bytes — всё занятое место в байтах. storage_shared=true; file_quota_bytes равен quota_mb × 1048576 и не добавляется к нему. file_used_bytes — исходный размер загруженных файлов, уже включённых в общий расход. Файлы хранятся вместе с почтой на наших дисках. Общая квота учитывает MIME-кодирование и заголовки. Копия вложения в отправленном письме занимает дополнительное место. Внешний IMAP-клиент видит служебную папку Adapt Files: её удаление удалит сохранённые файлы. Продление и увеличение объёма доступны в личном кабинете, где вы подключили почту. После окончания оплаченного срока чтение и отправка блокируются. Через 24 часа начинается удаление ящика; продлите подписку до этого срока. # События и вебхуки ## Подключение вебхуков Укажите адрес для получения вебхуков в настройках вашей интеграции. На него будут приходить уведомления о новых письмах, состоянии ящиков и результатах операций. В настройках интеграции задайте отдельный секрет вебхуков и включите доставку. Этот секрет используется для проверки подписи уведомлений; почтовый API-ключ для этого не подходит. ## Формат уведомления Уведомление приходит HTTP POST-запросом с Content-Type: application/json. Поле event содержит тип события, timestamp — время уведомления, data — данные события. Состав data зависит от события. Идентификатор data.event_id позволяет распознать повторную доставку. Сохраняйте его вместе с идентификатором вашей интеграции и обрабатывайте одно событие только один раз. ``` { "event": "mail.message.received", "timestamp": "2026-11-01T12:00:00Z", "data": { "event_id": "00000000-0000-4000-8000-000000000001", "created_at": "2026-11-01T12:00:00Z", "mailbox_id": 42, "folder": "INBOX", "uidvalidity": 123456, "uid": 120 } } ``` ## Проверка и подтверждение Заголовок X-Webhook-Signature содержит HMAC-SHA256 в шестнадцатеричной записи нижнего регистра. Рассчитайте подпись по исходным байтам тела запроса и секрету вебхуков. Проверяйте подпись до обработки данных; повторная сериализация JSON изменит подписываемые байты. После проверки подписи и сохранения события верните HTTP 200 или 201. Ответы 202 и 204 не подтверждают получение. Ответьте в течение 10 секунд; длительную обработку выполните после сохранения события. Уведомления могут приходить повторно и не по порядку. Перед изменением состояния подписки сверяйте её текущие данные. История доставки доступна в настройках интеграции. ## Какие события возникают - `mailbox.created` — Ящик создан и готов к использованию. - `mailbox.expiring` — Приближается окончание оплаченного срока ящика. - `mailbox.renewed` — Оплаченный срок ящика продлён. - `mailbox.suspended` — Доступ к ящику приостановлен: чтение и отправка недоступны. - `mailbox.resumed` — Доступ к ящику восстановлен. - `mailbox.deleting_soon` — До удаления неоплаченного ящика остался один час. - `mailbox.deleted` — Ящик удалён. - `mailbox.account_changed` — Ящик привязан к другому почтовому аккаунту. - `mail.message.received` — В ящике появилось новое входящее письмо. - `mail.operation.succeeded` — Операция завершилась успешно. Для отправки это означает принятие письма почтовым сервером, а не доставку во входящие получателя. - `mail.operation.failed` — Операция завершилась ошибкой. - `mail.operation.uncertain` — Результат отправки неизвестен. Проверьте состояние перед повторной отправкой. Напоминания об оплате: за 14, 7, 3, 2, 1 день и за час до истечения. Продление отменяет ещё не отправленные устаревшие напоминания. # Ошибки и повторы ## Формат ошибки Ответ ошибки содержит detail: строку, объект с code/message либо список ошибок валидации. Не определяйте поведение по переведённому тексту: используйте HTTP-статус и машинный code, когда он присутствует. ``` {"detail":"..."} {"detail":{"code":"...","message":"..."}} ``` ## Коды HTTP - `400` — Неверный заголовок или идентификатор. Проверьте запрос. - `401` — Сессия или ключ не приняты. Выполните вход заново или проверьте ключ. - `403` — Недостаточно прав или доступ к ящику закрыт. - `404` — Ресурс не найден или недоступен текущему аккаунту. - `409` — Конфликт состояния, квоты или поколения папки. Обновите данные перед повтором. - `413` — Размер файла превышает допустимый предел. - `422` — Неверные параметры запроса. Проверьте поля, указанные в ответе. - `429` — Слишком много запросов. Повторите запрос позже. - `503` — Сервис временно недоступен. Повторите запрос с задержкой. После 401 требуется новый вход. После 409 перечитайте состояние. После 503 повторяйте с задержкой; для отправки сохраняйте прежний Idempotency-Key. Не повторяйте необратимые действия вслепую. # Подключённые приложения ## Подключить приложение Подключите ИИ-клиент по этому адресу. Ящики и разрешения выбираются при подключении. Разрешите доступ только к нужным ящикам и действиям. ``` URL / Resource: https://adapt-mail.com/mcp Transport: Streamable HTTP Authorization: OAuth 2.1 / PKCE S256 OAuth discovery: /.well-known/oauth-authorization-server Resource metadata: /.well-known/oauth-protected-resource/mcp ``` ## Разрешения - `mail.read` — Поиск и чтение писем, переписки и вложений. - `mail.send` — Отправка писем, ответов и пересылка. - `mail.manage` — Черновики, файлы, папки, прочитанное, важное, архив и спам. - `mail.delete` — Корзина, окончательное удаление писем, черновиков и файлов. ## Отозвать доступ Доступ действует 30 дней. Его можно отозвать в настройках в любой момент. # Настройки ящика ## Шаблоны писем До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам. Шаблон заменит текст редактора. Получатели и вложения сохранятся. ``` POST /v1/mailboxes/42/templates Content-Type: application/json {"name":"Welcome","subject":"Welcome","text":"Thank you for joining us.","html":"

Thank you for joining us.

"} ``` ## Автоответчик Автоответы работают при закрытом браузере и расходуют общий лимит отправки. Рассылки и автоматические письма исключены. Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path. ``` PUT /v1/mailboxes/42/autoresponder Content-Type: application/json {"enabled":true,"subject":"Away","text":"I will reply when I return.","starts_at":null,"ends_at":null,"repeat_days":7} ``` ## Фильтры До 100 фильтров на ящик и 20 условий в фильтре. Условия сравнивают полные заголовки; регистр ASCII игнорируется, для остальных символов учитывается. Срабатывает первый подходящий фильтр. Правила отправителей имеют приоритет. Применение к старым письмам запускается отдельно. Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}. Будут обработаны входящие и пользовательские папки. Отправленные, черновики, спам и корзина исключены. ``` POST /v1/mailboxes/42/filters Content-Type: application/json {"name":"Invoices","enabled":true,"match":"all","conditions":[{"field":"subject","operator":"contains","value":"Invoice"}],"mark_read":false,"important":true,"trash":false,"move_to":null} POST /v1/mailboxes/42/filters/17/apply Idempotency-Key: apply-filter-0001 ``` ## Предпросмотр - `file_infected` — В файле обнаружена угроза. Открытие заблокировано. - `file_scan_unavailable` — Антивирус временно недоступен. Повторите позже. Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик. X-File-Scan: clean и X-File-Scanned-At показывают результат и время проверки. scanned_at в списке файлов может быть null. Результат кешируется на час; при угрозе или недоступном антивирусе файл не выдаётся. ``` GET /v1/mailboxes/42/files//content?preview=pdf X-File-Scan: clean X-File-Scanned-At: 2026-10-22T12:00:00Z ``` # POST /v1/auth/login Вход в браузере Маршрут предназначен для adapt-mail.com и требует Origin: https://adapt-mail.com. Возвращает HttpOnly cookies и несекретный session_id. Для своего клиента используйте /v1/auth/token. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/login' \ -H 'Origin: https://adapt-mail.com' \ -c cookies.txt \ -H 'Content-Type: application/json' \ --data '{"login":"user-123","password":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Вход в браузере", "operationId": "login_v1_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "session_id": { "type": "string", "format": "uuid" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "Слишком много запросов", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Маршрут предназначен для adapt-mail.com и требует Origin: https://adapt-mail.com. Возвращает HttpOnly cookies и несекретный session_id. Для своего клиента используйте /v1/auth/token.", "security": [] } ``` # POST /v1/auth/token Получение токена пользователя Выдаёт токен доступа на один час по логину и паролю. Укажите mode=account для доступа ко всем ящикам аккаунта или mode=mailbox для доступа к одному адресу. Передавайте access_token в заголовке Authorization: Bearer . ```sh curl -X POST 'https://adapt-mail.com/v1/auth/token' \ -H 'Content-Type: application/json' \ --data '{"login":"user-123","password":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Получение токена пользователя", "operationId": "token_v1_auth_token_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string", "const": "Bearer" }, "expires_in": { "type": "integer", "const": 3600 }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "Слишком много запросов", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Выдаёт токен доступа на один час по логину и паролю. Укажите mode=account для доступа ко всем ящикам аккаунта или mode=mailbox для доступа к одному адресу. Передавайте access_token в заголовке Authorization: Bearer .", "security": [] } ``` # GET /v1/auth/sessions Сохранённые входы Требуется cookie mail_browser. X-API-Key и Bearer не заменяют эту cookie. Без cookie возвращается пустой список. ```sh curl -X GET 'https://adapt-mail.com/v1/auth/sessions' \ -b cookies.txt ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Сохранённые входы", "operationId": "sessions_v1_auth_sessions_get", "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "session_id": { "type": "string" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "login": { "type": "string" }, "name": { "type": "string" } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Требуется cookie mail_browser. X-API-Key и Bearer не заменяют эту cookie. Без cookie возвращается пустой список.", "security": [ { "Browser": [] } ] } ``` # POST /v1/auth/logout Выход из сессии Только пользовательская сессия. Отзывает выбранный вход; остальные входы сохраняются. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/logout' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Выход из сессии", "operationId": "logout_v1_auth_logout_post", "security": [ { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "logged_out": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Только пользовательская сессия. Отзывает выбранный вход; остальные входы сохраняются." } ``` # GET /v1/me Профиль пользователя Возвращает профиль текущего почтового аккаунта. Используйте его для отображения имени и логина пользователя в своём приложении. ```sh curl -X GET 'https://adapt-mail.com/v1/me' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Профиль пользователя", "operationId": "me_v1_me_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "type": "string" }, "verified": { "type": "boolean" }, "quota_mb": { "type": "integer" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "auth_type": { "type": "string" }, "login": { "type": "string" }, "is_admin": { "type": "boolean" }, "files_enabled": { "type": "boolean" }, "service_managed": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает профиль текущего почтового аккаунта. Используйте его для отображения имени и логина пользователя в своём приложении." } ``` # GET /v1/avatars/{domain} Логотип домена 200 — изображение; 202 — подготовка, повтор через Retry-After; 204 — логотип отсутствует; 503 — временная ошибка. Логотип не подтверждает личность отправителя. ```sh curl -X GET 'https://adapt-mail.com/v1/avatars/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Логотипы доменов" ], "summary": "Логотип домена", "operationId": "avatar_v1_avatars__domain__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "domain", "in": "path", "required": true, "schema": { "type": "string", "title": "Domain" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "image/png": { "schema": { "type": "string", "format": "binary" } } } }, "202": { "description": "Логотип подготавливается" }, "204": { "description": "Логотип отсутствует" }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "Слишком много запросов", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "200 — изображение; 202 — подготовка, повтор через Retry-After; 204 — логотип отсутствует; 503 — временная ошибка. Логотип не подтверждает личность отправителя." } ``` # GET /v1/domains Список доменов Доступны собственные домены и общий домен для создания личного адреса. ```sh curl -X GET 'https://adapt-mail.com/v1/domains' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "Список доменов", "operationId": "list_domains_v1_domains_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Domain" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Доступны собственные домены и общий домен для создания личного адреса." } ``` # GET /v1/domains/{domain_id}/dns DNS-записи домена Инструкции содержат точные DNS-значения и результат проверки, но не меняют DNS автоматически. ```sh curl -X GET 'https://adapt-mail.com/v1/domains//dns' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "DNS-записи домена", "operationId": "domain_dns_v1_domains__domain_id__dns_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "domain_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Domain Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "domain_id": { "type": "integer" }, "status": { "type": "string" }, "records": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "name": { "type": "string" }, "value": { "type": "string" }, "observed": { "type": "array", "items": { "type": "string" } }, "matches": { "type": "boolean" }, "error": { "type": "string" } } } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Инструкции содержат точные DNS-значения и результат проверки, но не меняют DNS автоматически." } ``` # GET /v1/mailboxes Список ящиков и расход лимитов Список ящиков ограничен владельцем либо единственным ящиком пользовательской сессии. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "Список ящиков и расход лимитов", "operationId": "list_mailboxes_v1_mailboxes_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Mailbox" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Список ящиков ограничен владельцем либо единственным ящиком пользовательской сессии." } ``` # PATCH /v1/mailboxes/{mailbox_id} Настройки почтового ящика Через /v1 можно менять name, password и signature. Общая квота quota_mb меняется через панель хостинга. Отдельной квоты для файлов нет. Idempotency-Key необязателен, но рекомендуется для повторов. ```sh curl -X PATCH 'https://adapt-mail.com/v1/mailboxes/' \ -H 'Authorization: Bearer ' \ -H 'Idempotency-Key: message-20261019-0001' \ -H 'Content-Type: application/json' \ --data '{"name":"Support","signature":"Support team"}' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "Настройки почтового ящика", "operationId": "update_mailbox_v1_mailboxes__mailbox_id__patch", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "in": "header", "name": "Idempotency-Key", "required": false, "schema": { "type": "string", "minLength": 8, "maxLength": 128 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxUpdate" } } } }, "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "400": { "description": "Некорректный заголовок или идентификатор", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Через /v1 можно менять name, password и signature. Общая квота quota_mb меняется через панель хостинга. Отдельной квоты для файлов нет. Idempotency-Key необязателен, но рекомендуется для повторов." } ``` # GET /v1/mailboxes/{mailbox_id}/folders Папки и счётчики Возвращает список папок, количество писем total, количество непрочитанных unread и значение uidvalidity для каждой папки. Используйте имя папки и uidvalidity в запросах к её письмам. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//folders' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Папки и счётчики", "operationId": "folders_v1_mailboxes__mailbox_id__folders_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "flags": { "type": "array", "items": { "type": "string" } }, "total": { "type": "integer" }, "unread": { "type": "integer" }, "uidvalidity": { "type": "integer" } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает список папок, количество писем total, количество непрочитанных unread и значение uidvalidity для каждой папки. Используйте имя папки и uidvalidity в запросах к её письмам." } ``` # POST /v1/mailboxes/{mailbox_id}/folders Создание папки Пользовательская папка создаётся в IMAP и доступна другим почтовым клиентам. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//folders' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Создание папки", "operationId": "create_folder_v1_mailboxes__mailbox_id__folders_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NameInput" } } } }, "responses": { "201": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Пользовательская папка создаётся в IMAP и доступна другим почтовым клиентам." } ``` # GET /v1/mailboxes/{mailbox_id}/messages Список писем Возвращает до 40 писем, от новых UID к старым. Для следующей страницы передайте next_before как before. При next_before=null страниц больше нет. Чтение не устанавливает флаг прочтения. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Список писем", "operationId": "messages_v1_mailboxes__mailbox_id__messages_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "q", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 200, "default": "", "title": "Q" } }, { "name": "before", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "title": "Before" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/MessageSummary" } }, "next_before": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "uidvalidity": { "type": "integer" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает до 40 писем, от новых UID к старым. Для следующей страницы передайте next_before как before. При next_before=null страниц больше нет. Чтение не устанавливает флаг прочтения." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid} Содержимое письма Передавайте folder, uidvalidity и uid из списка писем. HTML очищен, внешние изображения не включаются. Чтобы отметить письмо прочитанным, выполните отдельное действие read. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages/?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Содержимое письма", "operationId": "message_v1_mailboxes__mailbox_id__messages__uid__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "uid", "in": "path", "required": true, "schema": { "type": "integer", "title": "Uid" } }, { "name": "uidvalidity", "in": "query", "required": true, "schema": { "type": "integer", "title": "Uidvalidity" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Передавайте folder, uidvalidity и uid из списка писем. HTML очищен, внешние изображения не включаются. Чтобы отметить письмо прочитанным, выполните отдельное действие read." } ``` # POST /v1/mailboxes/{mailbox_id}/messages/actions Действия с письмами Применяет действие к выбранным письмам одной папки. Передайте их идентификаторы в uids, имя папки в folder и её uidvalidity. Для action=move также укажите целевую папку в destination. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//messages/actions' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"folder":"INBOX","uidvalidity":1,"uids":[1],"action":"read"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Действия с письмами", "operationId": "action_v1_mailboxes__mailbox_id__messages_actions_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAction" } } } }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "updated": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Применяет действие к выбранным письмам одной папки. Передайте их идентификаторы в uids, имя папки в folder и её uidvalidity. Для action=move также укажите целевую папку в destination." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid}/eml Скачать письмо в EML Возвращает исходные MIME-байты с заголовками и вложениями. Не меняет прочитанность. PDF создаётся в браузере через печать; отдельного PDF-маршрута нет. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages//eml?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Скачать письмо в EML", "operationId": "export_eml_v1_mailboxes__mailbox_id__messages__uid__eml_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "uid", "in": "path", "required": true, "schema": { "type": "integer", "title": "Uid" } }, { "name": "uidvalidity", "in": "query", "required": true, "schema": { "type": "integer", "title": "Uidvalidity" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "message/rfc822": { "schema": { "type": "string", "format": "binary" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает исходные MIME-байты с заголовками и вложениями. Не меняет прочитанность. PDF создаётся в браузере через печать; отдельного PDF-маршрута нет." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid}/attachments/{index} Скачать вложение Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages//attachments/?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Скачать вложение", "operationId": "attachment_v1_mailboxes__mailbox_id__messages__uid__attachments__index__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "uid", "in": "path", "required": true, "schema": { "type": "integer", "title": "Uid" } }, { "name": "index", "in": "path", "required": true, "schema": { "type": "integer", "title": "Index" } }, { "name": "uidvalidity", "in": "query", "required": true, "schema": { "type": "integer", "title": "Uidvalidity" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "name": "preview", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "pdf" ] } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } }, "application/pdf": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "X-File-Scan": { "schema": { "type": "string" } }, "X-File-Scanned-At": { "schema": { "type": "string" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик." } ``` # POST /v1/mailboxes/{mailbox_id}/send Отправить письмо Обязателен Idempotency-Key длиной 8–128 символов. Повтор с тем же ключом и телом возвращает ту же операцию; другое тело даёт 409. HTTP 202 означает постановку в очередь. Проверяйте состояние операции, а не факт получения ответа. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//send' \ -H 'Authorization: Bearer ' \ -H 'Idempotency-Key: message-20261019-0001' \ -H 'Content-Type: application/json' \ --data '{"to":["team@example.com"],"subject":"Hello","text":"A message from Adapt Mail"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Отправить письмо", "operationId": "send_v1_mailboxes__mailbox_id__send_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "in": "header", "name": "Idempotency-Key", "required": true, "schema": { "type": "string", "minLength": 8, "maxLength": 128 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendInput" } } } }, "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "400": { "description": "Некорректный заголовок или идентификатор", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "413": { "description": "Превышен размер", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Обязателен Idempotency-Key длиной 8–128 символов. Повтор с тем же ключом и телом возвращает ту же операцию; другое тело даёт 409. HTTP 202 означает постановку в очередь. Проверяйте состояние операции, а не факт получения ответа." } ``` # GET /v1/operations Список операций Возвращает последние 100 операций. Сессия отдельного ящика видит только его операции. ```sh curl -X GET 'https://adapt-mail.com/v1/operations' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Список операций", "operationId": "operations_v1_operations_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Operation" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает последние 100 операций. Сессия отдельного ящика видит только его операции." } ``` # GET /v1/operations/{operation_id} Состояние операции Возвращает текущее состояние операции по её id. Пока status равен queued или running, операция не завершена. После завершения проверьте result при успехе или error при ошибке. ```sh curl -X GET 'https://adapt-mail.com/v1/operations/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Состояние операции", "operationId": "operation_v1_operations__operation_id__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "operation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Operation Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает текущее состояние операции по её id. Пока status равен queued или running, операция не завершена. После завершения проверьте result при успехе или error при ошибке." } ``` # POST /v1/operations/{operation_id}/cancel Отменить отправку Отменяет отправку письма, пока операция находится в состоянии queued. Если отправка уже началась, завершилась или была отменена, возвращается 409. Отозвать уже отправленное письмо этим методом нельзя. ```sh curl -X POST 'https://adapt-mail.com/v1/operations//cancel' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Отменить отправку", "operationId": "cancel_v1_operations__operation_id__cancel_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "operation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Operation Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "cancelled": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Отменяет отправку письма, пока операция находится в состоянии queued. Если отправка уже началась, завершилась или была отменена, возвращается 409. Отозвать уже отправленное письмо этим методом нельзя." } ``` # POST /v1/operations/{operation_id}/retry Повторить операцию Повторно запускает применение правил отправителей: kind=sender_rules, status=failed. Отправку писем повторить этим методом нельзя. Для неподходящего состояния возвращается 409; повтор создания и настройки ящика через этот метод недоступен и возвращает 403. ```sh curl -X POST 'https://adapt-mail.com/v1/operations//retry' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Повторить операцию", "operationId": "retry_operation_v1_operations__operation_id__retry_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "operation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Operation Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Повторно запускает применение правил отправителей: kind=sender_rules, status=failed. Отправку писем повторить этим методом нельзя. Для неподходящего состояния возвращается 409; повтор создания и настройки ящика через этот метод недоступен и возвращает 403." } ``` # PUT /v1/mailboxes/{mailbox_id}/drafts/{draft_id} Сохранить черновик Создаёт или обновляет черновик по draft_id. Для нового черновика сгенерируйте UUID; при последующих сохранениях используйте тот же идентификатор. Черновик можно продолжить с другого устройства после входа в тот же ящик. ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//drafts/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"to":["team@example.com"],"subject":"Hello","text":"A message from Adapt Mail"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Сохранить черновик", "operationId": "save_draft_v1_mailboxes__mailbox_id__drafts__draft_id__put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "draft_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Draft Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DraftInput" } } } }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Создаёт или обновляет черновик по draft_id. Для нового черновика сгенерируйте UUID; при последующих сохранениях используйте тот же идентификатор. Черновик можно продолжить с другого устройства после входа в тот же ящик." } ``` # DELETE /v1/mailboxes/{mailbox_id}/drafts/{draft_id} Удалить черновик Удаление черновика не влияет на уже поставленное в очередь письмо. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//drafts/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Удалить черновик", "operationId": "delete_draft_v1_mailboxes__mailbox_id__drafts__draft_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "draft_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Draft Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Удаление черновика не влияет на уже поставленное в очередь письмо." } ``` # GET /v1/mailboxes/{mailbox_id}/drafts Список черновиков Возвращает до 100 черновиков, от новых к старым. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//drafts' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Список черновиков", "operationId": "drafts_v1_mailboxes__mailbox_id__drafts_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "mailbox_id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/DraftInput" }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает до 100 черновиков, от новых к старым." } ``` # GET /v1/mailboxes/{mailbox_id}/threads Список диалогов Возвращает до 100 диалогов, начиная с недавно обновлённых. Письма из папок Trash и Junk не включаются в список. Новое письмо может появиться с небольшой задержкой; повторите запрос, чтобы обновить список. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//threads' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Список диалогов", "operationId": "threads_v1_mailboxes__mailbox_id__threads_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "thread_id": { "type": "string" }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "messages": { "type": "integer" }, "unread": { "type": "integer" }, "senders": { "type": "array", "items": { "type": "string" } }, "subject": { "type": "string" }, "sender": { "type": "string" } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает до 100 диалогов, начиная с недавно обновлённых. Письма из папок Trash и Junk не включаются в список. Новое письмо может появиться с небольшой задержкой; повторите запрос, чтобы обновить список." } ``` # GET /v1/mailboxes/{mailbox_id}/threads/{thread_id} Письма диалога Возвращает до 100 писем выбранного диалога, от старых к новым. Передайте thread_id из списка диалогов. Письма, которые уже удалены или больше недоступны, в ответ не включаются. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//threads/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Письма диалога", "operationId": "thread_v1_mailboxes__mailbox_id__threads__thread_id__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "thread_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Thread Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Message" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает до 100 писем выбранного диалога, от старых к новым. Передайте thread_id из списка диалогов. Письма, которые уже удалены или больше недоступны, в ответ не включаются." } ``` # PUT /v1/mailboxes/{mailbox_id}/sender-rules Правило отправителя Создаёт или обновляет правило для адреса sender. Укажите action=spam, чтобы направлять новые письма отправителя в спам, или action=allow, чтобы разрешить его письма. Правило применяется к будущим входящим письмам. ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//sender-rules' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"sender":"sender@example.com","action":"spam"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Правило отправителя", "operationId": "sender_rule_v1_mailboxes__mailbox_id__sender_rules_put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SenderRule" } } } }, "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Создаёт или обновляет правило для адреса sender. Укажите action=spam, чтобы направлять новые письма отправителя в спам, или action=allow, чтобы разрешить его письма. Правило применяется к будущим входящим письмам." } ``` # GET /v1/mailboxes/{mailbox_id}/sender-rules Список правил отправителей Возвращает правила отправителей для выбранного ящика. Каждое правило содержит адрес sender, действие action и идентификатор id для последующего удаления. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//sender-rules' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Список правил отправителей", "operationId": "rules_v1_mailboxes__mailbox_id__sender_rules_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "mailbox_id": { "type": "integer" }, "sender": { "type": "string" }, "action": { "type": "string", "enum": [ "spam", "allow" ] }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает правила отправителей для выбранного ящика. Каждое правило содержит адрес sender, действие action и идентификатор id для последующего удаления." } ``` # DELETE /v1/mailboxes/{mailbox_id}/sender-rules/{rule_id} Удалить правило отправителя Удаляет правило отправителя по rule_id. Последующие письма обрабатываются общими правилами почты. Уже полученные письма остаются в своих папках. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//sender-rules/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Удалить правило отправителя", "operationId": "delete_rule_v1_mailboxes__mailbox_id__sender_rules__rule_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "rule_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Rule Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Удаляет правило отправителя по rule_id. Последующие письма обрабатываются общими правилами почты. Уже полученные письма остаются в своих папках." } ``` # GET /v1/mailboxes/{mailbox_id}/contacts Список контактов Возвращает до 1000 контактов, отсортированных по имени. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//contacts' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Список контактов", "operationId": "contacts_v1_mailboxes__mailbox_id__contacts_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ContactResponse" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает до 1000 контактов, отсортированных по имени." } ``` # POST /v1/mailboxes/{mailbox_id}/contacts Сохранить контакт Сохраняет имя и адрес контакта в выбранном ящике. Если контакт с таким email уже существует, обновляет его имя без создания дубликата. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//contacts' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"email":"team@example.com","name":"Support team"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Сохранить контакт", "operationId": "add_contact_v1_mailboxes__mailbox_id__contacts_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Contact" } } } }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContactResponse" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Сохраняет имя и адрес контакта в выбранном ящике. Если контакт с таким email уже существует, обновляет его имя без создания дубликата." } ``` # DELETE /v1/mailboxes/{mailbox_id}/contacts/{contact_id} Удалить контакт Удаление контакта не удаляет письма. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//contacts/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Удалить контакт", "operationId": "remove_contact_v1_mailboxes__mailbox_id__contacts__contact_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "contact_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Contact Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Удаление контакта не удаляет письма." } ``` # GET /v1/mailboxes/{mailbox_id}/files Список файлов Возвращает до 1000 готовых файлов выбранного ящика. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "Список файлов", "operationId": "files_v1_mailboxes__mailbox_id__files_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "filename": { "type": "string" }, "content_type": { "type": "string" }, "size_bytes": { "type": "integer" }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Возвращает до 1000 готовых файлов выбранного ящика." } ``` # POST /v1/mailboxes/{mailbox_id}/files Загрузить файл multipart/form-data, поле file. Размер от 1 байта до 25 МиБ. Антивирус проверяет файл до загрузки. Недостаток квоты даёт 409, превышение размера — 413, обнаруженная угроза — 422, недоступная проверка — 503. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//files' \ -H 'Authorization: Bearer ' \ -F 'file=@document.pdf' ``` ```json { "tags": [ "Файлы" ], "summary": "Загрузить файл", "operationId": "upload_v1_mailboxes__mailbox_id__files_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_v1_mailboxes__mailbox_id__files_post" } } } }, "responses": { "201": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/File" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "413": { "description": "Превышен размер", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "multipart/form-data, поле file. Размер от 1 байта до 25 МиБ. Антивирус проверяет файл до загрузки. Недостаток квоты даёт 409, превышение размера — 413, обнаруженная угроза — 422, недоступная проверка — 503." } ``` # GET /v1/mailboxes/{mailbox_id}/files/{file_id}/download Скачать файл Ответ содержит байты файла с Content-Disposition: attachment. Ссылка требует авторизации при каждом запросе; публичный URL хранилища не выдаётся. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files//download' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "Скачать файл", "operationId": "download_v1_mailboxes__mailbox_id__files__file_id__download_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "X-File-Scan": { "schema": { "type": "string" } }, "X-File-Scanned-At": { "schema": { "type": "string" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Ответ содержит байты файла с Content-Disposition: attachment. Ссылка требует авторизации при каждом запросе; публичный URL хранилища не выдаётся." } ``` # GET /v1/mailboxes/{mailbox_id}/files/{file_id}/content Содержимое файла Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files//content' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "Содержимое файла", "operationId": "content_v1_mailboxes__mailbox_id__files__file_id__content_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "name": "preview", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "pdf" ] } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } }, "application/pdf": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "X-File-Scan": { "schema": { "type": "string" } }, "X-File-Scanned-At": { "schema": { "type": "string" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Добавьте preview=pdf к запросу содержимого файла или вложения для DOC, XLS, XLSX, PPT, PPTX и ODT. Ограничение — 10 преобразований в минуту на ящик." } ``` # DELETE /v1/mailboxes/{mailbox_id}/files/{file_id} Удалить файл Файл незавершённой отправки удалить нельзя: ответ 409. Освобождение квоты происходит после удаления. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//files/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "Удалить файл", "operationId": "remove_v1_mailboxes__mailbox_id__files__file_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Файл незавершённой отправки удалить нельзя: ответ 409. Освобождение квоты происходит после удаления." } ``` # POST /v1/auth/login-link Создание ссылки для входа Сервер партнёра вызывает POST /v1/auth/login-link с X-API-Key и X-Customer-ID. Укажите mailbox_id для входа только в этот ящик; без него откроется весь аккаунт. locale выбирает язык интерфейса. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/login-link' \ -H 'X-API-Key: ' \ -H 'X-Customer-ID: ' \ -H 'Content-Type: application/json' \ --data '{"mailbox_id":1,"locale":"en"}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Создание ссылки для входа", "operationId": "login_link_v1_auth_login_link_post", "security": [ { "PartnerKey": [], "Customer": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": true, "schema": { "type": "integer", "minimum": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkInput" } } } }, "responses": { "201": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkResult" } } } }, "401": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Сервер партнёра вызывает POST /v1/auth/login-link с X-API-Key и X-Customer-ID. Укажите mailbox_id для входа только в этот ящик; без него откроется весь аккаунт. locale выбирает язык интерфейса." } ``` # POST /v1/auth/login-link/consume Обмен ссылки на сессию Только для страницы входа adapt-mail.com: POST с Origin: https://adapt-mail.com. Возвращает session_id и HttpOnly cookies. Повторный обмен или истёкшая ссылка: HTTP 410. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/login-link/consume' \ -H 'Origin: https://adapt-mail.com' \ -c cookies.txt \ -H 'Content-Type: application/json' \ --data '{"token":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Обмен ссылки на сессию", "operationId": "consume_login_link_v1_auth_login_link_consume_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkConsume" } } }, "required": true }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrowserSessionResult" } } } }, "403": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "410": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Ошибка запроса", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Только для страницы входа adapt-mail.com: POST с Origin: https://adapt-mail.com. Возвращает session_id и HttpOnly cookies. Повторный обмен или истёкшая ссылка: HTTP 410.", "security": [] } ``` # GET /v1/mailboxes/{mailbox_id}/templates Шаблоны писем До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//templates' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Шаблоны писем", "operationId": "templates_v1_mailboxes__mailbox_id__templates_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TemplateRecord" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам." } ``` # POST /v1/mailboxes/{mailbox_id}/templates Шаблоны писем До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//templates' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Шаблоны писем", "operationId": "create_template_v1_mailboxes__mailbox_id__templates_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailTemplate" } } } }, "responses": { "201": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateRecord" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам." } ``` # PUT /v1/mailboxes/{mailbox_id}/templates/{template_id} Шаблоны писем До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам. ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//templates/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Шаблоны писем", "operationId": "update_template_v1_mailboxes__mailbox_id__templates__template_id__put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "template_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Template Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailTemplate" } } } }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateRecord" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам." } ``` # DELETE /v1/mailboxes/{mailbox_id}/templates/{template_id} Шаблоны писем До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//templates/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Шаблоны писем", "operationId": "delete_template_v1_mailboxes__mailbox_id__templates__template_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "template_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Template Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "const": true } } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "До 100 шаблонов на ящик. Поля name, subject, text и html; HTML очищается. Шаблон не отправляет письмо сам." } ``` # GET /v1/mailboxes/{mailbox_id}/autoresponder Автоответчик Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//autoresponder' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Автоответчик", "operationId": "autoresponder_v1_mailboxes__mailbox_id__autoresponder_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path." } ``` # PUT /v1/mailboxes/{mailbox_id}/autoresponder Автоответчик Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path. ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//autoresponder' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"enabled":false,"subject":"","text":"","starts_at":"2026-11-01T12:00:00Z","ends_at":"2026-11-01T12:00:00Z","repeat_days":7}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Автоответчик", "operationId": "set_autoresponder_v1_mailboxes__mailbox_id__autoresponder_put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Даты автоответчика передавайте с часовым поясом; repeat_days — от 1 до 30. Ответы идут только на новые личные письма: адрес From должен совпадать с Return-Path." } ``` # GET /v1/mailboxes/{mailbox_id}/filters Фильтры Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//filters' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Фильтры", "operationId": "filters_v1_mailboxes__mailbox_id__filters_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FilterRecord" } } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}." } ``` # POST /v1/mailboxes/{mailbox_id}/filters Фильтры Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//filters' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":"","conditions":[{"field":"from","operator":"contains","value":""}]}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Фильтры", "operationId": "create_filter_v1_mailboxes__mailbox_id__filters_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailFilter" } } } }, "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterChange" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}." } ``` # PUT /v1/mailboxes/{mailbox_id}/filters/{filter_id} Фильтры Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}. ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//filters/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":"","conditions":[{"field":"from","operator":"contains","value":""}]}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Фильтры", "operationId": "update_filter_v1_mailboxes__mailbox_id__filters__filter_id__put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "filter_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Filter Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailFilter" } } } }, "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterChange" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}." } ``` # DELETE /v1/mailboxes/{mailbox_id}/filters/{filter_id} Фильтры Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//filters/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Фильтры", "operationId": "delete_filter_v1_mailboxes__mailbox_id__filters__filter_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "filter_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Filter Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}." } ``` # POST /v1/mailboxes/{mailbox_id}/filters/{filter_id}/apply Применить к существующим Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//filters//apply' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Применить к существующим", "operationId": "apply_filter_v1_mailboxes__mailbox_id__filters__filter_id__apply_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "filter_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Filter Id" } }, { "name": "idempotency-key", "in": "header", "required": true, "schema": { "type": "string", "minLength": 8, "maxLength": 120, "title": "Idempotency-Key" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "Успешный ответ", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Требуется вход", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Нет доступа", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Ресурс не найден", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Конфликт состояния", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Временная недоступность", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Изменение фильтра возвращает operation. Применение к истории требует Idempotency-Key длиной 8–120 символов. Повторяйте запрос с тем же ключом; состояние проверяйте через GET /v1/operations/{operation_id}." } ``` # Schemas ```json { "Body_upload_v1_mailboxes__mailbox_id__files_post": { "properties": { "file": { "type": "string", "format": "binary", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_upload_v1_mailboxes__mailbox_id__files_post" }, "Contact": { "properties": { "email": { "type": "string", "title": "Email" }, "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" } }, "additionalProperties": false, "type": "object", "required": [ "email", "name" ], "title": "Contact", "example": { "email": "team@example.com", "name": "Support team" } }, "DraftInput": { "properties": { "to": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "To", "description": "Адреса основных получателей." }, "cc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Cc", "description": "Адреса получателей копии, видимые другим участникам." }, "bcc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Bcc", "description": "Адреса получателей скрытой копии." }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "", "description": "Тема письма." }, "text": { "type": "string", "maxLength": 200000, "title": "Text", "default": "", "description": "Текст письма без форматирования." }, "html": { "anyOf": [ { "type": "string", "maxLength": 300000 }, { "type": "null" } ], "title": "Html", "description": "HTML-версия письма с форматированием." }, "file_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "maxItems": 20, "title": "File Ids", "description": "ID ранее загруженных файлов этого ящика. Получите их при загрузке или из списка файлов." }, "forward_message": { "anyOf": [ { "$ref": "#/components/schemas/MessageReference" }, { "type": "null" } ], "description": "Исходное письмо, вложения которого нужно переслать." }, "reply_to_message_id": { "anyOf": [ { "type": "string", "maxLength": 998 }, { "type": "null" } ], "title": "Reply To Message Id", "description": "Значение message_id письма, на которое вы отвечаете." }, "references": { "anyOf": [ { "type": "string", "maxLength": 4000 }, { "type": "null" } ], "title": "References", "description": "Значение references исходного письма для сохранения цепочки ответов." }, "send_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Send At", "description": "Время отложенной отправки с часовым поясом, например 2026-11-01T12:00:00Z. Без значения отправка начинается по мере обработки очереди." } }, "additionalProperties": false, "type": "object", "title": "DraftInput", "example": { "to": [ "team@example.com" ], "subject": "Hello", "text": "A message from Adapt Mail" } }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "Login": { "properties": { "login": { "type": "string", "title": "Login" }, "password": { "type": "string", "maxLength": 128, "minLength": 1, "title": "Password" }, "mode": { "type": "string", "enum": [ "account", "mailbox" ], "title": "Mode", "default": "account" } }, "additionalProperties": false, "type": "object", "required": [ "login", "password" ], "title": "Login" }, "MailboxUpdate": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Name" }, "quota_mb": { "anyOf": [ { "type": "integer", "minimum": 10240 }, { "type": "null" } ], "title": "Quota Mb" }, "file_quota_mb": { "anyOf": [ { "type": "integer", "maximum": 512000, "minimum": 256 }, { "type": "null" } ], "title": "File Quota Mb" }, "password": { "anyOf": [ { "type": "string", "maxLength": 128, "minLength": 12 }, { "type": "null" } ], "title": "Password" }, "signature": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ], "title": "Signature" } }, "additionalProperties": false, "type": "object", "title": "MailboxUpdate", "example": { "name": "Support", "signature": "Support team" } }, "MessageAction": { "properties": { "folder": { "type": "string", "maxLength": 255, "minLength": 1, "title": "Folder", "description": "Имя папки из списка папок, например INBOX." }, "uidvalidity": { "type": "integer", "exclusiveMinimum": 0, "title": "Uidvalidity", "description": "Значение uidvalidity из ответа API для этой папки." }, "uids": { "items": { "type": "integer" }, "type": "array", "maxItems": 100, "minItems": 1, "title": "Uids", "description": "Идентификаторы выбранных писем из одной папки." }, "action": { "type": "string", "enum": [ "read", "unread", "star", "unstar", "move", "delete" ], "title": "Action" }, "destination": { "anyOf": [ { "type": "string", "maxLength": 255 }, { "type": "null" } ], "title": "Destination", "description": "Имя целевой папки. Обязательно для action=move." } }, "additionalProperties": false, "type": "object", "required": [ "folder", "uidvalidity", "uids", "action" ], "title": "MessageAction" }, "MessageReference": { "properties": { "folder": { "type": "string", "maxLength": 255, "minLength": 1, "title": "Folder", "description": "Имя папки из списка папок, например INBOX." }, "uidvalidity": { "type": "integer", "exclusiveMinimum": 0, "title": "Uidvalidity", "description": "Значение uidvalidity из ответа API для этой папки." }, "uid": { "type": "integer", "exclusiveMinimum": 0, "title": "Uid" } }, "additionalProperties": false, "type": "object", "required": [ "folder", "uidvalidity", "uid" ], "title": "MessageReference" }, "NameInput": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "title": "NameInput" }, "SendInput": { "properties": { "to": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "minItems": 1, "title": "To", "description": "Адреса основных получателей." }, "cc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Cc", "description": "Адреса получателей копии, видимые другим участникам." }, "bcc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Bcc", "description": "Адреса получателей скрытой копии." }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "", "description": "Тема письма." }, "text": { "type": "string", "maxLength": 200000, "title": "Text", "default": "", "description": "Текст письма без форматирования." }, "html": { "anyOf": [ { "type": "string", "maxLength": 300000 }, { "type": "null" } ], "title": "Html", "description": "HTML-версия письма с форматированием." }, "file_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "maxItems": 20, "title": "File Ids", "description": "ID ранее загруженных файлов этого ящика. Получите их при загрузке или из списка файлов." }, "forward_message": { "anyOf": [ { "$ref": "#/components/schemas/MessageReference" }, { "type": "null" } ], "description": "Исходное письмо, вложения которого нужно переслать." }, "reply_to_message_id": { "anyOf": [ { "type": "string", "maxLength": 998 }, { "type": "null" } ], "title": "Reply To Message Id", "description": "Значение message_id письма, на которое вы отвечаете." }, "references": { "anyOf": [ { "type": "string", "maxLength": 4000 }, { "type": "null" } ], "title": "References", "description": "Значение references исходного письма для сохранения цепочки ответов." }, "send_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Send At", "description": "Время отложенной отправки с часовым поясом, например 2026-11-01T12:00:00Z. Без значения отправка начинается по мере обработки очереди." } }, "additionalProperties": false, "type": "object", "required": [ "to" ], "title": "SendInput", "example": { "to": [ "team@example.com" ], "subject": "Hello", "text": "A message from Adapt Mail" } }, "SenderRule": { "properties": { "sender": { "type": "string", "title": "Sender" }, "action": { "type": "string", "enum": [ "spam", "allow" ], "title": "Action", "default": "spam" } }, "additionalProperties": false, "type": "object", "required": [ "sender" ], "title": "SenderRule", "example": { "sender": "sender@example.com", "action": "spam" } }, "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" }, "Address": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } } }, "MessageSummary": { "type": "object", "properties": { "uid": { "type": "integer" }, "uidvalidity": { "type": "integer" }, "folder": { "type": "string" }, "message_id": { "type": "string" }, "thread_id": { "type": "string" }, "sender": { "type": "string" }, "recipients": { "type": "array", "items": { "$ref": "#/components/schemas/Address" } }, "subject": { "type": "string" }, "preview": { "type": "string" }, "flags": { "type": "array", "items": { "type": "string" } }, "size_bytes": { "type": "integer" }, "received_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } }, "Attachment": { "type": "object", "properties": { "index": { "type": "integer" }, "filename": { "type": "string" }, "content_type": { "type": "string" }, "size_bytes": { "type": "integer" } } }, "Message": { "type": "object", "properties": { "uid": { "type": "integer" }, "uidvalidity": { "type": "integer" }, "folder": { "type": "string" }, "message_id": { "type": "string" }, "thread_id": { "type": "string" }, "sender": { "type": "string" }, "recipients": { "type": "array", "items": { "$ref": "#/components/schemas/Address" } }, "subject": { "type": "string" }, "preview": { "type": "string" }, "flags": { "type": "array", "items": { "type": "string" } }, "size_bytes": { "type": "integer" }, "received_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "text": { "type": "string" }, "html": { "type": "string" }, "attachments": { "type": "array", "items": { "$ref": "#/components/schemas/Attachment" } }, "cc": { "type": "array", "items": { "$ref": "#/components/schemas/Address" } }, "references": { "type": "string" }, "reply_to": { "type": "string" } } }, "Operation": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Идентификатор операции для проверки состояния и отмены ожидающей отправки." }, "kind": { "type": "string" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "status": { "type": "string", "enum": [ "queued", "running", "succeeded", "failed", "uncertain", "cancelled" ] }, "run_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "completed_at": { "anyOf": [ { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, { "type": "null" } ] }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Причина ошибки, если операция не завершилась успешно." }, "result": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "description": "Результат выполнения операции. Для отправки содержит сведения о принятых и отклонённых получателях." } } }, "SendResult": { "type": "object", "properties": { "message_id": { "type": "string" }, "smtp_accepted": { "type": "boolean" }, "sent_saved": { "type": "boolean" }, "accepted_recipients": { "type": "array", "items": { "type": "string" } }, "rejected_recipients": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "code": { "type": "integer" } } } } } }, "Mailbox": { "type": "object", "properties": { "id": { "type": "integer" }, "account_id": { "type": "integer" }, "domain_id": { "type": "integer" }, "email": { "type": "string" }, "name": { "type": "string" }, "quota_mb": { "type": "integer" }, "used_bytes": { "type": "integer" }, "file_quota_bytes": { "type": "integer" }, "file_used_bytes": { "type": "integer" }, "status": { "type": "string" }, "signature": { "type": "string" }, "enabled": { "type": "boolean" }, "access_allowed": { "type": "boolean" }, "paid_until": { "anyOf": [ { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, { "type": "null" } ] }, "ready_at": { "anyOf": [ { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, { "type": "null" } ] }, "delete_after": { "anyOf": [ { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, { "type": "null" } ] }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "reserved_quota_mb": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "outbound_high_limit": { "type": "boolean" }, "outbound_daily_recipient_limit": { "type": "integer" }, "outbound_daily_recipients_used": { "type": "integer" }, "outbound_daily_recipients_remaining": { "type": "integer" }, "outbound_messages_per_minute": { "type": "integer" }, "outbound_minute_messages_used": { "type": "integer" }, "outbound_minute_messages_remaining": { "type": "integer" }, "outbound_recipients_per_message": { "type": "integer" }, "storage_shared": { "type": "boolean", "const": true } } }, "Domain": { "type": "object", "properties": { "id": { "type": "integer" }, "account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "name": { "type": "string" }, "status": { "type": "string" }, "is_shared": { "type": "boolean" }, "verification_token": { "type": "string" }, "dns_status": { "type": "object" }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } }, "File": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "filename": { "type": "string" }, "content_type": { "type": "string" }, "size_bytes": { "type": "integer" }, "scanned_at": { "anyOf": [ { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, { "type": "null" } ] } } }, "ContactResponse": { "type": "object", "properties": { "id": { "type": "integer" }, "mailbox_id": { "type": "integer" }, "email": { "type": "string" }, "name": { "type": "string" }, "created_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } }, "Error": { "type": "object", "properties": { "detail": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, { "type": "array", "items": { "type": "object" } } ] } } }, "LoginLinkInput": { "properties": { "mailbox_id": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "title": "Mailbox Id" }, "locale": { "type": "string", "enum": [ "en", "ru", "fr", "es", "de", "zh-cn", "ko", "tr", "hi", "pt-br" ], "title": "Locale", "default": "en" } }, "additionalProperties": false, "type": "object", "title": "LoginLinkInput" }, "LoginLinkConsume": { "properties": { "token": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "title": "Token" } }, "additionalProperties": false, "type": "object", "required": [ "token" ], "title": "LoginLinkConsume" }, "LoginLinkResult": { "properties": { "login_url": { "type": "string", "title": "Login Url" }, "expires_in": { "type": "integer", "const": 300, "title": "Expires In" }, "expires_at": { "type": "string", "title": "Expires At" }, "account_id": { "type": "integer", "title": "Account Id" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mailbox Id" } }, "additionalProperties": false, "type": "object", "required": [ "login_url", "expires_in", "expires_at", "account_id", "mailbox_id" ], "title": "LoginLinkResult" }, "BrowserSessionResult": { "properties": { "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mailbox Id" }, "session_id": { "type": "string", "title": "Session Id" } }, "additionalProperties": false, "type": "object", "required": [ "mailbox_id", "session_id" ], "title": "BrowserSessionResult" }, "MailTemplate": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "" }, "text": { "type": "string", "maxLength": 20000, "title": "Text", "default": "" }, "html": { "type": "string", "maxLength": 30000, "title": "Html", "default": "" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "title": "MailTemplate" }, "MailFilter": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "enabled": { "type": "boolean", "title": "Enabled", "default": true }, "match": { "type": "string", "enum": [ "all", "any" ], "title": "Match", "default": "all" }, "conditions": { "items": { "$ref": "#/components/schemas/FilterCondition" }, "type": "array", "maxItems": 20, "minItems": 1, "title": "Conditions" }, "mark_read": { "type": "boolean", "title": "Mark Read", "default": false }, "important": { "type": "boolean", "title": "Important", "default": false }, "trash": { "type": "boolean", "title": "Trash", "default": false }, "move_to": { "anyOf": [ { "type": "string", "maxLength": 255, "minLength": 1 }, { "type": "null" } ], "title": "Move To" } }, "additionalProperties": false, "type": "object", "required": [ "name", "conditions" ], "title": "MailFilter" }, "FilterCondition": { "properties": { "field": { "type": "string", "enum": [ "from", "to", "cc", "subject" ], "title": "Field" }, "operator": { "type": "string", "enum": [ "contains", "not_contains", "equals", "not_equals" ], "title": "Operator" }, "value": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Value" } }, "additionalProperties": false, "type": "object", "required": [ "field", "operator", "value" ], "title": "FilterCondition" }, "Autoresponder": { "properties": { "enabled": { "type": "boolean", "title": "Enabled", "default": false }, "subject": { "type": "string", "maxLength": 200, "title": "Subject", "default": "" }, "text": { "type": "string", "maxLength": 10000, "title": "Text", "default": "" }, "starts_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Starts At" }, "ends_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Ends At" }, "repeat_days": { "type": "integer", "maximum": 30, "minimum": 1, "title": "Repeat Days", "default": 7 } }, "additionalProperties": false, "type": "object", "title": "Autoresponder" }, "TemplateRecord": { "type": "object", "required": [ "id", "data", "updated_at" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailTemplate" }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } }, "FilterRecord": { "type": "object", "required": [ "id", "data", "updated_at" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailFilter" }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." } } }, "FilterChange": { "type": "object", "required": [ "id", "data", "updated_at", "operation" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailFilter" }, "updated_at": { "type": "string", "description": "Дата и время в UTC. Если смещение отсутствует, значение также представляет UTC." }, "operation": { "$ref": "#/components/schemas/Operation" } } } } ```