# Adapt Mail API 0.16.0 https://adapt-mail.com/zh-cn/docs/ # 文档 Adapt Mail ## 邮寄您的产品 将您的界面连接到 Adapt Mail: 邮箱、阅读和发送信件、显示对话框、管理文件、联系人和发件人规则。 创建帐户、连接域、支付邮箱费用并增加连接邮件的个人帐户中的容量。邮件 API 允许您使用已创建的邮箱。 ## 从授权开始 对于服务器集成,请将邮件 API-key 与 X-Customer-ID. 一起使用。要为特定用户登录,请使用其登录名和密码接收 Bearer- 令牌。 ``` GET /v1/mailboxes X-API-Key: X-Customer-ID: ``` ## 第一次请求 基址 API - https://adapt-mail.com. 所有请求均通过 HTTPS. 处理 对于 JSON- 请求,请注明 Content-Type: application/json. 使用您的电子邮件帐户登录名和密码接收令牌。然后请求邮箱列表并存储所需邮箱的 id :它在请求地址中用作 mailbox_id 。将尖括号中的值替换为您自己的数据。 ``` curl https://adapt-mail.com/v1/auth/token \ -H "Content-Type: application/json" \ --data '{"login":"","password":"","mode":"account"}' curl https://adapt-mail.com/v1/mailboxes \ -H "Authorization: Bearer " ``` ## 文档格式 OpenAPI 模式描述了请求参数和响应。文件 llms-full.txt 包含文本格式的完整参考书。下载链接位于每个页面的开头。 # 授权和访问区域 ## 通过链接登录 您的服务器使用 X-API-Key 和 X-Customer-ID 调用 POST /v1/auth/login-link。设置 mailbox_id 可仅打开该邮箱;省略此字段则打开整个账户。locale 用于选择界面语言。 响应包含 login_url、expires_in=300、expires_at(UTC)、account_id 和 mailbox_id。“打开邮箱”按钮应打开完整的 login_url,包括 #token。链接有效期为 5 分钟且只能使用一次。请勿将其写入日志,也不要在浏览器中暴露 API 密钥。 登录页面从地址栏移除令牌,并将其换为 HttpOnly Cookie。若失败或过期,请创建新链接。系统会重新检查访问范围及账户和邮箱状态。用户会话不能创建登录链接。 ``` curl https://adapt-mail.com/v1/auth/login-link \ -H "X-API-Key: " \ -H "X-Customer-ID: " \ -H "Content-Type: application/json" \ --data '{"mailbox_id":42,"locale":"en"}' { "login_url": "https://adapt-mail.com/auth/#token=", "expires_in": 300, "expires_at": "2026-10-20T12:05:00Z", "account_id": 123, "mailbox_id": 42 } ``` ## 合作伙伴密钥 使用集成的邮件 API-key。将其传递给邮件帐户的 X-API-Key 和 ID - 在所需的标头 X-Customer-ID. 中,这是帐户的 ID,而不是邮箱的 external_id 也不是 ID。该密钥仅允许访问您的集成的客户端。 将密钥存储在您合作伙伴的服务器上。请勿将共享集成密钥放置在浏览器或移动应用程序中。 ``` curl 'https://adapt-mail.com/v1/mailboxes' \ -H 'X-API-Key: ' \ -H 'X-Customer-ID: ' ``` ## 用户令牌 POST /v1/auth/token 接受 login、password 和 mode. 对于 mode=account,使用登录名 user-ID,对于 mode=mailbox,使用完整邮箱地址。帐号和邮箱密码是独立的。 响应包含 access_token、token_type=Bearer 和 expires_in=3600. 帐户令牌打开其盒子;盒子代币 - 只有一个盒子。过期后,您将收到一个新的令牌。 ``` POST /v1/auth/token Content-Type: application/json {"login":"user-123","password":"","mode":"account"} GET /v1/mailboxes Authorization: Bearer ``` ## 浏览器会话 POST /v1/auth/login 用于其自己的站点 adapt-mail.com. 它需要正确的 Origin 并安装 HttpOnly cookies. 未分类 X-Mail-Session 选择已保存的输入之一,但没有 cookie 则不会授予访问权限。 对于第三方前端,请使用您的服务器和用户令牌。不要指望来自 cookie: public CORS 的任何站点的随机跨域访问。 # 调度和操作 ## 排队一封信 从 GET /v1/mailboxes. 接收 ID 盒子 为一次提交创建一个唯一的 Idempotency-Key 并保存直至最终结果。对于网络重放,请使用相同的密钥和相同的正文。 HTTP 202 返回操作对象,而不是交付确认。 Field id contains ID operations.民意调查 GET /v1/operations/{operation_id}. ``` POST /v1/mailboxes/42/send Idempotency-Key: message-20261019-0001 Content-Type: application/json {"to":["team@example.com"],"subject":"Hello","text":"A message from Adapt Mail"} ``` ## 如何理解结果 - `queued` — 这封信正在等待发送。 - `running` — 发送正在进行中。 - `succeeded` — 邮件服务器接受了提交。检查每个收件人的结果。 - `failed` — 发送失败。原因在 error. 中给出 - `cancelled` — 发货已取消。 - `uncertain` — 无法确认发送结果。请在重试之前检查操作和您的发送文件夹。 成功发送后,result 字段包含 accepted_recipients - 接受的收件人、rejected_recipients - 拒绝的收件人和 sent_saved - 在发送中保存副本的结果。邮件服务器接受信件并不保证信件能够送达收件人的收件箱。 要取消挂起的发送,请运行 POST /v1/operations/{operation_id}/cancel. /retry 方法不会重新发送电子邮件。 ## 回复、转发和延迟发送 要回复,请在 reply_to_message_id 中包含原始电子邮件的 message_id 并将其转发至 references. 在 to 中,输入 reply_to 的回复地址或发件人地址。要回复所有人,请将其他参与者添加到 to 和 cc,但不包括您自己的地址。 要转发附件,请传递 forward_message 以及 folder、uidvalidity 和 uid. 对于上传的文件,请使用 file_ids. 附件总大小限制为 25 MiB。 send_at 指定时区,存储在 UTC 中;一年内可延期发货。限制是在实际发送时检查的,而不是在队列创建时检查的。 # 通过 SMTP 发送邮件 ## 连接前的准备 使用邮箱地址和邮箱密码,通过 SMTP 从应用发送邮件。API 密钥和账户令牌不能用于 SMTP。 在已接入的域名下创建有效邮箱,并完成 DNS 记录验证。用户名是完整邮箱地址,例如 noreply@example.com。请使用该邮箱的密码,而不是邮件账户密码。将示例地址替换为自己的地址;程序运行时输入密码,输入内容不会显示。 ## 服务器、端口和加密 所有已接入的域名均使用 mail.adapt-mail.com。端口 465 在连接时立即启用 TLS;端口 587 先执行 STARTTLS,再进行身份验证。选择一种方式即可。请保持证书验证开启。 示例中的 From 地址和 SMTP 信封发件人均与邮箱用户名一致。发件人显示名称可以修改。端口 25 用于邮件服务器之间的通信;应用请使用 465 或 587。 ``` SMTP_HOST = "mail.adapt-mail.com" SMTP_PORT = 465 SMTP_USER = "noreply@example.com" SMTP_PASSWORD = "" SMTP_FROM = "noreply@example.com" SMTP_FROM_NAME = "Example" 465: implicit TLS 587: STARTTLS ``` ## Python:通过端口 465 发送 示例仅使用 Python 3 标准库。保存为 send_mail.py,然后运行 python3 send_mail.py。自动发送时,请从应用的安全配置中获取密码,不要将密码保存到 Git 或日志中。 ``` import smtplib import ssl from getpass import getpass from email.message import EmailMessage from email.utils import formataddr, make_msgid, formatdate username = "noreply@example.com" password = getpass("SMTP password: ") recipient = "recipient@example.net" message = EmailMessage() message["From"] = formataddr(("Example", username)) message["To"] = recipient message["Subject"] = "SMTP test" message["Date"] = formatdate(localtime=False, usegmt=True) message["Message-ID"] = make_msgid(domain=username.split("@")[1]) message.set_content("Hello! This message was sent through Adapt Mail SMTP.") with smtplib.SMTP_SSL( "mail.adapt-mail.com", 465, timeout=30, context=ssl.create_default_context(), ) as smtp: smtp.login(username, password) refused = smtp.send_message( message, from_addr=username, to_addrs=[recipient], ) print("Rejected recipients:", refused) ``` ## Python:通过端口 587 连接 使用 STARTTLS 时,保留上一个示例中准备邮件的代码,将 with smtplib.SMTP_SSL 代码块替换为以下代码。使用 smtplib.SMTP 时,只有 STARTTLS 成功后才会发送密码。 ``` with smtplib.SMTP("mail.adapt-mail.com", 587, timeout=30) as smtp: smtp.ehlo() smtp.starttls(context=ssl.create_default_context()) smtp.ehlo() smtp.login(username, password) refused = smtp.send_message( message, from_addr=username, to_addrs=[recipient], ) print("Rejected recipients:", refused) ``` ## HTML 和附件 在 set_content 之后添加 HTML 版本,在发送之前添加附件。保留纯文本版本,以兼容不支持 HTML 的客户端。仅使用可信 HTML,或对插入的数据进行转义。 ``` message.add_alternative( "

Hello! This message was sent through Adapt Mail.

", subtype="html", ) with open("document.pdf", "rb") as attachment: message.add_attachment( attachment.read(), maintype="application", subtype="pdf", filename="document.pdf", ) ``` ## 发送结果、限制和已发送邮件 send_message 成功表示 SMTP 服务器接受了邮件,并不代表邮件已进入收件人的收件箱。refused 字典包含被拒绝的收件人;若所有收件人都被拒绝,Python 会抛出 SMTPRecipientsRefused。 SMTP 和 API 共用每个邮箱的发送限制:滚动 60 秒内最多 30 封邮件,每封最多 50 位收件人,滚动 24 小时内最多 1000 位收件人;启用提高限额后为 5000 位。To、Cc 和 Bcc 中的所有收件人均计入。 直接通过 SMTP 发送不会自动在“已发送”文件夹中保存副本。邮件客户端通过 IMAP 保存副本;Adapt Mail API 发送时会单独保存副本。 ## SMTP 错误 - `535` — 身份验证失败:请检查完整邮箱地址、邮箱密码以及邮箱是否可用。 - `451` — 临时失败,也可能是超过发送限制。请等待一段时间后重试。 - `550 / 5xx` — 永久拒绝:请检查地址、发件人权限和响应内容。超过 50 位收件人的邮件会在 DATA 之后被拒绝。请先解决原因再重试。 - `TLS / timeout` — 请检查 mail.adapt-mail.com、端口、TLS 模式及应用服务器的出站网络访问。465 使用 SMTP_SSL,587 使用 SMTP 加 STARTTLS。 请阅读 SMTP 服务器的完整响应。遇到临时失败时,等待一段时间后重试。如果邮件传输后连接断开且结果未知,请勿盲目重发:SMTP 没有 Idempotency-Key,重试可能产生重复邮件。 # 信件和对话 ## 列表和页面 GET /v1/mailboxes/{mailbox_id}/folders 返回字母总数为 total、未读字母数为 unread 且值为 uidvalidity. 的文件夹。对于字母列表,请使用 GET /v1/mailboxes/{mailbox_id}/messages:,响应包含 items、next_before 和 uidvalidity,每页最多 40 个字母。 在下一个请求中将 next_before 作为 before 传递。 null 表示列表末尾。 q 的搜索限制为 200 个字符,并且根据邮件内容进行。 ``` GET /v1/mailboxes/42/messages?folder=INBOX GET /v1/mailboxes/42/messages?folder=INBOX&before=120 ``` ## 字母 ID uid 是文件夹内信件的标识符,folder 是文件夹的名称,mailbox_id 是邮箱的 ID。值 uidvalidity 确定文件夹中字母的编号版本。从答案 API 中取出所有四个值并将它们存储在一起。 如果 uidvalidity 已更改,请重新下载此文件夹的邮件列表:旧的 uid 无法再使用。阅读内容并不会将电子邮件标记为已读。要标记,请执行 POST /v1/mailboxes/{mailbox_id}/messages/actions 和 action=read. ``` POST /v1/mailboxes/42/messages/actions {"folder":"INBOX","uidvalidity":123456,"uids":[120],"action":"read"} ``` ## 通信作为对话 GET /v1/mailboxes/{mailbox_id}/threads 最多返回 100 个对话框。将所选对话的 thread_id 传递给 GET /v1/mailboxes/{mailbox_id}/threads/{thread_id} 以将其字母从旧到新。 对话中可能会稍有延迟地出现新字母。更新列表;要检查提交情况,请使用操作状态。无需因显示延迟而重新发送电子邮件。 # 限制和存储 ## 一般限制 SMTP 和 API 常规邮箱:24 小时内滚动 1000 个收件人。带有 outbound_high_limit=true: 5000 的框。60 秒内滑动最多 30 个字母;一封信的 To、Cc 和 Bcc 总共最多 50 个收件人。 收到的 SMTP- 收件人会被考虑在内,包括内部地址和不同信件中收件人的重复情况。没有单独的时间限制。这是发送权限的消耗,不是发送信件的统计。 GET /v1/mailboxes 返回两个窗口的限制、流量和余数。每封信的收件人限制没有累计费用。如果电表不可用,服务器将返回 503,而不是零消耗。 ``` { "outbound_daily_recipient_limit": 1000, "outbound_daily_recipients_used": 120, "outbound_daily_recipients_remaining": 880, "outbound_messages_per_minute": 30, "outbound_minute_messages_used": 2, "outbound_minute_messages_remaining": 28, "outbound_recipients_per_message": 50 } ``` ## 超过限制 API-send 可能会收到 202,然后失败 failed,出现 mail_daily_limit_exceeded 或 mail_minute_limit_exceeded. 超过 50 个收件人会立即被拒绝,出现 422。 如果超出窗口,SMTP 返回临时失败 451;如果收件人超过 50 个,则在 DATA 之后返回 550。无法通过其他协议绕过限制。 ## 邮件和文件 quota_mb 是邮件和文件共用的容量,单位为 MiB。used_bytes 是总已用空间,单位为字节。storage_shared=true;file_quota_bytes 等于 quota_mb × 1048576,不是额外容量。file_used_bytes 是已上传文件的原始大小,已计入总用量。 文件与邮件一起存储在我们的磁盘上。共用配额包含 MIME 编码和邮件头。已发送邮件中的附件副本会额外占用空间。外部 IMAP 客户端可见 Adapt Files 系统文件夹:删除该文件夹会删除保存的文件。 您可以在连接电子邮件的个人帐户中进行续订和增加数量。付费期结束后,阅读和发送将被阻止。 24小时后,开始拆箱;在此日期之前续订您的订阅。 # 事件和网络钩子 ## 连接网络钩子 在集成设置中指定接收 Webhook 的地址。它将收到有关新信件、邮箱状态和操作结果的通知。 在集成设置中,设置单独的 Webhook 密钥并启用传递。该秘密用于验证通知签名; mail API-key 不适合此操作。 ## 通知格式 通知来自 HTTP POST- 请求,其中 Content-Type: application/json. 字段 event 包含事件类型、timestamp — 通知时间、data — 事件数据。 data 的组成取决于事件。 标识符 data.event_id 允许您识别重新投递。将其与您的集成 ID 一起存储,并且仅处理一个事件一次。 ``` { "event": "mail.message.received", "timestamp": "2026-11-01T12:00:00Z", "data": { "event_id": "00000000-0000-4000-8000-000000000001", "created_at": "2026-11-01T12:00:00Z", "mailbox_id": 42, "folder": "INBOX", "uidvalidity": 123456, "uid": 120 } } ``` ## 验证与确认 标头 X-Webhook-Signature 包含小写十六进制表示法的 HMAC-SHA256。根据请求正文的原始字节和 Webhook 密钥计算签名。处理数据前检查签名;重新序列化 JSON 将更改正在签名的字节。 验证签名并保存事件后,返回 HTTP 200 或 201。响应 202 和 204 不确认收到。 10秒内回复;保存事件后执行冗长的处理。 通知可能会重复且无序地到达。在更改订阅状态之前,请检查其当前详细信息。集成设置中提供了交付历史记录。 ## 发生什么事件 - `mailbox.created` — 该盒子已创建并可供使用。 - `mailbox.expiring` — 盒子的付费期即将结束。 - `mailbox.renewed` — 盒子的付费期限已延长。 - `mailbox.suspended` — 邮箱访问被暂停:无法读取和发送。 - `mailbox.resumed` — 对邮箱的访问已恢复。 - `mailbox.deleting_soon` — 距离未付费盒子被删除还有一小时。 - `mailbox.deleted` — 该框已被删除。 - `mailbox.account_changed` — 该邮箱已链接到另一个邮件帐户。 - `mail.message.received` — 邮箱中出现了一封新收到的信件。 - `mail.operation.succeeded` — 手术顺利完成。对于发送,这意味着邮件服务器接受信件,而不是递送到收件人的收件箱。 - `mail.operation.failed` — 操作失败。 - `mail.operation.uncertain` — 发送结果未知。请在重新发送前检查状况。 付款提醒:到期前14、7、3、2、1天1小时。续订会取消尚未发送的过时提醒。 # 错误和重复 ## 错误格式 错误响应包含 detail: 字符串、带有 code/message 的对象或验证错误列表。不要根据翻译文本确定行为:使用 HTTP-status 和机器生成的 code(如果存在)。 ``` {"detail":"..."} {"detail":{"code":"...","message":"..."}} ``` ## 代码 HTTP - `400` — 标头或标识符无效。检查您的要求。 - `401` — 会话或密钥未被接受。重新登录或检查您的密钥。 - `403` — 权限不足或对邮箱的访问被拒绝。 - `404` — 找不到资源或当前帐户无法使用该资源。 - `409` — 文件夹状态、配额或生成冲突。请在重试之前更新您的数据。 - `413` — 文件大小超出了允许的限制。 - `422` — 请求参数无效。检查响应中提供的字段。 - `429` — 请求太多。请稍后重试。 - `503` — 该服务暂时不可用。延迟重试请求。 401之后,需要重新登录。 409之后,重新读取状态。 503后,延迟重复;发送时,保持Idempotency-Key.不变,不要盲目重复不可逆转的动作。 # 已连接的应用 ## 连接应用 使用此地址连接AI客户端,并在连接时选择邮箱和权限。 仅允许访问所需的邮箱和操作。 ``` URL / Resource: https://adapt-mail.com/mcp Transport: Streamable HTTP Authorization: OAuth 2.1 / PKCE S256 OAuth discovery: /.well-known/oauth-authorization-server Resource metadata: /.well-known/oauth-protected-resource/mcp ``` ## 权限 - `mail.read` — 搜索和读取邮件、会话及附件。 - `mail.send` — 发送、回复和转发邮件。 - `mail.manage` — 管理草稿、文件、文件夹、已读状态、重要标记、归档和垃圾邮件。 - `mail.delete` — 移至回收站及永久删除邮件、草稿和文件。 ## 撤销访问权限 访问权限有效期为30天,可随时在设置中撤销。 # 邮箱设置 ## 邮件模板 每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。 模板将替换编辑器中的正文,收件人和附件将保留。 ``` POST /v1/mailboxes/42/templates Content-Type: application/json {"name":"Welcome","subject":"Welcome","text":"Thank you for joining us.","html":"

Thank you for joining us.

"} ``` ## 自动回复 关闭浏览器后仍会自动回复,并计入发送限额。不回复邮件列表及自动邮件。 自动回复的日期必须包含时区;repeat_days 范围为 1–30。仅回复新收到的私人邮件:From 必须与 Return-Path 一致。 ``` PUT /v1/mailboxes/42/autoresponder Content-Type: application/json {"enabled":true,"subject":"Away","text":"I will reply when I return.","starts_at":null,"ends_at":null,"repeat_days":7} ``` ## 过滤器 每个邮箱最多 100 个过滤器,每个过滤器最多 20 个条件。条件比较完整邮件头;ASCII 不区分大小写,其他字符区分大小写。 使用第一个匹配的过滤器,发件人规则优先。处理已有邮件需单独启动。 修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。 将处理收件箱和自定义文件夹,不包括已发送、草稿、垃圾邮件和已删除邮件。 ``` POST /v1/mailboxes/42/filters Content-Type: application/json {"name":"Invoices","enabled":true,"match":"all","conditions":[{"field":"subject","operator":"contains","value":"Invoice"}],"mark_read":false,"important":true,"trash":false,"move_to":null} POST /v1/mailboxes/42/filters/17/apply Idempotency-Key: apply-filter-0001 ``` ## 预览 - `file_infected` — 发现威胁,已阻止打开此文件。 - `file_scan_unavailable` — 杀毒服务暂时不可用,请稍后重试。 对于 DOC、XLS、XLSX、PPT、PPTX 和 ODT,在文件或附件内容请求中添加 preview=pdf。每个邮箱每分钟最多转换 10 次。 X-File-Scan: clean 和 X-File-Scanned-At 表示扫描结果与时间。文件列表中的 scanned_at 可以为 null。结果缓存一小时;检测到威胁或扫描服务不可用时,不会返回文件。 ``` GET /v1/mailboxes/42/files//content?preview=pdf X-File-Scan: clean X-File-Scanned-At: 2026-10-22T12:00:00Z ``` # POST /v1/auth/login 在浏览器中登录 该路线适用于 adapt-mail.com,需要 Origin: https://adapt-mail.com. 返回 HttpOnly cookies 和未分类 session_id. 供您的客户使用 /v1/auth/token. ```sh curl -X POST 'https://adapt-mail.com/v1/auth/login' \ -H 'Origin: https://adapt-mail.com' \ -c cookies.txt \ -H 'Content-Type: application/json' \ --data '{"login":"user-123","password":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "在浏览器中登录", "operationId": "login_v1_auth_login_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "session_id": { "type": "string", "format": "uuid" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "请求太多", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "该路线适用于 adapt-mail.com,需要 Origin: https://adapt-mail.com. 返回 HttpOnly cookies 和未分类 session_id. 供您的客户使用 /v1/auth/token.", "security": [] } ``` # POST /v1/auth/token 获取用户令牌 根据登录名和密码发出一小时的访问令牌。指定 mode=account 以访问所有帐户邮箱,或指定 mode=mailbox 以访问一个地址。在 Authorization: Bearer 标头中传递 access_token。 ```sh curl -X POST 'https://adapt-mail.com/v1/auth/token' \ -H 'Content-Type: application/json' \ --data '{"login":"user-123","password":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "获取用户令牌", "operationId": "token_v1_auth_token_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string" }, "token_type": { "type": "string", "const": "Bearer" }, "expires_in": { "type": "integer", "const": 3600 }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "请求太多", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "根据登录名和密码发出一小时的访问令牌。指定 mode=account 以访问所有帐户邮箱,或指定 mode=mailbox 以访问一个地址。在 Authorization: Bearer 标头中传递 access_token。", "security": [] } ``` # GET /v1/auth/sessions 已保存的会话 必需的 cookie mail_browser. X-API-Key 和 Bearer 不会替换此 cookie. 没有 cookie 则返回空列表。 ```sh curl -X GET 'https://adapt-mail.com/v1/auth/sessions' \ -b cookies.txt ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "已保存的会话", "operationId": "sessions_v1_auth_sessions_get", "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "session_id": { "type": "string" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "login": { "type": "string" }, "name": { "type": "string" } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "必需的 cookie mail_browser. X-API-Key 和 Bearer 不会替换此 cookie. 没有 cookie 则返回空列表。", "security": [ { "Browser": [] } ] } ``` # POST /v1/auth/logout 从会话中注销 仅限用户会话。调用所选的输入;保留剩余的输入。 ```sh curl -X POST 'https://adapt-mail.com/v1/auth/logout' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "从会话中注销", "operationId": "logout_v1_auth_logout_post", "security": [ { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "logged_out": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "仅限用户会话。调用所选的输入;保留剩余的输入。" } ``` # GET /v1/me 用户资料 返回当前邮件帐户的配置文件。使用它在您的应用程序中显示用户名和登录名。 ```sh curl -X GET 'https://adapt-mail.com/v1/me' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "用户资料", "operationId": "me_v1_me_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer" }, "email": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "type": "string" }, "verified": { "type": "boolean" }, "quota_mb": { "type": "integer" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "auth_type": { "type": "string" }, "login": { "type": "string" }, "is_admin": { "type": "boolean" }, "files_enabled": { "type": "boolean" }, "service_managed": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回当前邮件帐户的配置文件。使用它在您的应用程序中显示用户名和登录名。" } ``` # GET /v1/avatars/{domain} 域名标志 200-图像; 202 — 准备,在 Retry-After 之后重复; 204——无标志; 503 - 临时错误。该标志并不能确认发送者的身份。 ```sh curl -X GET 'https://adapt-mail.com/v1/avatars/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Логотипы доменов" ], "summary": "域名标志", "operationId": "avatar_v1_avatars__domain__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "domain", "in": "path", "required": true, "schema": { "type": "string", "title": "Domain" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "image/png": { "schema": { "type": "string", "format": "binary" } } } }, "202": { "description": "标志正在准备中" }, "204": { "description": "无标志" }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "429": { "description": "请求太多", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "200-图像; 202 — 准备,在 Retry-After 之后重复; 204——无标志; 503 - 临时错误。该标志并不能确认发送者的身份。" } ``` # GET /v1/domains 域列表 自定义域和共享域可用于创建个人地址。 ```sh curl -X GET 'https://adapt-mail.com/v1/domains' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "域列表", "operationId": "list_domains_v1_domains_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Domain" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "自定义域和共享域可用于创建个人地址。" } ``` # GET /v1/domains/{domain_id}/dns DNS-域名记录 指令包含准确的DNS-值和测试结果,但不会自动更改DNS。 ```sh curl -X GET 'https://adapt-mail.com/v1/domains//dns' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "DNS-域名记录", "operationId": "domain_dns_v1_domains__domain_id__dns_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "domain_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Domain Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "domain_id": { "type": "integer" }, "status": { "type": "string" }, "records": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "name": { "type": "string" }, "value": { "type": "string" }, "observed": { "type": "array", "items": { "type": "string" } }, "matches": { "type": "boolean" }, "error": { "type": "string" } } } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "指令包含准确的DNS-值和测试结果,但不会自动更改DNS。" } ``` # GET /v1/mailboxes 盒子清单及限制消费 邮箱列表受所有者或用户会话的唯一邮箱的限制。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "盒子清单及限制消费", "operationId": "list_mailboxes_v1_mailboxes_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Mailbox" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "邮箱列表受所有者或用户会话的唯一邮箱的限制。" } ``` # PATCH /v1/mailboxes/{mailbox_id} 邮箱设置 通过 /v1 可修改 name、password 和 signature。共用配额 quota_mb 请在托管服务控制面板中修改。文件没有独立配额。Idempotency-Key 为可选项,但建议在重试时使用。 ```sh curl -X PATCH 'https://adapt-mail.com/v1/mailboxes/' \ -H 'Authorization: Bearer ' \ -H 'Idempotency-Key: message-20261019-0001' \ -H 'Content-Type: application/json' \ --data '{"name":"Support","signature":"Support team"}' ``` ```json { "tags": [ "Домены и ящики" ], "summary": "邮箱设置", "operationId": "update_mailbox_v1_mailboxes__mailbox_id__patch", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "in": "header", "name": "Idempotency-Key", "required": false, "schema": { "type": "string", "minLength": 8, "maxLength": 128 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailboxUpdate" } } } }, "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "400": { "description": "标头或标识符无效", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "通过 /v1 可修改 name、password 和 signature。共用配额 quota_mb 请在托管服务控制面板中修改。文件没有独立配额。Idempotency-Key 为可选项,但建议在重试时使用。" } ``` # GET /v1/mailboxes/{mailbox_id}/folders 文件夹和计数器 返回文件夹列表、电子邮件数量 total、未读邮件数量 unread 以及每个文件夹的值 uidvalidity。使用文件夹名称和 uidvalidity 查询其字母。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//folders' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "文件夹和计数器", "operationId": "folders_v1_mailboxes__mailbox_id__folders_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "flags": { "type": "array", "items": { "type": "string" } }, "total": { "type": "integer" }, "unread": { "type": "integer" }, "uidvalidity": { "type": "integer" } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回文件夹列表、电子邮件数量 total、未读邮件数量 unread 以及每个文件夹的值 uidvalidity。使用文件夹名称和 uidvalidity 查询其字母。" } ``` # POST /v1/mailboxes/{mailbox_id}/folders 创建文件夹 自定义文件夹在 IMAP 中创建,可供其他邮件客户端使用。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//folders' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "创建文件夹", "operationId": "create_folder_v1_mailboxes__mailbox_id__folders_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NameInput" } } } }, "responses": { "201": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "自定义文件夹在 IMAP 中创建,可供其他邮件客户端使用。" } ``` # GET /v1/mailboxes/{mailbox_id}/messages 字母列表 返回最多 40 个字母,从新的 UID 到旧的。对于下一页,将 next_before 传递为 before. 对于 next_before=null ,没有更多页面。读取不会设置读取标志。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "字母列表", "operationId": "messages_v1_mailboxes__mailbox_id__messages_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "q", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 200, "default": "", "title": "Q" } }, { "name": "before", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "title": "Before" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/MessageSummary" } }, "next_before": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "uidvalidity": { "type": "integer" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回最多 40 个字母,从新的 UID 到旧的。对于下一页,将 next_before 传递为 before. 对于 next_before=null ,没有更多页面。读取不会设置读取标志。" } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid} 邮件内容 从邮件列表中发送 folder、uidvalidity 和 uid。 HTML 已清除,不包括外部图像。要将字母标记为已读,请执行单独的操作 read. ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages/?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "邮件内容", "operationId": "message_v1_mailboxes__mailbox_id__messages__uid__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "uid", "in": "path", "required": true, "schema": { "type": "integer", "title": "Uid" } }, { "name": "uidvalidity", "in": "query", "required": true, "schema": { "type": "integer", "title": "Uidvalidity" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Message" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "从邮件列表中发送 folder、uidvalidity 和 uid。 HTML 已清除,不包括外部图像。要将字母标记为已读,请执行单独的操作 read." } ``` # POST /v1/mailboxes/{mailbox_id}/messages/actions 带字母的动作 对一个文件夹中选定的邮件应用一项操作。将它们的 ID 传递给 uids,将文件夹名称传递给 folder 及其 uidvalidity. 对于 action=move,还将目标文件夹指定为 destination. ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//messages/actions' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"folder":"INBOX","uidvalidity":1,"uids":[1],"action":"read"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "带字母的动作", "operationId": "action_v1_mailboxes__mailbox_id__messages_actions_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MessageAction" } } } }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "updated": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "对一个文件夹中选定的邮件应用一项操作。将它们的 ID 传递给 uids,将文件夹名称传递给 folder 及其 uidvalidity. 对于 action=move,还将目标文件夹指定为 destination." } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid}/eml 下载这封信:EML 返回带有标头和附件的原始 MIME-bytes。不改变可读性。 PDF 通过打印在浏览器中创建;没有单独的 PDF- 路线。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages//eml?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "下载这封信:EML", "operationId": "export_eml_v1_mailboxes__mailbox_id__messages__uid__eml_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "uid", "in": "path", "required": true, "schema": { "type": "integer", "title": "Uid" } }, { "name": "uidvalidity", "in": "query", "required": true, "schema": { "type": "integer", "title": "Uidvalidity" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "message/rfc822": { "schema": { "type": "string", "format": "binary" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回带有标头和附件的原始 MIME-bytes。不改变可读性。 PDF 通过打印在浏览器中创建;没有单独的 PDF- 路线。" } ``` # GET /v1/mailboxes/{mailbox_id}/messages/{uid}/attachments/{index} 下载附件 对于 DOC、XLS、XLSX、PPT、PPTX 和 ODT,在文件或附件内容请求中添加 preview=pdf。每个邮箱每分钟最多转换 10 次。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//messages//attachments/?uidvalidity=' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "下载附件", "operationId": "attachment_v1_mailboxes__mailbox_id__messages__uid__attachments__index__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "uid", "in": "path", "required": true, "schema": { "type": "integer", "title": "Uid" } }, { "name": "index", "in": "path", "required": true, "schema": { "type": "integer", "title": "Index" } }, { "name": "uidvalidity", "in": "query", "required": true, "schema": { "type": "integer", "title": "Uidvalidity" } }, { "name": "folder", "in": "query", "required": false, "schema": { "type": "string", "default": "INBOX", "title": "Folder" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "name": "preview", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "pdf" ] } } ], "responses": { "200": { "description": "成功回复", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } }, "application/pdf": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "X-File-Scan": { "schema": { "type": "string" } }, "X-File-Scanned-At": { "schema": { "type": "string" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "对于 DOC、XLS、XLSX、PPT、PPTX 和 ODT,在文件或附件内容请求中添加 preview=pdf。每个邮箱每分钟最多转换 10 次。" } ``` # POST /v1/mailboxes/{mailbox_id}/send 致函 必需 Idempotency-Key 8–128 个字符长。使用相同的键和主体重复返回相同的操作;另一个主体给出 409。HTTP 202 表示排队。检查操作的状态,而不是收到响应的事实。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//send' \ -H 'Authorization: Bearer ' \ -H 'Idempotency-Key: message-20261019-0001' \ -H 'Content-Type: application/json' \ --data '{"to":["team@example.com"],"subject":"Hello","text":"A message from Adapt Mail"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "致函", "operationId": "send_v1_mailboxes__mailbox_id__send_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "in": "header", "name": "Idempotency-Key", "required": true, "schema": { "type": "string", "minLength": 8, "maxLength": 128 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendInput" } } } }, "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "400": { "description": "标头或标识符无效", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "413": { "description": "超出尺寸", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "必需 Idempotency-Key 8–128 个字符长。使用相同的键和主体重复返回相同的操作;另一个主体给出 409。HTTP 202 表示排队。检查操作的状态,而不是收到响应的事实。" } ``` # GET /v1/operations 操作清单 返回最后 100 个操作。单个邮箱的会话只能看到其操作。 ```sh curl -X GET 'https://adapt-mail.com/v1/operations' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "操作清单", "operationId": "operations_v1_operations_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Operation" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回最后 100 个操作。单个邮箱的会话只能看到其操作。" } ``` # GET /v1/operations/{operation_id} 运行状态 通过 id. 返回操作的当前状态。当 status 等于 queued 或 running 时,操作尚未完成。完成后,检查 result 是否成功,或 error 是否错误。 ```sh curl -X GET 'https://adapt-mail.com/v1/operations/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "运行状态", "operationId": "operation_v1_operations__operation_id__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "operation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Operation Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "通过 id. 返回操作的当前状态。当 status 等于 queued 或 running 时,操作尚未完成。完成后,检查 result 是否成功,或 error 是否错误。" } ``` # POST /v1/operations/{operation_id}/cancel 取消发送 当操作处于 queued. 状态时取消发送信件 如果发送已开始、完成或被取消,则返回 409。您无法使用此方法撤回已发送的信件。 ```sh curl -X POST 'https://adapt-mail.com/v1/operations//cancel' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "取消发送", "operationId": "cancel_v1_operations__operation_id__cancel_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "operation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Operation Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "cancelled": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "当操作处于 queued. 状态时取消发送信件 如果发送已开始、完成或被取消,则返回 409。您无法使用此方法撤回已发送的信件。" } ``` # POST /v1/operations/{operation_id}/retry 重复操作 重新启动发件人规则的应用:kind=sender_rules、status=failed. 使用此方法无法重复发送信件。对于不合适的状态,返回409;通过该方法重复创建和配置邮箱不可用,返回403。 ```sh curl -X POST 'https://adapt-mail.com/v1/operations//retry' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "重复操作", "operationId": "retry_operation_v1_operations__operation_id__retry_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "operation_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Operation Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "重新启动发件人规则的应用:kind=sender_rules、status=failed. 使用此方法无法重复发送信件。对于不合适的状态,返回409;通过该方法重复创建和配置邮箱不可用,返回403。" } ``` # PUT /v1/mailboxes/{mailbox_id}/drafts/{draft_id} 保存草稿 通过 draft_id. 创建或更新草稿 对于新草稿,生成 UUID;对于后续保存,请使用相同的标识符。登录同一邮箱后,您可以从另一台设备继续草稿。 ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//drafts/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"to":["team@example.com"],"subject":"Hello","text":"A message from Adapt Mail"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "保存草稿", "operationId": "save_draft_v1_mailboxes__mailbox_id__drafts__draft_id__put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "draft_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Draft Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DraftInput" } } } }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "通过 draft_id. 创建或更新草稿 对于新草稿,生成 UUID;对于后续保存,请使用相同的标识符。登录同一邮箱后,您可以从另一台设备继续草稿。" } ``` # DELETE /v1/mailboxes/{mailbox_id}/drafts/{draft_id} 删除草稿 删除草稿不会影响已排队的电子邮件。 ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//drafts/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "删除草稿", "operationId": "delete_draft_v1_mailboxes__mailbox_id__drafts__draft_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "draft_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Draft Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "删除草稿不会影响已排队的电子邮件。" } ``` # GET /v1/mailboxes/{mailbox_id}/drafts 草案清单 返回最多 100 个草稿,从最新到最旧。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//drafts' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "草案清单", "operationId": "drafts_v1_mailboxes__mailbox_id__drafts_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "mailbox_id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/DraftInput" }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回最多 100 个草稿,从最新到最旧。" } ``` # GET /v1/mailboxes/{mailbox_id}/threads 对话列表 从最近更新的对话框开始,最多返回 100 个对话框。来自文件夹 Trash 和 Junk 的邮件不包含在列表中。新字母可能会稍微延迟出现;重试更新列表的请求。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//threads' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "对话列表", "operationId": "threads_v1_mailboxes__mailbox_id__threads_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "thread_id": { "type": "string" }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "messages": { "type": "integer" }, "unread": { "type": "integer" }, "senders": { "type": "array", "items": { "type": "string" } }, "subject": { "type": "string" }, "sender": { "type": "string" } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "从最近更新的对话框开始,最多返回 100 个对话框。来自文件夹 Trash 和 Junk 的邮件不包含在列表中。新字母可能会稍微延迟出现;重试更新列表的请求。" } ``` # GET /v1/mailboxes/{mailbox_id}/threads/{thread_id} 对话书信 返回所选对话的最多 100 个字母(从旧到新)。从对话框列表中传递 thread_id。已删除或不再可用的电子邮件不包含在响应中。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//threads/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "对话书信", "operationId": "thread_v1_mailboxes__mailbox_id__threads__thread_id__get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "thread_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Thread Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Message" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回所选对话的最多 100 个字母(从旧到新)。从对话框列表中传递 thread_id。已删除或不再可用的电子邮件不包含在响应中。" } ``` # PUT /v1/mailboxes/{mailbox_id}/sender-rules 发件人规则 为地址 sender. 创建或更新规则 指定 action=spam 将来自发件人的新电子邮件定向到垃圾邮件,或指定 action=allow 以允许其电子邮件。该规则适用于将来传入的电子邮件。 ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//sender-rules' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"sender":"sender@example.com","action":"spam"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "发件人规则", "operationId": "sender_rule_v1_mailboxes__mailbox_id__sender_rules_put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SenderRule" } } } }, "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "为地址 sender. 创建或更新规则 指定 action=spam 将来自发件人的新电子邮件定向到垃圾邮件,或指定 action=allow 以允许其电子邮件。该规则适用于将来传入的电子邮件。" } ``` # GET /v1/mailboxes/{mailbox_id}/sender-rules 发件人规则列表 返回选定邮箱的发件人规则。每个规则包含一个地址 sender、一个操作 action 和一个用于后续删除的标识符 id。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//sender-rules' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "发件人规则列表", "operationId": "rules_v1_mailboxes__mailbox_id__sender_rules_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer" }, "mailbox_id": { "type": "integer" }, "sender": { "type": "string" }, "action": { "type": "string", "enum": [ "spam", "allow" ] }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回选定邮箱的发件人规则。每个规则包含一个地址 sender、一个操作 action 和一个用于后续删除的标识符 id。" } ``` # DELETE /v1/mailboxes/{mailbox_id}/sender-rules/{rule_id} 删除发件人规则 通过 rule_id. 删除发件人规则 后续邮件将按一般邮件规则处理。已收到的邮件保留在其文件夹中。 ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//sender-rules/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "删除发件人规则", "operationId": "delete_rule_v1_mailboxes__mailbox_id__sender_rules__rule_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "rule_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Rule Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "通过 rule_id. 删除发件人规则 后续邮件将按一般邮件规则处理。已收到的邮件保留在其文件夹中。" } ``` # GET /v1/mailboxes/{mailbox_id}/contacts 联系人名单 返回最多 1000 个按姓名排序的联系人。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//contacts' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "联系人名单", "operationId": "contacts_v1_mailboxes__mailbox_id__contacts_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ContactResponse" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回最多 1000 个按姓名排序的联系人。" } ``` # POST /v1/mailboxes/{mailbox_id}/contacts 保存联系方式 将联系人的姓名和地址保存在所选邮箱中。如果具有相同 email 的联系人已存在,则更新其姓名而不创建重复项。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//contacts' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"email":"team@example.com","name":"Support team"}' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "保存联系方式", "operationId": "add_contact_v1_mailboxes__mailbox_id__contacts_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Contact" } } } }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContactResponse" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "将联系人的姓名和地址保存在所选邮箱中。如果具有相同 email 的联系人已存在,则更新其姓名而不创建重复项。" } ``` # DELETE /v1/mailboxes/{mailbox_id}/contacts/{contact_id} 删除联系人 删除联系人不会删除消息。 ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//contacts/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Почтовый ящик" ], "summary": "删除联系人", "operationId": "remove_contact_v1_mailboxes__mailbox_id__contacts__contact_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "contact_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Contact Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "删除联系人不会删除消息。" } ``` # GET /v1/mailboxes/{mailbox_id}/files 文件列表 返回所选邮箱的最多 1000 个就绪文件。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "文件列表", "operationId": "files_v1_mailboxes__mailbox_id__files_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "filename": { "type": "string" }, "content_type": { "type": "string" }, "size_bytes": { "type": "integer" }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "返回所选邮箱的最多 1000 个就绪文件。" } ``` # POST /v1/mailboxes/{mailbox_id}/files 上传文件 multipart/form-data,字段 file. 大小从 1 字节到 25 MiB。防病毒软件在下载之前会检查文件。配额不足为 409,过大为 413,检测到威胁为 422,无法检查为 503。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//files' \ -H 'Authorization: Bearer ' \ -F 'file=@document.pdf' ``` ```json { "tags": [ "Файлы" ], "summary": "上传文件", "operationId": "upload_v1_mailboxes__mailbox_id__files_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_v1_mailboxes__mailbox_id__files_post" } } } }, "responses": { "201": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/File" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "413": { "description": "超出尺寸", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "multipart/form-data,字段 file. 大小从 1 字节到 25 MiB。防病毒软件在下载之前会检查文件。配额不足为 409,过大为 413,检测到威胁为 422,无法检查为 503。" } ``` # GET /v1/mailboxes/{mailbox_id}/files/{file_id}/download 下载文件 响应包含带有 Content-Disposition: attachment. 的文件字节 该链接需要对每个请求进行授权;未发布 public URL 存储。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files//download' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "下载文件", "operationId": "download_v1_mailboxes__mailbox_id__files__file_id__download_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "X-File-Scan": { "schema": { "type": "string" } }, "X-File-Scanned-At": { "schema": { "type": "string" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "响应包含带有 Content-Disposition: attachment. 的文件字节 该链接需要对每个请求进行授权;未发布 public URL 存储。" } ``` # GET /v1/mailboxes/{mailbox_id}/files/{file_id}/content 文件内容 对于 DOC、XLS、XLSX、PPT、PPTX 和 ODT,在文件或附件内容请求中添加 preview=pdf。每个邮箱每分钟最多转换 10 次。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//files//content' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "文件内容", "operationId": "content_v1_mailboxes__mailbox_id__files__file_id__content_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } }, { "name": "preview", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "pdf" ] } } ], "responses": { "200": { "description": "成功回复", "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } }, "application/pdf": { "schema": { "type": "string", "format": "binary" } } }, "headers": { "X-File-Scan": { "schema": { "type": "string" } }, "X-File-Scanned-At": { "schema": { "type": "string" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "对于 DOC、XLS、XLSX、PPT、PPTX 和 ODT,在文件或附件内容请求中添加 preview=pdf。每个邮箱每分钟最多转换 10 次。" } ``` # DELETE /v1/mailboxes/{mailbox_id}/files/{file_id} 删除文件 不完整的提交文件无法删除:响应409。删除后配额释放。 ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//files/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Файлы" ], "summary": "删除文件", "operationId": "remove_v1_mailboxes__mailbox_id__files__file_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "file_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "type": "boolean" } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "不完整的提交文件无法删除:响应409。删除后配额释放。" } ``` # POST /v1/auth/login-link 创建登录链接 您的服务器使用 X-API-Key 和 X-Customer-ID 调用 POST /v1/auth/login-link。设置 mailbox_id 可仅打开该邮箱;省略此字段则打开整个账户。locale 用于选择界面语言。 ```sh curl -X POST 'https://adapt-mail.com/v1/auth/login-link' \ -H 'X-API-Key: ' \ -H 'X-Customer-ID: ' \ -H 'Content-Type: application/json' \ --data '{"mailbox_id":1,"locale":"en"}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "创建登录链接", "operationId": "login_link_v1_auth_login_link_post", "security": [ { "PartnerKey": [], "Customer": [] } ], "parameters": [ { "name": "X-Customer-ID", "in": "header", "required": true, "schema": { "type": "integer", "minimum": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkInput" } } } }, "responses": { "201": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkResult" } } } }, "401": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "您的服务器使用 X-API-Key 和 X-Customer-ID 调用 POST /v1/auth/login-link。设置 mailbox_id 可仅打开该邮箱;省略此字段则打开整个账户。locale 用于选择界面语言。" } ``` # POST /v1/auth/login-link/consume 用链接换取会话 仅供 adapt-mail.com 登录页面使用:POST 请求须携带 Origin: https://adapt-mail.com。返回 session_id 和 HttpOnly Cookie。链接已使用或过期时返回 HTTP 410。 ```sh curl -X POST 'https://adapt-mail.com/v1/auth/login-link/consume' \ -H 'Origin: https://adapt-mail.com' \ -c cookies.txt \ -H 'Content-Type: application/json' \ --data '{"token":""}' ``` ```json { "tags": [ "Авторизация и аккаунт" ], "summary": "用链接换取会话", "operationId": "consume_login_link_v1_auth_login_link_consume_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginLinkConsume" } } }, "required": true }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrowserSessionResult" } } } }, "403": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "410": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "503": { "description": "请求错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "仅供 adapt-mail.com 登录页面使用:POST 请求须携带 Origin: https://adapt-mail.com。返回 session_id 和 HttpOnly Cookie。链接已使用或过期时返回 HTTP 410。", "security": [] } ``` # GET /v1/mailboxes/{mailbox_id}/templates 邮件模板 每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//templates' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "邮件模板", "operationId": "templates_v1_mailboxes__mailbox_id__templates_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TemplateRecord" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。" } ``` # POST /v1/mailboxes/{mailbox_id}/templates 邮件模板 每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//templates' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "邮件模板", "operationId": "create_template_v1_mailboxes__mailbox_id__templates_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailTemplate" } } } }, "responses": { "201": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateRecord" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。" } ``` # PUT /v1/mailboxes/{mailbox_id}/templates/{template_id} 邮件模板 每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。 ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//templates/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":""}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "邮件模板", "operationId": "update_template_v1_mailboxes__mailbox_id__templates__template_id__put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "template_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Template Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailTemplate" } } } }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TemplateRecord" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。" } ``` # DELETE /v1/mailboxes/{mailbox_id}/templates/{template_id} 邮件模板 每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。 ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//templates/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "邮件模板", "operationId": "delete_template_v1_mailboxes__mailbox_id__templates__template_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "template_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Template Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "object", "properties": { "deleted": { "const": true } } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "每个邮箱最多 100 个模板。字段为 name、subject、text 和 html;HTML 会经过清理。模板本身不会发送邮件。" } ``` # GET /v1/mailboxes/{mailbox_id}/autoresponder 自动回复 自动回复的日期必须包含时区;repeat_days 范围为 1–30。仅回复新收到的私人邮件:From 必须与 Return-Path 一致。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//autoresponder' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "自动回复", "operationId": "autoresponder_v1_mailboxes__mailbox_id__autoresponder_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "自动回复的日期必须包含时区;repeat_days 范围为 1–30。仅回复新收到的私人邮件:From 必须与 Return-Path 一致。" } ``` # PUT /v1/mailboxes/{mailbox_id}/autoresponder 自动回复 自动回复的日期必须包含时区;repeat_days 范围为 1–30。仅回复新收到的私人邮件:From 必须与 Return-Path 一致。 ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//autoresponder' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"enabled":false,"subject":"","text":"","starts_at":"2026-11-01T12:00:00Z","ends_at":"2026-11-01T12:00:00Z","repeat_days":7}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "自动回复", "operationId": "set_autoresponder_v1_mailboxes__mailbox_id__autoresponder_put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Autoresponder" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "自动回复的日期必须包含时区;repeat_days 范围为 1–30。仅回复新收到的私人邮件:From 必须与 Return-Path 一致。" } ``` # GET /v1/mailboxes/{mailbox_id}/filters 过滤器 修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。 ```sh curl -X GET 'https://adapt-mail.com/v1/mailboxes//filters' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "过滤器", "operationId": "filters_v1_mailboxes__mailbox_id__filters_get", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "200": { "description": "成功回复", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FilterRecord" } } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。" } ``` # POST /v1/mailboxes/{mailbox_id}/filters 过滤器 修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//filters' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":"","conditions":[{"field":"from","operator":"contains","value":""}]}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "过滤器", "operationId": "create_filter_v1_mailboxes__mailbox_id__filters_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailFilter" } } } }, "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterChange" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。" } ``` # PUT /v1/mailboxes/{mailbox_id}/filters/{filter_id} 过滤器 修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。 ```sh curl -X PUT 'https://adapt-mail.com/v1/mailboxes//filters/' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ --data '{"name":"","conditions":[{"field":"from","operator":"contains","value":""}]}' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "过滤器", "operationId": "update_filter_v1_mailboxes__mailbox_id__filters__filter_id__put", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "filter_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Filter Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MailFilter" } } } }, "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterChange" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。" } ``` # DELETE /v1/mailboxes/{mailbox_id}/filters/{filter_id} 过滤器 修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。 ```sh curl -X DELETE 'https://adapt-mail.com/v1/mailboxes//filters/' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "过滤器", "operationId": "delete_filter_v1_mailboxes__mailbox_id__filters__filter_id__delete", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "filter_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Filter Id" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。" } ``` # POST /v1/mailboxes/{mailbox_id}/filters/{filter_id}/apply 应用于现有邮件 修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。 ```sh curl -X POST 'https://adapt-mail.com/v1/mailboxes//filters//apply' \ -H 'Authorization: Bearer ' ``` ```json { "tags": [ "Настройки ящика" ], "summary": "应用于现有邮件", "operationId": "apply_filter_v1_mailboxes__mailbox_id__filters__filter_id__apply_post", "security": [ { "PartnerKey": [], "Customer": [] }, { "Session": [] }, { "Browser": [] } ], "parameters": [ { "name": "mailbox_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Mailbox Id" } }, { "name": "filter_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Filter Id" } }, { "name": "idempotency-key", "in": "header", "required": true, "schema": { "type": "string", "minLength": 8, "maxLength": 120, "title": "Idempotency-Key" } }, { "name": "X-Customer-ID", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Customer-Id" } } ], "responses": { "202": { "description": "成功回复", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Operation" } } } }, "401": { "description": "需要登录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "无法访问", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "找不到资源", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "国家冲突", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "503": { "description": "暂时无法使用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "description": "修改过滤器返回 operation。应用于历史邮件需要 8–120 个字符的 Idempotency-Key。重试时使用同一个键,通过 GET /v1/operations/{operation_id} 查询状态。" } ``` # Schemas ```json { "Body_upload_v1_mailboxes__mailbox_id__files_post": { "properties": { "file": { "type": "string", "format": "binary", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_upload_v1_mailboxes__mailbox_id__files_post" }, "Contact": { "properties": { "email": { "type": "string", "title": "Email" }, "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" } }, "additionalProperties": false, "type": "object", "required": [ "email", "name" ], "title": "Contact", "example": { "email": "team@example.com", "name": "Support team" } }, "DraftInput": { "properties": { "to": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "To", "description": "主要收件人的地址。" }, "cc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Cc", "description": "复制其他参与者可见的收件人地址。" }, "bcc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Bcc", "description": "密件抄送收件人地址。" }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "", "description": "信的主题。" }, "text": { "type": "string", "maxLength": 200000, "title": "Text", "default": "", "description": "信件正文,无格式。" }, "html": { "anyOf": [ { "type": "string", "maxLength": 300000 }, { "type": "null" } ], "title": "Html", "description": "HTML- 信件的格式版本。" }, "file_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "maxItems": 20, "title": "File Ids", "description": "ID 以前下载的文件在此邮箱中。下载时或从文件列表中获取它们。" }, "forward_message": { "anyOf": [ { "$ref": "#/components/schemas/MessageReference" }, { "type": "null" } ], "description": "需要转发附件的原始邮件。" }, "reply_to_message_id": { "anyOf": [ { "type": "string", "maxLength": 998 }, { "type": "null" } ], "title": "Reply To Message Id", "description": "您正在回复的电子邮件的 message_id 值。" }, "references": { "anyOf": [ { "type": "string", "maxLength": 4000 }, { "type": "null" } ], "title": "References", "description": "原始消息的值 references 用于保存回复链。" }, "send_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Send At", "description": "带时区的延迟调度时间,例如 2026-11-01T12:00:00Z. 如果没有值,则在处理队列时开始调度。" } }, "additionalProperties": false, "type": "object", "title": "DraftInput", "example": { "to": [ "team@example.com" ], "subject": "Hello", "text": "A message from Adapt Mail" } }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "Login": { "properties": { "login": { "type": "string", "title": "Login" }, "password": { "type": "string", "maxLength": 128, "minLength": 1, "title": "Password" }, "mode": { "type": "string", "enum": [ "account", "mailbox" ], "title": "Mode", "default": "account" } }, "additionalProperties": false, "type": "object", "required": [ "login", "password" ], "title": "Login" }, "MailboxUpdate": { "properties": { "name": { "anyOf": [ { "type": "string", "maxLength": 120, "minLength": 1 }, { "type": "null" } ], "title": "Name" }, "quota_mb": { "anyOf": [ { "type": "integer", "minimum": 10240 }, { "type": "null" } ], "title": "Quota Mb" }, "file_quota_mb": { "anyOf": [ { "type": "integer", "maximum": 512000, "minimum": 256 }, { "type": "null" } ], "title": "File Quota Mb" }, "password": { "anyOf": [ { "type": "string", "maxLength": 128, "minLength": 12 }, { "type": "null" } ], "title": "Password" }, "signature": { "anyOf": [ { "type": "string", "maxLength": 5000 }, { "type": "null" } ], "title": "Signature" } }, "additionalProperties": false, "type": "object", "title": "MailboxUpdate", "example": { "name": "Support", "signature": "Support team" } }, "MessageAction": { "properties": { "folder": { "type": "string", "maxLength": 255, "minLength": 1, "title": "Folder", "description": "文件夹列表中的文件夹名称,例如 INBOX." }, "uidvalidity": { "type": "integer", "exclusiveMinimum": 0, "title": "Uidvalidity", "description": "该值是来自此文件夹的响应 API 的 uidvalidity 。" }, "uids": { "items": { "type": "integer" }, "type": "array", "maxItems": 100, "minItems": 1, "title": "Uids", "description": "从一个文件夹中选定的字母的标识符。" }, "action": { "type": "string", "enum": [ "read", "unread", "star", "unstar", "move", "delete" ], "title": "Action" }, "destination": { "anyOf": [ { "type": "string", "maxLength": 255 }, { "type": "null" } ], "title": "Destination", "description": "目标文件夹名称。 action=move. 所需" } }, "additionalProperties": false, "type": "object", "required": [ "folder", "uidvalidity", "uids", "action" ], "title": "MessageAction" }, "MessageReference": { "properties": { "folder": { "type": "string", "maxLength": 255, "minLength": 1, "title": "Folder", "description": "文件夹列表中的文件夹名称,例如 INBOX." }, "uidvalidity": { "type": "integer", "exclusiveMinimum": 0, "title": "Uidvalidity", "description": "该值是来自此文件夹的响应 API 的 uidvalidity 。" }, "uid": { "type": "integer", "exclusiveMinimum": 0, "title": "Uid" } }, "additionalProperties": false, "type": "object", "required": [ "folder", "uidvalidity", "uid" ], "title": "MessageReference" }, "NameInput": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "title": "NameInput" }, "SendInput": { "properties": { "to": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "minItems": 1, "title": "To", "description": "主要收件人的地址。" }, "cc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Cc", "description": "复制其他参与者可见的收件人地址。" }, "bcc": { "items": { "type": "string" }, "type": "array", "maxItems": 50, "title": "Bcc", "description": "密件抄送收件人地址。" }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "", "description": "信的主题。" }, "text": { "type": "string", "maxLength": 200000, "title": "Text", "default": "", "description": "信件正文,无格式。" }, "html": { "anyOf": [ { "type": "string", "maxLength": 300000 }, { "type": "null" } ], "title": "Html", "description": "HTML- 信件的格式版本。" }, "file_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "maxItems": 20, "title": "File Ids", "description": "ID 以前下载的文件在此邮箱中。下载时或从文件列表中获取它们。" }, "forward_message": { "anyOf": [ { "$ref": "#/components/schemas/MessageReference" }, { "type": "null" } ], "description": "需要转发附件的原始邮件。" }, "reply_to_message_id": { "anyOf": [ { "type": "string", "maxLength": 998 }, { "type": "null" } ], "title": "Reply To Message Id", "description": "您正在回复的电子邮件的 message_id 值。" }, "references": { "anyOf": [ { "type": "string", "maxLength": 4000 }, { "type": "null" } ], "title": "References", "description": "原始消息的值 references 用于保存回复链。" }, "send_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Send At", "description": "带时区的延迟调度时间,例如 2026-11-01T12:00:00Z. 如果没有值,则在处理队列时开始调度。" } }, "additionalProperties": false, "type": "object", "required": [ "to" ], "title": "SendInput", "example": { "to": [ "team@example.com" ], "subject": "Hello", "text": "A message from Adapt Mail" } }, "SenderRule": { "properties": { "sender": { "type": "string", "title": "Sender" }, "action": { "type": "string", "enum": [ "spam", "allow" ], "title": "Action", "default": "spam" } }, "additionalProperties": false, "type": "object", "required": [ "sender" ], "title": "SenderRule", "example": { "sender": "sender@example.com", "action": "spam" } }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "Address": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" } } }, "MessageSummary": { "type": "object", "properties": { "uid": { "type": "integer" }, "uidvalidity": { "type": "integer" }, "folder": { "type": "string" }, "message_id": { "type": "string" }, "thread_id": { "type": "string" }, "sender": { "type": "string" }, "recipients": { "type": "array", "items": { "$ref": "#/components/schemas/Address" } }, "subject": { "type": "string" }, "preview": { "type": "string" }, "flags": { "type": "array", "items": { "type": "string" } }, "size_bytes": { "type": "integer" }, "received_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } }, "Attachment": { "type": "object", "properties": { "index": { "type": "integer" }, "filename": { "type": "string" }, "content_type": { "type": "string" }, "size_bytes": { "type": "integer" } } }, "Message": { "type": "object", "properties": { "uid": { "type": "integer" }, "uidvalidity": { "type": "integer" }, "folder": { "type": "string" }, "message_id": { "type": "string" }, "thread_id": { "type": "string" }, "sender": { "type": "string" }, "recipients": { "type": "array", "items": { "$ref": "#/components/schemas/Address" } }, "subject": { "type": "string" }, "preview": { "type": "string" }, "flags": { "type": "array", "items": { "type": "string" } }, "size_bytes": { "type": "integer" }, "received_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "text": { "type": "string" }, "html": { "type": "string" }, "attachments": { "type": "array", "items": { "$ref": "#/components/schemas/Attachment" } }, "cc": { "type": "array", "items": { "$ref": "#/components/schemas/Address" } }, "references": { "type": "string" }, "reply_to": { "type": "string" } } }, "Operation": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "用于检查状态和取消待处理提交的操作 ID。" }, "kind": { "type": "string" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "status": { "type": "string", "enum": [ "queued", "running", "succeeded", "failed", "uncertain", "cancelled" ] }, "run_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "completed_at": { "anyOf": [ { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, { "type": "null" } ] }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "如果操作未成功完成,则错误的原因。" }, "result": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "description": "操作的结果。对于发送,包含有关接受和拒绝的收件人的信息。" } } }, "SendResult": { "type": "object", "properties": { "message_id": { "type": "string" }, "smtp_accepted": { "type": "boolean" }, "sent_saved": { "type": "boolean" }, "accepted_recipients": { "type": "array", "items": { "type": "string" } }, "rejected_recipients": { "type": "array", "items": { "type": "object", "properties": { "email": { "type": "string" }, "code": { "type": "integer" } } } } } }, "Mailbox": { "type": "object", "properties": { "id": { "type": "integer" }, "account_id": { "type": "integer" }, "domain_id": { "type": "integer" }, "email": { "type": "string" }, "name": { "type": "string" }, "quota_mb": { "type": "integer" }, "used_bytes": { "type": "integer" }, "file_quota_bytes": { "type": "integer" }, "file_used_bytes": { "type": "integer" }, "status": { "type": "string" }, "signature": { "type": "string" }, "enabled": { "type": "boolean" }, "access_allowed": { "type": "boolean" }, "paid_until": { "anyOf": [ { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, { "type": "null" } ] }, "ready_at": { "anyOf": [ { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, { "type": "null" } ] }, "delete_after": { "anyOf": [ { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, { "type": "null" } ] }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "reserved_quota_mb": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "outbound_high_limit": { "type": "boolean" }, "outbound_daily_recipient_limit": { "type": "integer" }, "outbound_daily_recipients_used": { "type": "integer" }, "outbound_daily_recipients_remaining": { "type": "integer" }, "outbound_messages_per_minute": { "type": "integer" }, "outbound_minute_messages_used": { "type": "integer" }, "outbound_minute_messages_remaining": { "type": "integer" }, "outbound_recipients_per_message": { "type": "integer" }, "storage_shared": { "type": "boolean", "const": true } } }, "Domain": { "type": "object", "properties": { "id": { "type": "integer" }, "account_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ] }, "name": { "type": "string" }, "status": { "type": "string" }, "is_shared": { "type": "boolean" }, "verification_token": { "type": "string" }, "dns_status": { "type": "object" }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } }, "File": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "filename": { "type": "string" }, "content_type": { "type": "string" }, "size_bytes": { "type": "integer" }, "scanned_at": { "anyOf": [ { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, { "type": "null" } ] } } }, "ContactResponse": { "type": "object", "properties": { "id": { "type": "integer" }, "mailbox_id": { "type": "integer" }, "email": { "type": "string" }, "name": { "type": "string" }, "created_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } }, "Error": { "type": "object", "properties": { "detail": { "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, { "type": "array", "items": { "type": "object" } } ] } } }, "LoginLinkInput": { "properties": { "mailbox_id": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0 }, { "type": "null" } ], "title": "Mailbox Id" }, "locale": { "type": "string", "enum": [ "en", "ru", "fr", "es", "de", "zh-cn", "ko", "tr", "hi", "pt-br" ], "title": "Locale", "default": "en" } }, "additionalProperties": false, "type": "object", "title": "LoginLinkInput" }, "LoginLinkConsume": { "properties": { "token": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "title": "Token" } }, "additionalProperties": false, "type": "object", "required": [ "token" ], "title": "LoginLinkConsume" }, "LoginLinkResult": { "properties": { "login_url": { "type": "string", "title": "Login Url" }, "expires_in": { "type": "integer", "const": 300, "title": "Expires In" }, "expires_at": { "type": "string", "title": "Expires At" }, "account_id": { "type": "integer", "title": "Account Id" }, "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mailbox Id" } }, "additionalProperties": false, "type": "object", "required": [ "login_url", "expires_in", "expires_at", "account_id", "mailbox_id" ], "title": "LoginLinkResult" }, "BrowserSessionResult": { "properties": { "mailbox_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Mailbox Id" }, "session_id": { "type": "string", "title": "Session Id" } }, "additionalProperties": false, "type": "object", "required": [ "mailbox_id", "session_id" ], "title": "BrowserSessionResult" }, "MailTemplate": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "subject": { "type": "string", "maxLength": 998, "title": "Subject", "default": "" }, "text": { "type": "string", "maxLength": 20000, "title": "Text", "default": "" }, "html": { "type": "string", "maxLength": 30000, "title": "Html", "default": "" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "title": "MailTemplate" }, "MailFilter": { "properties": { "name": { "type": "string", "maxLength": 120, "minLength": 1, "title": "Name" }, "enabled": { "type": "boolean", "title": "Enabled", "default": true }, "match": { "type": "string", "enum": [ "all", "any" ], "title": "Match", "default": "all" }, "conditions": { "items": { "$ref": "#/components/schemas/FilterCondition" }, "type": "array", "maxItems": 20, "minItems": 1, "title": "Conditions" }, "mark_read": { "type": "boolean", "title": "Mark Read", "default": false }, "important": { "type": "boolean", "title": "Important", "default": false }, "trash": { "type": "boolean", "title": "Trash", "default": false }, "move_to": { "anyOf": [ { "type": "string", "maxLength": 255, "minLength": 1 }, { "type": "null" } ], "title": "Move To" } }, "additionalProperties": false, "type": "object", "required": [ "name", "conditions" ], "title": "MailFilter" }, "FilterCondition": { "properties": { "field": { "type": "string", "enum": [ "from", "to", "cc", "subject" ], "title": "Field" }, "operator": { "type": "string", "enum": [ "contains", "not_contains", "equals", "not_equals" ], "title": "Operator" }, "value": { "type": "string", "maxLength": 200, "minLength": 1, "title": "Value" } }, "additionalProperties": false, "type": "object", "required": [ "field", "operator", "value" ], "title": "FilterCondition" }, "Autoresponder": { "properties": { "enabled": { "type": "boolean", "title": "Enabled", "default": false }, "subject": { "type": "string", "maxLength": 200, "title": "Subject", "default": "" }, "text": { "type": "string", "maxLength": 10000, "title": "Text", "default": "" }, "starts_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Starts At" }, "ends_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Ends At" }, "repeat_days": { "type": "integer", "maximum": 30, "minimum": 1, "title": "Repeat Days", "default": 7 } }, "additionalProperties": false, "type": "object", "title": "Autoresponder" }, "TemplateRecord": { "type": "object", "required": [ "id", "data", "updated_at" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailTemplate" }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } }, "FilterRecord": { "type": "object", "required": [ "id", "data", "updated_at" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailFilter" }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." } } }, "FilterChange": { "type": "object", "required": [ "id", "data", "updated_at", "operation" ], "properties": { "id": { "type": "integer" }, "data": { "$ref": "#/components/schemas/MailFilter" }, "updated_at": { "type": "string", "description": "UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC." }, "operation": { "$ref": "#/components/schemas/Operation" } } } } ```