能力审计(本平台)

下列数量反映应用当前向集成方暴露的能力。任何能发送 HTTPS + JSON 的语言均可调用这些端点;页面包含 套可复制示例栈。

5

集成面

6

示例语言

6

使用模式

集成面:(1)事务发送 REST,(2)客户端告警摄入 REST,(3)送达率 Intel REST,(4)SMTP 中继(协议,非 JSON),(5)出站互动 Webhooks(您接收来自 Sendarix 的 HTTPS POST)。仪表板会话端点如 GET /api/keys 为浏览器/会话流,非 X-API-Key 自动化。

集成面

集成面机制基础 / 入口
事务发送 POST JSON,账户 API 密钥 POST /v1/email/send(别名 /v1/send
客户端告警 POST JSON,与发送相同密钥中间件 POST /v1/alerts/ingest
送达率 Intel GET/POST JSON,工作区送达率 API 密钥 /api/deliverability/v1/*(7 条路由)
SMTP 中继 SMTP AUTH(主机、端口、用户名、密码来自控制台) SMTP 中继
互动 Webhooks 您的 HTTPS 端点接收签名 POST 在应用中配置 → Webhooks

认证

  • 账户 API 密钥(发送 + 告警): 请求头 X-API-Key: …Authorization: Bearer …。可选查询参数 ?api_key= 支持工具使用,但推荐请求头。
  • 送达率 API 密钥: 请求头 X-API-Key(工作区范围;用于 Intel / 送达率监控)。
  • 幂等(发送): 可选请求头 Idempotency-Key 用于安全重试。

密钥在客户控制台(API 管理)创建与轮换。限定密钥的作用域模式见应用内部作用域策略。

发送 API

POST https://app.sendarix.com/v1/email/send

JSON 体字段(除非注明否则必填):

  • from — 已验证发件地址
  • to — 字符串或地址数组
  • subject
  • html 和/或 text — 至少一个非空正文(可从 HTML 派生纯文本)
多收件人说明: API 会校验 to 中每个地址,但当前传输路径仅向第一个收件人投递。若需多次独立投递,请每位收件人单独请求(或对 multi-RCPT 工作流使用 SMTP)。

成功响应包含 message_idsx_trace_id 等标识符,用于与日志和 Webhooks 关联。

客户端告警摄入

POST https://app.sendarix.com/v1/alerts/ingest

典型 JSON 字段:event_typeseverityinfowarningcritical)、sourcemessage,可选 entity_typeentity_idcontext(对象)。投递取决于控制台中配置的告警规则。

送达率 Intel API

基础路径:/api/deliverability/v1/。端点含工作区、客户端、域名、黑名单状态与报告生成。均需要送达率工作区 API 密钥。

GET/workspaces
GET/clients
POST/clients
GET/domains
POST/domains
GET/blacklists/status
POST/reports/generate

SMTP 中继与入站式 Webhooks

SMTP 使用控制台凭据的标准邮件提交——适合遗留应用与 MTA。互动 Webhooks 由 Sendarix 向您的 URL 出站,用于投递与互动事件(负载与安全见产品页)。

面向服务商的入站 Webhooks(如 Postal)为基础设施端点,非客户集成目标。

发送 API — 示例(6 种语言)

替换 YOUR_API_KEY 与地址。各栈使用相同 JSON。

# Bash — 事务发送
curl -sS -X POST 'https://app.sendarix.com/v1/email/send' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: order-10042-reset' \
  -d '{
    "from": "noreply@example.com",
    "to": "user@example.com",
    "subject": "\u5bc6\u7801\u91cd\u7f6e",
    "text": "\u4f7f\u7528\u6b64\u94fe\u63a5\u91cd\u7f6e\u5bc6\u7801\u3002",
    "html": "<p>\u4f7f\u7528\u6b64\u94fe\u63a5\u91cd\u7f6e\u5bc6\u7801\u3002</p>"
}'
// Node 18+(全局 fetch)
const res = await fetch('https://app.sendarix.com/v1/email/send', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY',
    'Idempotency-Key': 'order-10042-reset',
  },
  body: JSON.stringify({
    from: 'noreply@example.com',
    to: 'user@example.com',
    subject: "密码重置",
    text: "使用此链接重置密码。",
    html: "<p>使用此链接重置密码。<\/p>",
  }),
});
console.log(await res.json());
# Python 3
import json, urllib.request

req = urllib.request.Request(
    'https://app.sendarix.com/v1/email/send',
    data=json.dumps({
        'from': 'noreply@example.com',
        'to': 'user@example.com',
        'subject': "密码重置",
        'text': "使用此链接重置密码。",
        'html': "<p>使用此链接重置密码。<\/p>",
    }).encode(),
    headers={
        'Content-Type': 'application/json',
        'X-API-Key': 'YOUR_API_KEY',
        'Idempotency-Key': 'order-10042-reset',
    },
    method='POST',
)
with urllib.request.urlopen(req) as r:
    print(r.read().decode())
<?php
$ch = curl_init('https://app.sendarix.com/v1/email/send');
$payload = json_encode([
    'from' => 'noreply@example.com',
    'to' => 'user@example.com',
    'subject' => '密码重置',
    'text' => '使用此链接重置密码。',
    'html' => '<p>使用此链接重置密码。</p>',
]);\ncurl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-API-Key: YOUR_API_KEY',
        'Idempotency-Key: order-10042-reset',
    ],
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
// Go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    body, _ := json.Marshal(map[string]any{
        "from":    "noreply@example.com",
        "to":      "user@example.com",
        "subject": "密码重置",
        "text":    "使用此链接重置密码。",
        "html":    "<p>使用此链接重置密码。<\/p>",
    })
    req, _ := http.NewRequest("POST", "https://app.sendarix.com/v1/email/send", bytes.NewReader(body))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("X-API-Key", "YOUR_API_KEY")
    req.Header.Set("Idempotency-Key", "order-10042-reset")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
}
# Ruby — net/http
require 'json'
require 'net/http'
uri = URI('https://app.sendarix.com/v1/email/send')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req['X-API-Key'] = 'YOUR_API_KEY'
req['Idempotency-Key'] = 'order-10042-reset'
req.body = {
  from: 'noreply@example.com',
  to: 'user@example.com',
  subject: "密码重置",
  text: "使用此链接重置密码。",
  html: "<p>使用此链接重置密码。<\/p>",
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts res.body

使用模式(6 种)

  1. 单次发送 — 每条消息一次 POST,无幂等头。
  2. 幂等重试 — 网络失败时相同 Idempotency-Key + 相同正文。
  3. Bearer 认证 — 将 X-API-Key 换为 Authorization: Bearer YOUR_API_KEY
  4. HTML + 文本 — 在支持处同时提供两者以实现 multipart/alternative 风格渲染。
  5. 告警扇出 — 从监控 POST 到 /v1/alerts/ingest;路由由 UI 中策略驱动。
  6. 送达率自动化 — 使用工作区密钥在 /api/deliverability/v1/* 下轮询或变更 Intel 资源。

准备好迁移到可靠的邮件基础设施了吗?

免费开始,无需绑卡;高流量与企业需求可联系销售。

开始发送联系销售