本文へスキップ

開発者 · API Reference

API ドキュメント

Sendarix HTTP API、認証、一般的な統合パターンの技術リファレンス。製品概要:メール API。

cURL Node SMTP
# Send a transactional email: from, to, subject, body
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: otp_8842' \
  -d '{"from":"no-reply@yourdomain.com","to":"user@example.com","subject":"Your sign-in code","text":"Your code is 482913"}'
// Node 18+ (built-in fetch)
const res = await fetch("https://app.sendarix.com/v1/email/send", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": process.env.SENDARIX_API_KEY,
    "Idempotency-Key": "otp_8842"
  },
  body: JSON.stringify({
    from: "no-reply@yourdomain.com",
    to: "user@example.com",
    subject: "Your sign-in code",
    text: "Your code is 482913"
  })
});
console.log(await res.json()); // message_id, status, request_id, sx_trace_id
# Drop-in SMTP — 既存統合を維持し control plane を追加
host:     smtp.sendarix.net
port:     587  (STARTTLS)
username: "YOUR_SMTP_USERNAME"  # dashboard › SMTP
password: "YOUR_SMTP_PASSWORD"

機能監査(本プラットフォーム)

以下の数値は、アプリケーションが現在インテグレーターに公開している内容を反映します。HTTPS + JSON を送れる言語ならこれらのエンドポイントを呼び出せます。ページには6つのコピペ可能な例スタックがあります。

4

統合サーフェス

6

例の言語

6

利用パターン

Surfaces: (1) Transactional send REST, (2) Deliverability Intel REST, (3) SMTP relay (protocol, not JSON), (4) Outbound engagement webhooks (you receive signed HTTPS POSTs from Sendarix). Older /v1 endpoints for alerts, message lookup, domains, events, suppressions and usage are retired and return 410.

統合サーフェス

サーフェスメカニズムベース / エントリ
トランザクション送信POST JSON、アカウント API キーPOST /v1/email/send
Retired v1 endpointsReturn 410 with code API_KEYS_RETIRED/v1/send, /v1/alerts/ingest, /v1/email/{id}, /v1/domains, /v1/events, /v1/suppressions, /v1/reports/usage
配信 IntelGET/POST JSON、ワークスペース配信 API キー/api/deliverability/v1/*(7 ルート)
SMTP リレーSMTP AUTH(ホスト、ポート、ユーザー名、パスワードはダッシュボードから)SMTP リレー を参照
エンゲージメント WebhookHTTPS エンドポイントが署名付き POST を受信アプリで設定 → Webhooks

認証

  • Send API key: header X-API-Key: … or Authorization: Bearer …. Keys in the query string are not accepted. Each key belongs to one sending domain and service, and from must use that domain.
  • 配信 API キー: ヘッダー X-API-Key(ワークスペーススコープ。Intel / 配信モニター用)。
  • べき等性(送信): オプションのヘッダー Idempotency-Key で安全なリトライ。

Create and revoke keys in the dashboard under Developers › API keys. How many keys you can create depends on your plan (see Pricing).

送信 API

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

JSON ボディフィールド(注記がない限り必須):

  • from — required; an address on the domain the API key belongs to
  • to — 文字列またはアドレスの配列
  • subject
  • text and/or html — optional strings; send at least one so the message has a body
  • Optional: reply_to (one address), headers (up to 20; only List-Unsubscribe, List-Unsubscribe-Post, List-Id, In-Reply-To, References, Auto-Submitted, Precedence), metadata (up to 20 keys)
  • Not supported: cc, bcc and attachments are rejected with 422 UNSUPPORTED_FIELD. There are no template or routing-policy fields; build the subject and body in your application.
Multiple recipients: to takes one address or a list of up to 50. Duplicates are removed, and each address is checked against suppressions, routed and sent as its own message. The response then adds results, recipient_count and accepted_count.

A single-recipient send returns 200 with message_id, status, request_id and sx_trace_id. A suppressed address returns status: "suppressed" and is not sent. If the outcome cannot be confirmed, the API returns 202 with status: "unknown". With Idempotency-Key (up to 64 characters) a retry returns the stored result; the same key with a different body returns 409.

Retired endpoints

POST /v1/send, POST /v1/alerts/ingest and the older /v1 lookup endpoints return 410 API_KEYS_RETIRED.

Send with POST /v1/email/send or SMTP. Use the dashboard for logs and suppressions, and signed webhooks for delivery events. Remove calls to retired endpoints from existing integrations.

配信 Intel API

ベース:/api/deliverability/v1/。エンドポイントにはワークスペース、クライアント、ドメイン、ブラックリスト状態、レポート生成が含まれます。すべて配信ワークスペース API キーが必要です。

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

SMTP リレーとインバウンド型 Webhook

SMTP はダッシュボードの認証情報による標準メール送信。レガシーアプリと MTA に適しています。エンゲージメント Webhook は Sendarix から URL へのアウトバウンドで、配信とエンゲージメントイベント用(ペイロードとセキュリティは製品ページ参照)。

プロバイダー向けインバウンド Webhook(例: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": "\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30bb\u30c3\u30c8",
    "text": "\u3053\u306e\u30ea\u30f3\u30af\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002",
    "html": "<p>\u3053\u306e\u30ea\u30f3\u30af\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\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. ワンショット送信 — メッセージごとに 1 回の POST、べき等ヘッダーなし。
  2. べき等リトライ — ネットワーク障害時に同じ Idempotency-Key + 本文。
  3. Bearer 認証 — X-API-Key を Authorization: Bearer YOUR_API_KEY に差し替え。
  4. HTML + テキスト — サポートされる場合は multipart-alternative 風のレンダリングのために両方を提供。
  5. Several recipients — put up to 50 addresses in to and compare accepted_count with recipient_count.
  6. 配信の自動化 — ワークスペースキーで /api/deliverability/v1/* の Intel リソースをポーリングまたは変更。

メールの新しい居場所に。

プランを選び、ドメインを追加。メールをひとつの場所にまとめましょう。