Skip to content

Email

Transactional email with templates, domain verification and delivery tracking.

Overview

Base path: https://api.infrai.cc/v1/email
Auth header: Authorization: Bearer $INFRAI_API_KEY
bash
# 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"

Methods

email.send

POST /v1/email/send

Send a transactional email; supports templates, attachments and BYOK vendors.

Parameters

NameTypeRequiredDescription
tostring | string[]
Required
Recipient address or list of addresses.
subjectstring
Required
Subject line.
textstringOptionalPlain-text body.
htmlstringOptionalHTML body.
fromstringOptionalSender address (requires a verified domain).
ccstring[]OptionalCarbon-copy addresses.
bccstring[]OptionalBlind carbon-copy addresses.
template_idstringOptionalTemplate id to render instead of a body.
template_varsRecord<string, unknown>OptionalVariables passed to the template.
attachmentsArray<{ filename, content, mime? }>OptionalFiles to attach.
vendorstringOptionalPin a specific vendor instead of auto-routing.
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

EmailRecord { email_id, state, to, subject, vendor, created_at }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

GET /v1/email/get/{id}

Fetch a single email record by id.

Parameters

NameTypeRequiredDescription
idstring
Required
The email record id.

Returns

EmailRecord

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/get/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.list

GET /v1/email/list

List email records with state and pagination filters.

Parameters

NameTypeRequiredDescription
statestringOptionalFilter by record state.
limitnumberOptionalMaximum items to return.
cursorstringOptionalPagination cursor.

Returns

{ items: EmailRecord[], next_cursor? }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.suppress

POST /v1/email/suppress

Add an address to the suppression list.

Returns

SuppressionRecord

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

POST /v1/email/domain/verify

Verify a sending domain and return required DNS records.

Parameters

NameTypeRequiredDescription
domainstring
Required
The domain to verify.

Returns

{ verified, records: Array<{ type, name, value }> }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

POST /v1/email/batch/send

批量个性化发送,最多 100 条不同邮件共用一个 idempotency_key(批量直通,单条不重复计费)。

Parameters

NameTypeRequiredDescription
messagesEmailSendOptions[]
Required
邮件数组,每项是一个完整的 EmailSendRequest,各自带收件人与模板变量,1 到 100 条。
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

BatchSendResult { batch_id, results }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

POST /v1/email/cancel/{id}

取消一封尚未发出(计划中)的邮件。

Parameters

NameTypeRequiredDescription
idstring
Required
The email record id.
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

EmailStatus { message_id, state, ... }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

PATCH /v1/email/update/{id}

修改一封尚未发出(计划中)的邮件的主题、正文或计划发送时间。

Parameters

NameTypeRequiredDescription
idstring
Required
The email record id.
subjectstringOptionalSubject line.
bodystringOptional纯文本正文。
htmlstringOptionalHTML body.
scheduled_atstringOptional新的计划发送时间(ISO 8601),必须晚于当前时间。
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

EmailStatus { message_id, state, ... }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

GET /v1/email/event/list

列出邮件投递事件(送达、退信、打开、点击、投诉等)。

Parameters

NameTypeRequiredDescription
message_idstringOptional按指定邮件的 message_id 过滤事件。
typestringOptional按事件类型过滤(如 delivered、bounced、opened)。
limitnumberOptionalMaximum items to return.
cursorstringOptionalPagination cursor.

Returns

{ items: EmailEvent[], next_cursor? }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/event/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.suppression.check

GET /v1/email/suppression/check/{email}

查询某个收件地址是否在抑制名单中。

Parameters

NameTypeRequiredDescription
emailstring
Required
收件邮箱地址。

Returns

SuppressionCheckResult { is_suppressed, record? }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/suppression/check/EMAIL \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.suppression.list

GET /v1/email/suppression/list

列出抑制名单中的收件地址。

Parameters

NameTypeRequiredDescription
reasonstringOptional按抑制原因过滤(如 bounce、complaint、manual)。
limitnumberOptionalMaximum items to return.
cursorstringOptionalPagination cursor.

Returns

{ items: SuppressionRecord[], next_cursor? }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/suppression/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.suppression.delete

DELETE /v1/email/suppression/delete/{email}

将某地址移出抑制名单,恢复对其投递。

Parameters

NameTypeRequiredDescription
emailstring
Required
收件邮箱地址。
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

{ deleted: boolean }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X DELETE https://api.infrai.cc/v1/email/suppression/delete/EMAIL \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.domain.list

GET /v1/email/domain/list

列出账户下已添加的发信域名。

Parameters

NameTypeRequiredDescription
limitnumberOptionalMaximum items to return.
cursorstringOptionalPagination cursor.

Returns

{ items: DomainVerification[], next_cursor? }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/domain/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.domain.get

GET /v1/email/domain/get/{domain}

获取某个发信域名的验证状态与信誉信息。

Parameters

NameTypeRequiredDescription
domainstring
Required
The domain to verify.

Returns

DomainGetResult { verification, reputation }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/domain/get/DOMAIN \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.domain.delete

DELETE /v1/email/domain/delete/{domain}

删除一个已添加的发信域名。

Parameters

NameTypeRequiredDescription
domainstring
Required
The domain to verify.
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

{ deleted: boolean }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X DELETE https://api.infrai.cc/v1/email/domain/delete/DOMAIN \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.domain.rotate_dkim

POST /v1/email/domain/rotate_dkim/{domain}

为发信域名轮换 DKIM 密钥,返回需配置的新 DNS 记录。

Parameters

NameTypeRequiredDescription
domainstring
Required
The domain to verify.
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

DomainVerification { domain, status, dns_records, ... }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

POST /v1/email/template/create

创建一个邮件模板。

Parameters

NameTypeRequiredDescription
namestring
Required
模板名称,账户内唯一。
subjectstring
Required
主题模板,可包含 {{var}} 占位符。
htmlstring
Required
HTML 正文模板,可包含 {{var}}、{{#section}}、{{^inverted}}。
body_textstringOptional纯文本备用正文。
variablesRecord<string, string>Optional声明的变量及类型,如 { name: 'string' }。
default_varsRecord<string, unknown>Optional发送时变量缺失所用的默认值。
tagsstring[]Optional模板标签列表。
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

Template { template_id, name, subject, html, ... }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

GET /v1/email/template/list

列出账户下的邮件模板。

Parameters

NameTypeRequiredDescription
limitnumberOptionalMaximum items to return.
cursorstringOptionalPagination cursor.

Returns

{ items: Template[], next_cursor? }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/template/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.template.get

GET /v1/email/template/get/{id}

获取单个邮件模板的详情。

Parameters

NameTypeRequiredDescription
idstring
Required
Template id to render instead of a body.

Returns

Template { template_id, name, subject, html, ... }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X GET https://api.infrai.cc/v1/email/template/get/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.template.update

PATCH /v1/email/template/update/{id}

更新一个已有的邮件模板。

Parameters

NameTypeRequiredDescription
idstring
Required
Template id to render instead of a body.
subjectstringOptional主题模板,可包含 {{var}} 占位符。
htmlstringOptionalHTML 正文模板,可包含 {{var}}、{{#section}}、{{^inverted}}。
body_textstringOptional纯文本备用正文。
variablesRecord<string, string>Optional声明的变量及类型,如 { name: 'string' }。
default_varsRecord<string, unknown>Optional发送时变量缺失所用的默认值。
tagsstring[]Optional模板标签列表。
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

Template { template_id, name, subject, html, ... }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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

DELETE /v1/email/template/delete/{id}

删除一个邮件模板。

Parameters

NameTypeRequiredDescription
idstring
Required
Template id to render instead of a body.
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

{ deleted: boolean }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
curl -X DELETE https://api.infrai.cc/v1/email/template/delete/ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

email.template.preview

POST /v1/email/template/preview/{id}

用给定变量渲染模板,预览主题、HTML、文本及缺失变量。

Parameters

NameTypeRequiredDescription
idstring
Required
Template id to render instead of a body.
varsRecord<string, unknown>
Required
用于渲染的变量值,会与模板的 default_vars 合并。

Returns

TemplatePreview { rendered_subject, rendered_html, rendered_text, missing_vars }

Example

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
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": {}}'

All capabilities

Every routed capability in this module — the complete public REST contract. The methods above are the guided walkthrough; this index is the full reference.

CapabilityEndpointDescription
email.batch.sendPOST /v1/email/batch/sendSend up to 100 personalized emails under one idempotency_key (batch passthrough, not billed per message).
email.cancelPOST /v1/email/cancel/{id}Cancel a scheduled email that has not yet been sent.
email.domain.deleteDELETE /v1/email/domain/delete/{domain}Delete a previously added sender domain. Distinct from hosted-URL custom domains (public_url.domain.*).
email.domain.getGET /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.listGET /v1/email/domain/listList the sender domains added to the account. Distinct from hosted-URL custom domains (public_url.domain.*).
email.domain.rotate_dkimPOST /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.verifyPOST /v1/email/domain/verifyVerify a sender domain's DNS records to complete verification. Distinct from hosted-URL custom domains (public_url.domain.*).
email.event.listGET /v1/email/event/listList email delivery events (delivered, bounced, opened, clicked, complained).
email.getGET /v1/email/get/{id}Get the delivery details of one email by message_id.
email.listGET /v1/email/listPage through the account's sent-email records.
email.sendPOST /v1/email/sendSend a transactional email (inline body/HTML or a template) with tracking; idempotent.
email.suppressPOST /v1/email/suppressAdd a recipient address to the suppression list to stop future delivery; idempotent.
email.suppression.checkGET /v1/email/suppression/check/{email}Check whether an address is on the suppression list.
email.suppression.deleteDELETE /v1/email/suppression/delete/{email}Remove an address from the suppression list to resume delivery.
email.suppression.listGET /v1/email/suppression/listList recipient addresses on the suppression list.
email.template.createPOST /v1/email/template/createCreate an email template.
email.template.deleteDELETE /v1/email/template/delete/{id}Delete an email template.
email.template.getGET /v1/email/template/get/{id}Get the details of one email template.
email.template.listGET /v1/email/template/listList the account's email templates.
email.template.previewPOST /v1/email/template/preview/{id}Render and preview a template with the given variables.
email.template.updatePATCH /v1/email/template/update/{id}Update an existing email template.
email.updatePATCH /v1/email/update/{id}Modify a scheduled email's subject, body, or send time.

End-to-end example

A production-style walkthrough of this module: configure once, then run the flow. It exercises most of the module's APIs.

一次性前置(每个范例都假定已完成):

bash
# 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_..."
bash
# 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 '{}'