# Adapt Mail API 0.16.0 https://adapt-mail.com/docs/ # Documentation Adapt Mail ## Mail for your product Connect your interface to Adapt Mail: mailboxes, read and send messages, show dialogs, manage files, contacts and sender rules. Create accounts, connect domains, pay for mailboxes and increase their storage in the account dashboard where you subscribed to mail. The mail API provides access to existing mailboxes. ## Start with authorization For server integrations, use a mail API key with X-Customer-ID. To authenticate an individual user, obtain a Bearer token using their login and password. ``` GET /v1/mailboxes X-API-Key: X-Customer-ID: ``` ## First request The API base URL is https://adapt-mail.com. Use HTTPS for all requests and Content-Type: application/json for JSON request bodies. Obtain an access token using your mail account login and password. Then list your mailboxes and save the selected mailbox’s id: use it as mailbox_id in request URLs. Replace values in angle brackets with your own data. ``` 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 " ``` ## Documentation formats The OpenAPI schema describes request parameters and responses. llms-full.txt contains the complete reference as plain text. Download links are available at the top of each page. # Authentication and access ## Sign in with a link Your server calls POST /v1/auth/login-link with X-API-Key and X-Customer-ID. Set mailbox_id to open only that mailbox; omit it to open the entire account. locale selects the interface language. The response contains login_url, expires_in=300, expires_at (UTC), account_id and mailbox_id. Your “Open mail” button opens the complete login_url, including #token. The link is valid for 5 minutes and one use only. Do not log it or expose the API key in the browser. The sign-in page removes the token from the address bar and exchanges it for HttpOnly cookies. If it fails or expires, create a new link. Access scope and account and mailbox status are checked again. User sessions cannot create links. ``` 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 } ``` ## Partner key Use your integration’s mail API key in X-API-Key and the mail account ID in the required X-Customer-ID header. This is the account ID, not external_id or a mailbox ID. The key grants access only to your integration’s customers. Store the key on your partner's server. Do not place the shared integration key in the browser or mobile application. ``` curl 'https://adapt-mail.com/v1/mailboxes' \ -H 'X-API-Key: ' \ -H 'X-Customer-ID: ' ``` ## User token POST /v1/auth/token accepts login, password and mode. For mode=account the login user-ID is used, for mode=mailbox the full mailbox address is used. Account and mailbox passwords are independent. The response contains access_token, token_type=Bearer and expires_in=3600. An account token grants access to its mailboxes; a mailbox token is restricted to that mailbox. Obtain a new token when it expires. ``` POST /v1/auth/token Content-Type: application/json {"login":"user-123","password":"","mode":"account"} GET /v1/mailboxes Authorization: Bearer ``` ## Browser sessions POST /v1/auth/login is reserved for adapt-mail.com. It requires the correct Origin and sets HttpOnly cookies. The non-secret X-Mail-Session selector chooses a saved session; it does not grant access without the corresponding cookie. For a third-party frontend, use your own backend with a user token. Arbitrary cross-origin cookie access is not supported; the service does not enable public CORS for every website. # Sending and operations ## Queue a message Receive ID mailbox from GET /v1/mailboxes. Create a unique Idempotency-Key for one submission and save it until the final result. For network replay, use the same key and the same body. HTTP 202 returns an operation object, not a delivery confirmation. Field id contains ID operations. Poll 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"} ``` ## Understanding the result - `queued` — The message is waiting to be sent. - `running` — Sending is in progress. - `succeeded` — The mail server accepted the submission. Check the result for each recipient. - `failed` — Sending failed. The reason is given in error. - `cancelled` — Dispatch cancelled. - `uncertain` — Failed to confirm the send result. Please check the operation and your sent folder before trying again. After a successful send, result contains accepted_recipients, rejected_recipients and sent_saved, which indicates whether a copy was saved in Sent. Acceptance by the mail server does not guarantee delivery to the recipient’s inbox. To cancel a pending send, run POST /v1/operations/{operation_id}/cancel. The /retry method does not resend the email. ## Replies, forwarding and scheduled delivery To reply, please include message_id of the original email in reply_to_message_id and forward it to references. In to, enter the reply address from reply_to or the sender's address. To reply to everyone, add other participants to to and cc, excluding your own address. To forward attachments, pass forward_message with folder, uidvalidity and uid. For your uploaded files, use file_ids. Total attachment size is limited to 25 MiB. Provide send_at with a time zone; it is stored in UTC. Sending can be scheduled up to a year ahead. Outbound limits are checked when the message is sent, not when it is queued. # Sending via SMTP ## Before you connect Send email from your application via SMTP using a mailbox username and password. API keys and account tokens cannot be used for SMTP. Create an active mailbox on a connected domain and complete its DNS verification. The username is the full address, such as noreply@example.com. Use the mailbox password, not the mail account password. Replace the example addresses with your own; the password is entered at runtime without being displayed. ## Server, ports and encryption Use mail.adapt-mail.com for any connected domain. Port 465 starts TLS immediately; port 587 uses STARTTLS before authentication. Choose one option. Keep certificate verification enabled. In these examples, the From address and SMTP envelope sender match the mailbox username. You can change the sender display name. Port 25 is for communication between mail servers; use 465 or 587 for your application. ``` 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: sending on port 465 This example uses only the Python 3 standard library. Save it as send_mail.py and run python3 send_mail.py. For automated sending, retrieve the password from your application's secure configuration; do not store it in Git or logs. ``` 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: connecting on port 587 For STARTTLS, keep the message preparation from the previous example and replace the with smtplib.SMTP_SSL block with the following. With smtplib.SMTP, the password is sent only after STARTTLS succeeds. ``` 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 and attachments Add the HTML alternative after set_content and the attachment before sending. Keep the plain text version for clients without HTML support. Use trusted HTML or escape any interpolated data. ``` 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", ) ``` ## Results, limits and sent messages A successful send_message means the SMTP server accepted the message, not that it reached the recipient's inbox. The refused dictionary lists rejected recipients; if all recipients are rejected, Python raises SMTPRecipientsRefused. SMTP and API share the same per-mailbox limits: up to 30 messages in a rolling 60-second window, 50 recipients per message, and 1000 recipients in a rolling 24-hour window, or 5000 with the higher limit enabled. All To, Cc and Bcc recipients count. Direct SMTP sending does not itself save a copy in Sent. Mail clients do this through IMAP; sending through the Adapt Mail API saves a copy separately. ## SMTP errors - `535` — Authentication failed: check the full address, mailbox password and mailbox availability. - `451` — Temporary failure, including sending limits being exceeded. Retry later with a delay. - `550 / 5xx` — Permanent failure: check the addresses, sender permissions and response text. More than 50 recipients are rejected after DATA. Fix the cause before retrying. - `TLS / timeout` — Check the hostname mail.adapt-mail.com, port, TLS mode and outbound access from your application server. Use SMTP_SSL on 465, or SMTP with STARTTLS on 587. Read the full SMTP server response. Retry temporary failures with a delay. If the connection drops after transmitting the message and the outcome is unknown, do not resend blindly: SMTP has no Idempotency-Key, and a retry may create a duplicate. # Messages and conversations ## Lists and pagination GET /v1/mailboxes/{mailbox_id}/folders returns folders with a total number of letters total, number of unread ones unread and a value of uidvalidity. For a list of letters use GET /v1/mailboxes/{mailbox_id}/messages: the response contains items, next_before and uidvalidity, up to 40 letters per page. Pass next_before as the before parameter of the next request. A null cursor marks the end of the list. The q search parameter accepts up to 200 characters and searches mail content. ``` GET /v1/mailboxes/42/messages?folder=INBOX GET /v1/mailboxes/42/messages?folder=INBOX&before=120 ``` ## message IDs uid identifies a message within a folder, folder is the folder name, and mailbox_id identifies the mailbox. uidvalidity identifies the current numbering of messages in that folder. Keep all four values from the API response together. If uidvalidity changes, reload the folder’s message list; previous uid values are no longer valid. Reading a message does not mark it as read. Use POST /v1/mailboxes/{mailbox_id}/messages/actions with action=read to mark it as read. ``` POST /v1/mailboxes/42/messages/actions {"folder":"INBOX","uidvalidity":123456,"uids":[120],"action":"read"} ``` ## Conversation view GET /v1/mailboxes/{mailbox_id}/threads returns up to 100 dialogs. Pass thread_id of the selected conversation to GET /v1/mailboxes/{mailbox_id}/threads/{thread_id} to get its letters from old to new. A new message may appear in the dialogue with a slight delay. Update the list; To check the submission, use the operation status. There is no need to resend the email due to display delay. # Limits and storage ## Shared SMTP and API limits Regular mailbox: 1000 recipients in a rolling 24 hour period. mailbox with outbound_high_limit=true: 5000. Up to 30 messages in sliding 60 seconds; up to 50 recipients in total in To, Cc and Bcc of one message. Received SMTP-recipients are taken into account, including internal addresses and repetitions of recipients in different messages. There is no separate hour limit. This is the consumption of sending permissions, and not the statistics of delivered messages. GET /v1/mailboxes returns the limit, usage and remaining allowance for both windows. The per-message recipient limit has no cumulative usage counter. If the counters are unavailable, the server returns 503 rather than reporting zero usage. ``` { "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 } ``` ## Exceeding the limit API-send may receive 202 and later fail failed with mail_daily_limit_exceeded or mail_minute_limit_exceeded. More than 50 recipients are rejected immediately with 422. SMTP returns a temporary failure of 451 if the window is exceeded and 550 after DATA if there are more than 50 recipients. There is no way to bypass the limit through another protocol. ## Mail and files quota_mb is the shared capacity for messages and files in MiB. used_bytes is total usage in bytes. storage_shared=true; file_quota_bytes equals quota_mb × 1048576 and is not extra capacity. file_used_bytes is the original size of uploaded files, already included in total usage. Files are stored alongside mail on our disks. The shared quota includes MIME encoding and headers. An attachment copied into a sent message uses additional space. External IMAP clients can see the Adapt Files system folder: deleting it deletes the saved files. Renewal and increase in volume are available in your personal account where you have connected your email. After the end of the paid period, reading and sending are blocked. After 24 hours, mailbox removal begins; renew your subscription before this date. # Events and webhooks ## Connecting webhooks Set your webhook URL in your integration settings to receive notifications about new messages, mailbox status and operation results. Set a separate webhook secret in your integration settings and enable delivery. Use this secret to verify notification signatures; your mail API key cannot be used for this purpose. ## Notification Format Notifications arrive as HTTP POST requests with Content-Type: application/json. event identifies the event type, timestamp is the notification time, and data contains the event-specific fields. Use data.event_id to identify duplicate deliveries. Store it together with your integration identifier and process each event only once. ``` { "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 } } ``` ## Verification and confirmation X-Webhook-Signature contains an HMAC-SHA256 signature encoded as lowercase hexadecimal. Calculate it using the original request body bytes and your webhook secret. Verify the signature before processing the event; re-serializing JSON changes the signed bytes. After verifying the signature and saving the event, return HTTP 200 or 201. Responses 202 and 204 do not acknowledge delivery. Respond within 10 seconds and perform lengthy processing after saving the event. Notifications may arrive more than once and out of order. Check the current subscription before changing its state. Delivery history is available in your integration settings. ## Available events - `mailbox.created` — The mailbox is created and ready to use. - `mailbox.expiring` — The end of the paid period for the mailbox is approaching. - `mailbox.renewed` — The paid period for the mailbox has been extended. - `mailbox.suspended` — Access to the mailbox is suspended: reading and sending are unavailable. - `mailbox.resumed` — Access to the mailbox has been restored. - `mailbox.deleting_soon` — There is one hour left before the unpaid mailbox is deleted. - `mailbox.deleted` — The mailbox has been deleted. - `mailbox.account_changed` — The mailbox is linked to another mail account. - `mail.message.received` — A new incoming message has appeared in the mailbox. - `mail.operation.succeeded` — The operation was completed successfully. For sending, this means acceptance of the message by the mail server, rather than delivery to the recipient's inbox. - `mail.operation.failed` — The operation failed. - `mail.operation.uncertain` — The sending outcome is unknown. Check the operation status before sending again. Payment reminders: 14, 7, 3, 2, 1 day and one hour before expiration. Renewal cancels outdated reminders that have not yet been sent. # Errors and retries ## Error format An error response contains detail: a string, an object with code/message, or a list of validation errors. Use the HTTP status and machine-readable code where available, rather than matching translated messages. ``` {"detail":"..."} {"detail":{"code":"...","message":"..."}} ``` ## HTTP status codes - `400` — Invalid header or identifier. Check your request. - `401` — The session or key was not accepted. Sign in again or check your key. - `403` — Insufficient rights or access to the mailbox is denied. - `404` — The resource was not found or is not available to the current account. - `409` — Folder state, quota, or generation conflict. Please update your data before retrying. - `413` — The file size exceeds the allowed limit. - `422` — Invalid request parameters. Check the fields provided in the response. - `429` — Too many requests. Please try again later. - `503` — The service is temporarily unavailable. Retry the request with a delay. After 401, authenticate again. After 409, refresh the resource state. Retry 503 responses with a delay, keeping the original Idempotency-Key for sends. Do not blindly repeat irreversible actions. # Connected applications ## Connect an application Connect your AI client using this address. Choose mailboxes and permissions when connecting. Allow access only to the mailboxes and actions you need. ``` 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 ``` ## Permissions - `mail.read` — Search and read messages, conversations and attachments. - `mail.send` — Send, reply to and forward messages. - `mail.manage` — Drafts, files, folders, read status, stars, archive and spam. - `mail.delete` — Trash and permanent deletion of messages, drafts and files. ## Revoke access Access lasts 30 days. You can revoke it in settings at any time. # Mailbox settings ## Email templates Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself. The template will replace the editor text. Recipients and attachments are preserved. ``` 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.

"} ``` ## Autoresponder Automatic replies work while your browser is closed and count towards sending limits. Mailing lists and automated messages are excluded. Supply autoresponder dates with a time zone; repeat_days ranges from 1 to 30. Replies apply only to new personal messages: From must match 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} ``` ## Filters Up to 100 filters per mailbox and 20 conditions per filter. Conditions compare complete headers; ASCII matching is case-insensitive, other characters are case-sensitive. The first matching filter applies. Sender rules take priority. Processing existing messages is a separate action. A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}. Incoming and custom folders will be processed. Sent, drafts, spam and trash are excluded. ``` 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 ``` ## Preview - `file_infected` — A threat was detected. Opening this file is blocked. - `file_scan_unavailable` — Antivirus is temporarily unavailable. Try again later. Add preview=pdf to a file or attachment content request for DOC, XLS, XLSX, PPT, PPTX and ODT. Limit: 10 conversions per minute per mailbox. X-File-Scan: clean and X-File-Scanned-At report the scan result and time. scanned_at in file lists may be null. Results are cached for one hour; threats or an unavailable scanner block file delivery. ``` 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 Login in browser This endpoint is reserved for adapt-mail.com and requires Origin: https://adapt-mail.com. It sets HttpOnly cookies and returns a non-secret session_id. Use /v1/auth/token for your own client. ```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": "Login in browser", "operationId": "login_v1_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "session_id": { "type": "string", "format": "uuid" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "Too many requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "This endpoint is reserved for adapt-mail.com and requires Origin: https://adapt-mail.com. It sets HttpOnly cookies and returns a non-secret session_id. Use /v1/auth/token for your own client.", "security": [] } ``` # POST /v1/auth/token Get a user token Issues an access token for one hour based on login and password. Specify mode=account to access all account mailboxes or mode=mailbox to access one address. Pass access_token in the Authorization: Bearer header. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/token' \ -H 'Content-Type: application/json' \ --data '{"login":"user-123","password":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Get a user token", "operationId": "token_v1_auth_token_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "Too many requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Issues an access token for one hour based on login and password. Specify mode=account to access all account mailboxes or mode=mailbox to access one address. Pass access_token in the Authorization: Bearer header.", "security": [] } ``` # GET /v1/auth/sessions Saved sessions Required cookie mail_browser. X-API-Key and Bearer do not replace this cookie. Without cookie an empty list is returned. ```sh curl -X GET 'https://adapt-mail.com/v1/auth/sessions' \ -b cookies.txt ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Saved sessions", "operationId": "sessions_v1_auth_sessions_get", "responses": { "200": { "description": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Required cookie mail_browser. X-API-Key and Bearer do not replace this cookie. Without cookie an empty list is returned.", "security": [ { "Browser": [] } ] } ``` # POST /v1/auth/logout Sign out Requires a user session. Revokes the selected session while preserving other sessions. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/logout' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "Sign out", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "logged_out": { "type": "boolean" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Requires a user session. Revokes the selected session while preserving other sessions." } ``` # GET /v1/me User profile Returns the profile of the current mail account. Use it to display the username and login in your application. ```sh curl -X GET 'https://adapt-mail.com/v1/me' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "User profile", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns the profile of the current mail account. Use it to display the username and login in your application." } ``` # GET /v1/avatars/{domain} Domain logo 200 - image; 202 — preparation, repeat after Retry-After; 204 - no logo; 503 - temporary error. The logo does not confirm the identity of the sender. ```sh curl -X GET 'https://adapt-mail.com/v1/avatars/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Логотипы доменов" ], "summary": "Domain logo", "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": "Successful response", "content": { "image/png": { "schema": { "type": "string", "format": "binary" } } } }, "202": { "description": "The logo is being prepared" }, "204": { "description": "No logo" }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "Too many requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "200 - image; 202 — preparation, repeat after Retry-After; 204 - no logo; 503 - temporary error. The logo does not confirm the identity of the sender." } ``` # GET /v1/domains List of domains Custom domains and a shared domain are available to create a personal address. ```sh curl -X GET 'https://adapt-mail.com/v1/domains' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "List of domains", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Domain" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Custom domains and a shared domain are available to create a personal address." } ``` # GET /v1/domains/{domain_id}/dns DNS-domain records The instructions contain the exact DNS- values ​​and the test result, but do not automatically change DNS. ```sh curl -X GET 'https://adapt-mail.com/v1/domains//dns' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "DNS-domain records", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "The instructions contain the exact DNS- values ​​and the test result, but do not automatically change DNS." } ``` # GET /v1/mailboxes Mailboxes and usage The list of mailboxes is limited by the owner or the only mailbox of the user session. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "Mailboxes and usage", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Mailbox" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "The list of mailboxes is limited by the owner or the only mailbox of the user session." } ``` # PATCH /v1/mailboxes/{mailbox_id} Mailbox settings Use /v1 to change name, password and signature. Change the shared quota_mb through your hosting panel. Files have no separate quota. Idempotency-Key is optional but recommended for retries. ```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": "Mailbox settings", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "400": { "description": "Invalid header or identifier", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Use /v1 to change name, password and signature. Change the shared quota_mb through your hosting panel. Files have no separate quota. Idempotency-Key is optional but recommended for retries." } ``` # GET /v1/mailboxes/{mailbox_id}/folders Folders and counters Returns a list of folders, the number of emails total, the number of unread messages unread and the value uidvalidity for each folder. Use the folder name and uidvalidity in queries to its letters. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//folders' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Folders and counters", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns a list of folders, the number of emails total, the number of unread messages unread and the value uidvalidity for each folder. Use the folder name and uidvalidity in queries to its letters." } ``` # POST /v1/mailboxes/{mailbox_id}/folders Creating a folder The custom folder is created in IMAP and is available to other mail clients. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//folders' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Creating a folder", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "The custom folder is created in IMAP and is available to other mail clients." } ``` # GET /v1/mailboxes/{mailbox_id}/messages List of messages Returns up to 40 messages, from new UID to old. For the next page, pass next_before as before. For next_before=null there are no more pages. Read does not set the read flag. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "List of messages", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns up to 40 messages, from new UID to old. For the next page, pass next_before as before. For next_before=null there are no more pages. Read does not set the read flag." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid} Email content Send folder, uidvalidity and uid from the mail list. HTML cleared, external images are not included. To mark a message as read, perform a separate action read. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages/?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Email content", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Send folder, uidvalidity and uid from the mail list. HTML cleared, external images are not included. To mark a message as read, perform a separate action read." } ``` # POST /v1/mailboxes/{mailbox_id}/messages/actions Actions with messages Applies an action to selected messages in one folder. Pass their IDs to uids, the folder name to folder and its uidvalidity. For action=move, also specify the target folder to 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": "Actions with messages", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "updated": { "type": "boolean" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Applies an action to selected messages in one folder. Pass their IDs to uids, the folder name to folder and its uidvalidity. For action=move, also specify the target folder to destination." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid}/eml Download the message at EML Returns the original MIME bytes, including headers and attachments, without marking the message as read. PDF export uses browser printing; there is no separate PDF endpoint. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages//eml?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Download the message at 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": "Successful response", "content": { "message/rfc822": { "schema": { "type": "string", "format": "binary" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns the original MIME bytes, including headers and attachments, without marking the message as read. PDF export uses browser printing; there is no separate PDF endpoint." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid}/attachments/{index} Download attachment Add preview=pdf to a file or attachment content request for DOC, XLS, XLSX, PPT, PPTX and ODT. Limit: 10 conversions per minute per mailbox. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages//attachments/?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Download attachment", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Add preview=pdf to a file or attachment content request for DOC, XLS, XLSX, PPT, PPTX and ODT. Limit: 10 conversions per minute per mailbox." } ``` # POST /v1/mailboxes/{mailbox_id}/send Send a message Idempotency-Key is required and must contain 8–128 characters. Repeating the same key and body returns the same operation; a different body returns 409. HTTP 202 means queued. Check the operation status to determine the outcome. ```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": "Send a message", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "400": { "description": "Invalid header or identifier", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "413": { "description": "Size limit exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Idempotency-Key is required and must contain 8–128 characters. Repeating the same key and body returns the same operation; a different body returns 409. HTTP 202 means queued. Check the operation status to determine the outcome." } ``` # GET /v1/operations List of operations Returns the last 100 operations. A session of an individual mailbox sees only its operations. ```sh curl -X GET 'https://adapt-mail.com/v1/operations' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "List of operations", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Operation" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns the last 100 operations. A session of an individual mailbox sees only its operations." } ``` # GET /v1/operations/{operation_id} Operation Status Returns the current state of an operation by its id. While status is equal to queued or running, the operation is not completed. Once completed, check result on success or error on error. ```sh curl -X GET 'https://adapt-mail.com/v1/operations/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Operation Status", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns the current state of an operation by its id. While status is equal to queued or running, the operation is not completed. Once completed, check result on success or error on error." } ``` # POST /v1/operations/{operation_id}/cancel Cancel sending Cancels sending a message while the operation is in state queued. If the sending has already started, completed or was cancelled, a 409 is returned. You cannot recall an already sent message using this method. ```sh curl -X POST 'https://adapt-mail.com/v1/operations//cancel' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Cancel sending", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "cancelled": { "type": "boolean" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Cancels sending a message while the operation is in state queued. If the sending has already started, completed or was cancelled, a 409 is returned. You cannot recall an already sent message using this method." } ``` # POST /v1/operations/{operation_id}/retry Retry an operation Retries a failed sender rule operation with kind=sender_rules and status=failed. This endpoint cannot resend messages. An incompatible state returns 409. Retrying mailbox creation or configuration through this endpoint is not permitted and returns 403. ```sh curl -X POST 'https://adapt-mail.com/v1/operations//retry' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Retry an operation", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Retries a failed sender rule operation with kind=sender_rules and status=failed. This endpoint cannot resend messages. An incompatible state returns 409. Retrying mailbox creation or configuration through this endpoint is not permitted and returns 403." } ``` # PUT /v1/mailboxes/{mailbox_id}/drafts/{draft_id} Save draft Creates or updates a draft with the given draft_id. Generate a UUID for a new draft and reuse it for subsequent saves. You can continue the draft on another device by signing into the same mailbox. ```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": "Save draft", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Creates or updates a draft with the given draft_id. Generate a UUID for a new draft and reuse it for subsequent saves. You can continue the draft on another device by signing into the same mailbox." } ``` # DELETE /v1/mailboxes/{mailbox_id}/drafts/{draft_id} Delete draft Deleting a draft does not affect an email that has already been queued. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//drafts/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Delete draft", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Deleting a draft does not affect an email that has already been queued." } ``` # GET /v1/mailboxes/{mailbox_id}/drafts List of drafts Returns up to 100 drafts, from newest to oldest. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//drafts' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "List of drafts", "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": "Successful response", "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": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "updated_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." } } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns up to 100 drafts, from newest to oldest." } ``` # GET /v1/mailboxes/{mailbox_id}/threads List conversations Returns up to 100 dialogs, starting with the most recently updated ones. Messages from folders Trash and Junk are not included in the list. The new message may appear with a slight delay; retry the request to update the list. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//threads' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "List conversations", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "thread_id": { "type": "string" }, "updated_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "messages": { "type": "integer" }, "unread": { "type": "integer" }, "senders": { "type": "array", "items": { "type": "string" } }, "subject": { "type": "string" }, "sender": { "type": "string" } } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns up to 100 dialogs, starting with the most recently updated ones. Messages from folders Trash and Junk are not included in the list. The new message may appear with a slight delay; retry the request to update the list." } ``` # GET /v1/mailboxes/{mailbox_id}/threads/{thread_id} Conversation messages Returns up to 100 letters of the selected conversation, from old to new. Pass thread_id from the dialog list. Emails that have already been deleted or are no longer available are not included in the response. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//threads/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Conversation messages", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Message" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns up to 100 letters of the selected conversation, from old to new. Pass thread_id from the dialog list. Emails that have already been deleted or are no longer available are not included in the response." } ``` # PUT /v1/mailboxes/{mailbox_id}/sender-rules Sender Rule Creates or updates a rule for the address sender. Specify action=spam to direct new emails from the sender to spam, or action=allow to allow his emails. The rule applies to future incoming emails. ```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": "Sender Rule", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Creates or updates a rule for the address sender. Specify action=spam to direct new emails from the sender to spam, or action=allow to allow his emails. The rule applies to future incoming emails." } ``` # GET /v1/mailboxes/{mailbox_id}/sender-rules List of sender rules Returns the sender rules for the selected mailbox. Each rule contains an address sender, an action action and an identifier id for subsequent deletion. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//sender-rules' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "List of sender rules", "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": "Successful response", "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": "Date and time in UTC. If there is no offset, the value also represents UTC." } } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns the sender rules for the selected mailbox. Each rule contains an address sender, an action action and an identifier id for subsequent deletion." } ``` # DELETE /v1/mailboxes/{mailbox_id}/sender-rules/{rule_id} Delete a sender rule Removes the sender rule by rule_id. Subsequent messages are processed by general mail rules. Already received messages remain in their folders. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//sender-rules/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Delete a sender rule", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Removes the sender rule by rule_id. Subsequent messages are processed by general mail rules. Already received messages remain in their folders." } ``` # GET /v1/mailboxes/{mailbox_id}/contacts Contact list Returns up to 1000 contacts sorted by name. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//contacts' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Contact list", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ContactResponse" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns up to 1000 contacts sorted by name." } ``` # POST /v1/mailboxes/{mailbox_id}/contacts Save contact Saves the contact's name and address in the selected mailbox. If a contact with the same email already exists, updates its name without creating a duplicate. ```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": "Save contact", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContactResponse" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Saves the contact's name and address in the selected mailbox. If a contact with the same email already exists, updates its name without creating a duplicate." } ``` # DELETE /v1/mailboxes/{mailbox_id}/contacts/{contact_id} Delete contact Deleting a contact does not delete messages. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//contacts/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "Delete contact", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Deleting a contact does not delete messages." } ``` # GET /v1/mailboxes/{mailbox_id}/files List of files Returns up to 1000 ready files of the selected mailbox. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "List of files", "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": "Successful response", "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": "Date and time in UTC. If there is no offset, the value also represents UTC." } } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Returns up to 1000 ready files of the selected mailbox." } ``` # POST /v1/mailboxes/{mailbox_id}/files Upload file Use multipart/form-data with the file field. Files must be 1 byte to 25 MiB. Antivirus scanning runs before upload. Insufficient quota returns 409; excessive size, 413; a detected threat, 422; an unavailable scanner, 503. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//files' \ -H 'Authorization: Bearer ' \ -F 'file=@document.pdf' ``` ```json { "tags": [ "Файлы" ], "summary": "Upload file", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/File" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "413": { "description": "Size limit exceeded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Use multipart/form-data with the file field. Files must be 1 byte to 25 MiB. Antivirus scanning runs before upload. Insufficient quota returns 409; excessive size, 413; a detected threat, 422; an unavailable scanner, 503." } ``` # GET /v1/mailboxes/{mailbox_id}/files/{file_id}/download Download file The response contains file bytes with Content-Disposition: attachment. The link requires authorization on each request; public URL storage is not issued. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files//download' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "Download file", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "The response contains file bytes with Content-Disposition: attachment. The link requires authorization on each request; public URL storage is not issued." } ``` # GET /v1/mailboxes/{mailbox_id}/files/{file_id}/content File Contents Add preview=pdf to a file or attachment content request for DOC, XLS, XLSX, PPT, PPTX and ODT. Limit: 10 conversions per minute per mailbox. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files//content' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "File Contents", "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": "Successful response", "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": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Add preview=pdf to a file or attachment content request for DOC, XLS, XLSX, PPT, PPTX and ODT. Limit: 10 conversions per minute per mailbox." } ``` # DELETE /v1/mailboxes/{mailbox_id}/files/{file_id} Delete file An incomplete submission file cannot be deleted: response 409. The quota is released after deletion. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//files/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "Delete file", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "An incomplete submission file cannot be deleted: response 409. The quota is released after deletion." } ``` # POST /v1/auth/login-link Create a sign-in link Your server calls POST /v1/auth/login-link with X-API-Key and X-Customer-ID. Set mailbox_id to open only that mailbox; omit it to open the entire account. locale selects the interface language. ```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": "Create a sign-in link", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkResult" } } } }, "401": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Your server calls POST /v1/auth/login-link with X-API-Key and X-Customer-ID. Set mailbox_id to open only that mailbox; omit it to open the entire account. locale selects the interface language." } ``` # POST /v1/auth/login-link/consume Exchange a link for a session For the adapt-mail.com sign-in page only: POST with Origin: https://adapt-mail.com. Returns session_id and HttpOnly cookies. Reused or expired link: 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": "Exchange a link for a session", "operationId": "consume_login_link_v1_auth_login_link_consume_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkConsume" } } }, "required": true }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrowserSessionResult" } } } }, "403": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "410": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "Request error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "For the adapt-mail.com sign-in page only: POST with Origin: https://adapt-mail.com. Returns session_id and HttpOnly cookies. Reused or expired link: HTTP 410.", "security": [] } ``` # GET /v1/mailboxes/{mailbox_id}/templates Email templates Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//templates' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Email templates", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TemplateRecord" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself." } ``` # POST /v1/mailboxes/{mailbox_id}/templates Email templates Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//templates' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Email templates", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateRecord" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself." } ``` # PUT /v1/mailboxes/{mailbox_id}/templates/{template_id} Email templates Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself. ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//templates/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Email templates", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateRecord" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself." } ``` # DELETE /v1/mailboxes/{mailbox_id}/templates/{template_id} Email templates Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//templates/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Email templates", "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": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "const": true } } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Up to 100 templates per mailbox. Fields: name, subject, text and html; HTML is sanitized. A template does not send mail by itself." } ``` # GET /v1/mailboxes/{mailbox_id}/autoresponder Autoresponder Supply autoresponder dates with a time zone; repeat_days ranges from 1 to 30. Replies apply only to new personal messages: From must match Return-Path. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//autoresponder' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Autoresponder", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Supply autoresponder dates with a time zone; repeat_days ranges from 1 to 30. Replies apply only to new personal messages: From must match Return-Path." } ``` # PUT /v1/mailboxes/{mailbox_id}/autoresponder Autoresponder Supply autoresponder dates with a time zone; repeat_days ranges from 1 to 30. Replies apply only to new personal messages: From must match 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": "Autoresponder", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "Supply autoresponder dates with a time zone; repeat_days ranges from 1 to 30. Replies apply only to new personal messages: From must match Return-Path." } ``` # GET /v1/mailboxes/{mailbox_id}/filters Filters A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//filters' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Filters", "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": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FilterRecord" } } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}." } ``` # POST /v1/mailboxes/{mailbox_id}/filters Filters A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through 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": "Filters", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterChange" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}." } ``` # PUT /v1/mailboxes/{mailbox_id}/filters/{filter_id} Filters A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through 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": "Filters", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterChange" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}." } ``` # DELETE /v1/mailboxes/{mailbox_id}/filters/{filter_id} Filters A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}. ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//filters/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Filters", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}." } ``` # POST /v1/mailboxes/{mailbox_id}/filters/{filter_id}/apply Apply to existing messages A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through GET /v1/operations/{operation_id}. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//filters//apply' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "Apply to existing messages", "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": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "Login required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "No access", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "State conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "Temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "A filter change returns operation. Applying to history requires an Idempotency-Key of 8–120 characters. Reuse the key when retrying; check status through 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": "Addresses of the main recipients." }, "cc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Cc", "description": "Copy recipient addresses that are visible to other participants." }, "bcc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Bcc", "description": "Bcc recipient addresses." }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "", "description": "Subject of the message." }, "text": { "type": "string", "maxLength": 200000, "title": "Text", "default": "", "description": "The text of the message without formatting." }, "html": { "anyOf": [ { "type": "string", "maxLength": 300000 }, { "type": "null" } ], "title": "Html", "description": "HTML-formatted version of the message." }, "file_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "maxItems": 20, "title": "File Ids", "description": "ID previously downloaded files in this mailbox. Get them when downloading or from the list of files." }, "forward_message": { "anyOf": [ { "$ref": "#/components/schemas/MessageReference" }, { "type": "null" } ], "description": "The original email whose attachments need to be forwarded." }, "reply_to_message_id": { "anyOf": [ { "type": "string", "maxLength": 998 }, { "type": "null" } ], "title": "Reply To Message Id", "description": "The message_id value of the email you are replying to." }, "references": { "anyOf": [ { "type": "string", "maxLength": 4000 }, { "type": "null" } ], "title": "References", "description": "The value references of the original message to save the reply chain." }, "send_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Send At", "description": "Delayed dispatch time with time zone, for example 2026-11-01T12:00:00Z. Without a value, dispatch begins as the queue is processed." } }, "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": "Folder name from the folder list, for example INBOX." }, "uidvalidity": { "type": "integer", "exclusiveMinimum": 0, "title": "Uidvalidity", "description": "The value is uidvalidity from the response API for this folder." }, "uids": { "items": { "type": "integer" }, "type": "array", "maxItems": 100, "minItems": 1, "title": "Uids", "description": "Identifiers of selected letters from one folder." }, "action": { "type": "string", "enum": [ "read", "unread", "star", "unstar", "move", "delete" ], "title": "Action" }, "destination": { "anyOf": [ { "type": "string", "maxLength": 255 }, { "type": "null" } ], "title": "Destination", "description": "Target folder name. Required for 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": "Folder name from the folder list, for example INBOX." }, "uidvalidity": { "type": "integer", "exclusiveMinimum": 0, "title": "Uidvalidity", "description": "The value is uidvalidity from the response API for this folder." }, "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": "Addresses of the main recipients." }, "cc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Cc", "description": "Copy recipient addresses that are visible to other participants." }, "bcc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Bcc", "description": "Bcc recipient addresses." }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "", "description": "Subject of the message." }, "text": { "type": "string", "maxLength": 200000, "title": "Text", "default": "", "description": "The text of the message without formatting." }, "html": { "anyOf": [ { "type": "string", "maxLength": 300000 }, { "type": "null" } ], "title": "Html", "description": "HTML-formatted version of the message." }, "file_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "maxItems": 20, "title": "File Ids", "description": "ID previously downloaded files in this mailbox. Get them when downloading or from the list of files." }, "forward_message": { "anyOf": [ { "$ref": "#/components/schemas/MessageReference" }, { "type": "null" } ], "description": "The original email whose attachments need to be forwarded." }, "reply_to_message_id": { "anyOf": [ { "type": "string", "maxLength": 998 }, { "type": "null" } ], "title": "Reply To Message Id", "description": "The message_id value of the email you are replying to." }, "references": { "anyOf": [ { "type": "string", "maxLength": 4000 }, { "type": "null" } ], "title": "References", "description": "The value references of the original message to save the reply chain." }, "send_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Send At", "description": "Delayed dispatch time with time zone, for example 2026-11-01T12:00:00Z. Without a value, dispatch begins as the queue is processed." } }, "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": "Date and time in UTC. If there is no offset, the value also represents 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": "Date and time in UTC. If there is no offset, the value also represents 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": "Operation ID for checking the status and canceling a pending submission." }, "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": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "created_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "completed_at": { "anyOf": [ { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, { "type": "null" } ] }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "The reason for the error if the operation did not complete successfully." }, "result": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "description": "The result of the operation. For sending, contains information about accepted and rejected recipients." } } }, "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": "Date and time in UTC. If there is no offset, the value also represents UTC." }, { "type": "null" } ] }, "ready_at": { "anyOf": [ { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, { "type": "null" } ] }, "delete_after": { "anyOf": [ { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, { "type": "null" } ] }, "created_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "updated_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents 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": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "updated_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents 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": "Date and time in UTC. If there is no offset, the value also represents 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": "Date and time in UTC. If there is no offset, the value also represents 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": "Date and time in UTC. If there is no offset, the value also represents UTC." } } }, "FilterRecord": { "type": "object", "required": [ "id", "data", "updated_at" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailFilter" }, "updated_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." } } }, "FilterChange": { "type": "object", "required": [ "id", "data", "updated_at", "operation" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailFilter" }, "updated_at": { "type": "string", "description": "Date and time in UTC. If there is no offset, the value also represents UTC." }, "operation": { "$ref": "#/components/schemas/Operation" } } } } ```