邮件
事务性邮件,支持模板、域名验证与投递追踪。
概览
https://api.infrai.cc/v1/emailAuthorization: Bearer $INFRAI_API_KEY# Call any /v1/email capability over raw HTTP — no SDK to install.
# curl:
curl https://api.infrai.cc/v1/email/... \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json"方法
email.send
发送事务性邮件;支持模板、附件与 BYOK 供应商。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
to | string | string[] | 必填 | 收件地址或地址列表。 |
subject | string | 必填 | 邮件主题。 |
text | string | 可选 | 纯文本正文。 |
html | string | 可选 | HTML 正文。 |
from | string | 可选 | 发件地址(需已验证域名)。 |
cc | string[] | 可选 | 抄送地址。 |
bcc | string[] | 可选 | 密送地址。 |
template_id | string | 可选 | 用于渲染的模板 id(替代正文)。 |
template_vars | Record<string, unknown> | 可选 | 传入模板的变量。 |
attachments | Array<{ filename, content, mime? }> | 可选 | 要附加的文件。 |
vendor | string | 可选 | 固定使用某个供应商,而非自动路由。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
EmailRecord { email_id, state, to, subject, vendor, created_at }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/send \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "alice@example.com", "subject": "Welcome", "html": "<p>Hi!</p>"}'email.get
按 id 获取单条邮件记录。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 邮件记录 id。 |
返回
EmailRecord示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/get/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"email.list
列出邮件记录,支持状态与分页过滤。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
state | string | 可选 | 按记录状态过滤。 |
limit | number | 可选 | 返回的最大条数。 |
cursor | string | 可选 | 分页游标。 |
返回
{ items: EmailRecord[], next_cursor? }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/list \
-H "Authorization: Bearer $INFRAI_API_KEY"email.suppress
将某地址加入抑制名单。
返回
SuppressionRecord示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/suppress \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "..."}'email.domain.verify
验证发件域名并返回所需 DNS 记录。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
domain | string | 必填 | 要验证的域名。 |
返回
{ verified, records: Array<{ type, name, value }> }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/domain/verify \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "..."}'email.batch.send
批量个性化发送,最多 100 条不同邮件共用一个 idempotency_key(批量直通,单条不重复计费)。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
messages | EmailSendOptions[] | 必填 | 邮件数组,每项是一个完整的 EmailSendRequest,各自带收件人与模板变量,1 到 100 条。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
BatchSendResult { batch_id, results }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/batch/send \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": []}'email.cancel
取消一封尚未发出(计划中)的邮件。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 邮件记录 id。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
EmailStatus { message_id, state, ... }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/cancel/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'email.update
修改一封尚未发出(计划中)的邮件的主题、正文或计划发送时间。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 邮件记录 id。 |
subject | string | 可选 | 邮件主题。 |
body | string | 可选 | 纯文本正文。 |
html | string | 可选 | HTML 正文。 |
scheduled_at | string | 可选 | 新的计划发送时间(ISO 8601),必须晚于当前时间。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
EmailStatus { message_id, state, ... }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X PATCH https://api.infrai.cc/v1/email/update/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'email.event.list
列出邮件投递事件(送达、退信、打开、点击、投诉等)。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
message_id | string | 可选 | 按指定邮件的 message_id 过滤事件。 |
type | string | 可选 | 按事件类型过滤(如 delivered、bounced、opened)。 |
limit | number | 可选 | 返回的最大条数。 |
cursor | string | 可选 | 分页游标。 |
返回
{ items: EmailEvent[], next_cursor? }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/event/list \
-H "Authorization: Bearer $INFRAI_API_KEY"email.suppression.check
查询某个收件地址是否在抑制名单中。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
email | string | 必填 | 收件邮箱地址。 |
返回
SuppressionCheckResult { is_suppressed, record? }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/suppression/check/EMAIL \
-H "Authorization: Bearer $INFRAI_API_KEY"email.suppression.list
列出抑制名单中的收件地址。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
reason | string | 可选 | 按抑制原因过滤(如 bounce、complaint、manual)。 |
limit | number | 可选 | 返回的最大条数。 |
cursor | string | 可选 | 分页游标。 |
返回
{ items: SuppressionRecord[], next_cursor? }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/suppression/list \
-H "Authorization: Bearer $INFRAI_API_KEY"email.suppression.delete
将某地址移出抑制名单,恢复对其投递。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
email | string | 必填 | 收件邮箱地址。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
{ deleted: boolean }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X DELETE https://api.infrai.cc/v1/email/suppression/delete/EMAIL \
-H "Authorization: Bearer $INFRAI_API_KEY"email.domain.list
列出账户下已添加的发信域名。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | number | 可选 | 返回的最大条数。 |
cursor | string | 可选 | 分页游标。 |
返回
{ items: DomainVerification[], next_cursor? }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/domain/list \
-H "Authorization: Bearer $INFRAI_API_KEY"email.domain.get
获取某个发信域名的验证状态与信誉信息。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
domain | string | 必填 | 要验证的域名。 |
返回
DomainGetResult { verification, reputation }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/domain/get/DOMAIN \
-H "Authorization: Bearer $INFRAI_API_KEY"email.domain.delete
删除一个已添加的发信域名。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
domain | string | 必填 | 要验证的域名。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
{ deleted: boolean }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X DELETE https://api.infrai.cc/v1/email/domain/delete/DOMAIN \
-H "Authorization: Bearer $INFRAI_API_KEY"email.domain.rotate_dkim
为发信域名轮换 DKIM 密钥,返回需配置的新 DNS 记录。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
domain | string | 必填 | 要验证的域名。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
DomainVerification { domain, status, dns_records, ... }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/domain/rotate_dkim/DOMAIN \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'email.template.create
创建一个邮件模板。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | string | 必填 | 模板名称,账户内唯一。 |
subject | string | 必填 | 主题模板,可包含 {{var}} 占位符。 |
html | string | 必填 | HTML 正文模板,可包含 {{var}}、{{#section}}、{{^inverted}}。 |
body_text | string | 可选 | 纯文本备用正文。 |
variables | Record<string, string> | 可选 | 声明的变量及类型,如 { name: 'string' }。 |
default_vars | Record<string, unknown> | 可选 | 发送时变量缺失所用的默认值。 |
tags | string[] | 可选 | 模板标签列表。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
Template { template_id, name, subject, html, ... }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/template/create \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "...", "subject": "...", "html": "..."}'email.template.list
列出账户下的邮件模板。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | number | 可选 | 返回的最大条数。 |
cursor | string | 可选 | 分页游标。 |
返回
{ items: Template[], next_cursor? }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/template/list \
-H "Authorization: Bearer $INFRAI_API_KEY"email.template.get
获取单个邮件模板的详情。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 用于渲染的模板 id(替代正文)。 |
返回
Template { template_id, name, subject, html, ... }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X GET https://api.infrai.cc/v1/email/template/get/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"email.template.update
更新一个已有的邮件模板。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 用于渲染的模板 id(替代正文)。 |
subject | string | 可选 | 主题模板,可包含 {{var}} 占位符。 |
html | string | 可选 | HTML 正文模板,可包含 {{var}}、{{#section}}、{{^inverted}}。 |
body_text | string | 可选 | 纯文本备用正文。 |
variables | Record<string, string> | 可选 | 声明的变量及类型,如 { name: 'string' }。 |
default_vars | Record<string, unknown> | 可选 | 发送时变量缺失所用的默认值。 |
tags | string[] | 可选 | 模板标签列表。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
Template { template_id, name, subject, html, ... }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X PATCH https://api.infrai.cc/v1/email/template/update/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'email.template.delete
删除一个邮件模板。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 用于渲染的模板 id(替代正文)。 |
idempotency_key | string | 可选 | 可选去重 key;相同重试将返回同一结果。 |
返回
{ deleted: boolean }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X DELETE https://api.infrai.cc/v1/email/template/delete/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"email.template.preview
用给定变量渲染模板,预览主题、HTML、文本及缺失变量。
参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 必填 | 用于渲染的模板 id(替代正文)。 |
vars | Record<string, unknown> | 必填 | 用于渲染的变量值,会与模板的 default_vars 合并。 |
返回
TemplatePreview { rendered_subject, rendered_html, rendered_text, missing_vars }示例
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."curl -X POST https://api.infrai.cc/v1/email/template/preview/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"vars": {}}'全部能力
本模块全部已路由能力——完整的对外 REST 契约。上方方法是带讲解的入门示例,此表是完整参考。
| 能力 | 端点 | 说明 |
|---|---|---|
email.batch.send | POST /v1/email/batch/send | Send up to 100 personalized emails under one idempotency_key (batch passthrough, not billed per message). |
email.cancel | POST /v1/email/cancel/{id} | Cancel a scheduled email that has not yet been sent. |
email.domain.delete | DELETE /v1/email/domain/delete/{domain} | Delete a previously added sender domain. Distinct from hosted-URL custom domains (public_url.domain.*). |
email.domain.get | GET /v1/email/domain/get/{domain} | Get the verification status and reputation of a sender domain. Distinct from hosted-URL custom domains (public_url.domain.*). |
email.domain.list | GET /v1/email/domain/list | List the sender domains added to the account. Distinct from hosted-URL custom domains (public_url.domain.*). |
email.domain.rotate_dkim | POST /v1/email/domain/rotate_dkim/{domain} | Rotate DKIM for a sender domain and return the new DNS records. Distinct from hosted-URL custom domains (public_url.domain.*). |
email.domain.verify | POST /v1/email/domain/verify | Verify a sender domain's DNS records to complete verification. Distinct from hosted-URL custom domains (public_url.domain.*). |
email.event.list | GET /v1/email/event/list | List email delivery events (delivered, bounced, opened, clicked, complained). |
email.get | GET /v1/email/get/{id} | Get the delivery details of one email by message_id. |
email.list | GET /v1/email/list | Page through the account's sent-email records. |
email.send | POST /v1/email/send | Send a transactional email (inline body/HTML or a template) with tracking; idempotent. |
email.suppress | POST /v1/email/suppress | Add a recipient address to the suppression list to stop future delivery; idempotent. |
email.suppression.check | GET /v1/email/suppression/check/{email} | Check whether an address is on the suppression list. |
email.suppression.delete | DELETE /v1/email/suppression/delete/{email} | Remove an address from the suppression list to resume delivery. |
email.suppression.list | GET /v1/email/suppression/list | List recipient addresses on the suppression list. |
email.template.create | POST /v1/email/template/create | Create an email template. |
email.template.delete | DELETE /v1/email/template/delete/{id} | Delete an email template. |
email.template.get | GET /v1/email/template/get/{id} | Get the details of one email template. |
email.template.list | GET /v1/email/template/list | List the account's email templates. |
email.template.preview | POST /v1/email/template/preview/{id} | Render and preview a template with the given variables. |
email.template.update | PATCH /v1/email/template/update/{id} | Update an existing email template. |
email.update | PATCH /v1/email/update/{id} | Modify a scheduled email's subject, body, or send time. |
完整示例
本模块的生产级端到端范例:先一次性配置,再运行业务流程,尽量覆盖本模块的多数 API。
一次性前置(每个范例都假定已完成):
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at the console: Google/GitHub gives you
# $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..."# 1) Auth: every call is a raw HTTPS request to the Infrai gateway carrying
# only your project key. No SDK, no install.
# Get your key: sign in with Google/GitHub at the console for a project key
# + $2 free credit (email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT,
# POST /v1/account/topup and open the returned checkout_url.
export INFRAI_API_KEY="ifr_pk_proj_..." # from the console
# 2) email.send
curl -X POST https://api.infrai.cc/v1/email/send \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "alice@example.com", "subject": "Welcome", "html": "<p>Hi!</p>"}'
# 3) email.get
curl -X GET https://api.infrai.cc/v1/email/get/ID \
-H "Authorization: Bearer $INFRAI_API_KEY"
# 4) email.list
curl -X GET https://api.infrai.cc/v1/email/list \
-H "Authorization: Bearer $INFRAI_API_KEY"
# 5) email.suppress
curl -X POST https://api.infrai.cc/v1/email/suppress \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "..."}'
# 6) email.domain.verify
curl -X POST https://api.infrai.cc/v1/email/domain/verify \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "..."}'
# 7) email.batch.send
curl -X POST https://api.infrai.cc/v1/email/batch/send \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messages": []}'
# 8) email.cancel
curl -X POST https://api.infrai.cc/v1/email/cancel/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
# 9) email.update
curl -X PATCH https://api.infrai.cc/v1/email/update/ID \
-H "Authorization: Bearer $INFRAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'