跳转到内容
简体中文

致函

POST/v1/mailboxes/{mailbox_id}/send

必需 Idempotency-Key 8–128 个字符长。使用相同的键和主体重复返回相同的操作;另一个主体给出 409。HTTP 202 表示排队。检查操作的状态,而不是收到响应的事实。

授权和访问区域 · 错误和重复

要求

终端窗口
curl -X POST 'https://adapt-mail.com/v1/mailboxes/<mailbox_id>/send' \
-H 'Authorization: Bearer <access_token>' \
-H 'Idempotency-Key: message-20261019-0001' \
-H 'Content-Type: application/json' \
--data '{"to":["[email protected]"],"subject":"Hello","text":"A message from Adapt Mail"}'

选项

mailbox_idpath一定

integer

X-Customer-IDheader
选项 1

string

选项 2

null

Idempotency-Keyheader一定

string

minLength: 8

maxLength: 128

请求正文 · application/json

object

to一定

array

主要收件人的地址。

minItems: 1

maxItems: 50

数组元素

string

cc

array

复制其他参与者可见的收件人地址。

maxItems: 50

数组元素

string

bcc

array

密件抄送收件人地址。

maxItems: 50

数组元素

string

subject

string

信的主题。

默认: ""

maxLength: 998

text

string

信件正文,无格式。

默认: ""

maxLength: 200000

html

HTML- 信件的格式版本。

选项 1

string

maxLength: 300000

选项 2

null

file_ids

array

ID 以前下载的文件在此邮箱中。下载时或从文件列表中获取它们。

maxItems: 20

数组元素

string · uuid

forward_message

需要转发附件的原始邮件。

选项 1

object

folder一定

string

文件夹列表中的文件夹名称,例如 INBOX.

minLength: 1

maxLength: 255

uidvalidity一定

integer

该值是来自此文件夹的响应 API 的 uidvalidity 。

exclusiveMinimum: 0

uid一定

integer

exclusiveMinimum: 0

不接受未知字段。

选项 2

null

reply_to_message_id

您正在回复的电子邮件的 message_id 值。

选项 1

string

maxLength: 998

选项 2

null

references

原始消息的值 references 用于保存回复链。

选项 1

string

maxLength: 4000

选项 2

null

send_at

带时区的延迟调度时间,例如 2026-11-01T12:00:00Z. 如果没有值,则在处理队列时开始调度。

选项 1

string · date-time

选项 2

null

不接受未知字段。

响应

202 成功回复

application/json

object

id

string · uuid

用于检查状态和取消待处理提交的操作 ID。

kind

string

mailbox_id
选项 1

integer

选项 2

null

status

string

有效值: "queued" "running" "succeeded" "failed" "uncertain" "cancelled"

run_at

string

UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC.

created_at

string

UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC.

completed_at
选项 1

string

UTC. 中的日期和时间 如果没有偏移,该值也代表 UTC.

选项 2

null

error

如果操作未成功完成,则错误的原因。

选项 1

string

选项 2

null

result

操作的结果。对于发送,包含有关接受和拒绝的收件人的信息。

选项 1

object

选项 2

null

400 标头或标识符无效

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

401 需要登录

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

403 无法访问

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

404 找不到资源

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

409 国家冲突

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

413 超出尺寸

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

422 验证错误

application/json

object

detail

array

数组元素

object

loc一定

array

数组元素
选项 1

string

选项 2

integer

msg一定

string

type一定

string

503 暂时无法使用

application/json

object

detail
选项 1

string

选项 2

object

code

string

message

string

选项 3

array

数组元素

object

成功提交结果

操作的 result 字段是执行后的,而不是排队的响应。

object

message_id

string

smtp_accepted

boolean

sent_saved

boolean

accepted_recipients

array

数组元素

string

rejected_recipients

array

数组元素

object

email

string

code

integer