下列数量反映应用当前向集成方暴露的能力。任何能发送 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 自动化。
X-API-Key: … 或 Authorization: Bearer …。可选查询参数 ?api_key= 支持工具使用,但推荐请求头。X-API-Key(工作区范围;用于 Intel / 送达率监控)。Idempotency-Key 用于安全重试。密钥在客户控制台(API 管理)创建与轮换。限定密钥的作用域模式见应用内部作用域策略。
POST https://app.sendarix.com/v1/email/send
JSON 体字段(除非注明否则必填):
from — 已验证发件地址to — 字符串或地址数组subjecthtml 和/或 text — 至少一个非空正文(可从 HTML 派生纯文本)to 中每个地址,但当前传输路径仅向第一个收件人投递。若需多次独立投递,请每位收件人单独请求(或对 multi-RCPT 工作流使用 SMTP)。成功响应包含 message_id、sx_trace_id 等标识符,用于与日志和 Webhooks 关联。
POST https://app.sendarix.com/v1/alerts/ingest
典型 JSON 字段:event_type、severity(info、warning、critical)、source、message,可选 entity_type、entity_id、context(对象)。投递取决于控制台中配置的告警规则。
基础路径:/api/deliverability/v1/。端点含工作区、客户端、域名、黑名单状态与报告生成。均需要送达率工作区 API 密钥。
GET | /workspaces |
GET | /clients |
POST | /clients |
GET | /domains |
POST | /domains |
GET | /blacklists/status |
POST | /reports/generate |
SMTP 使用控制台凭据的标准邮件提交——适合遗留应用与 MTA。互动 Webhooks 由 Sendarix 向您的 URL 出站,用于投递与互动事件(负载与安全见产品页)。
面向服务商的入站 Webhooks(如 Postal)为基础设施端点,非客户集成目标。
替换 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.bodyIdempotency-Key + 相同正文。X-API-Key 换为 Authorization: Bearer YOUR_API_KEY。/v1/alerts/ingest;路由由 UI 中策略驱动。/api/deliverability/v1/* 下轮询或变更 Intel 资源。