APIリファレンス

アカウントと請求

APIキーでアカウントの使用量、分析データ、キーのメタデータを読み取れます。請求の変更やキーの作成・無効化にはダッシュボードのセッションが必要です。

GET/account
APIキー

APIキーでアカウント、使用量、請求状態、ワークスペース数を取得する

ダッシュボードのプロフィールに相当する情報をAPIキーで取得します。アカウント所有者、プランの上限に対する当期の受信者数と添付ファイルの使用量、アクセス階層、送信者レピュテーションの概要、サブスクリプションの状態、公開中のプラン、ワークスペース数が含まれます。読み取り専用で、請求の変更は引き続きセッション経由でのみ行えます。

リクエスト
curl https://sendhq.cc/api/v1/account \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "user": {},
  "usage": {},
  "access": {},
  "reputation": {},
  "infrastructure": {},
  "billing": {},
  "plans": [],
  "workspace": {
    "mailer": "ses",
    "stats": {}
  }
}
GET/account/diagnostics
APIキー

Diagnose sending and receiving problems in the workspace

Read-only troubleshooting snapshot from stored state: an `issues` list in plain language, plan and usage against limits, each domain's DKIM and inbound state, sending identities, 30-day deliverability and sender reputation, suppressions and unsubscribes, the last 30 days of messages that were not sent with their reasons, bounce, complaint and reject events, and webhook delivery health. Never returns message bodies, API keys or webhook secrets.

リクエスト
curl https://sendhq.cc/api/v1/account/diagnostics \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "generatedAt": "2026-10-30T12:00:00.000Z",
  "windowDays": 30,
  "issues": [
    {
      "severity": "action",
      "code": "domain_unverified",
      "message": "example.com is not verified (pending); 2 of 3 DKIM records are not visible in DNS yet."
    }
  ],
  "plan": {},
  "domains": [],
  "sendingIdentities": {
    "domains": [],
    "addresses": []
  },
  "inbound": {},
  "deliverability": {},
  "suppressions": {},
  "failures": {
    "notSent": [],
    "recentNotSent": [],
    "recentProviderEvents": []
  },
  "webhooks": []
}
GET/analytics
APIキー

7日間、30日間、90日間のダッシュボードの送信分析を取得する

期間内の送信、受信、配信、バウンス、ブロック、開封、クリック、苦情の合計数、1日ごとの送信/受信の推移、送信数の多いドメイン、成果の高い件名を返します。

クエリパラメータdays
リクエスト
curl https://sendhq.cc/api/v1/analytics \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "window": "30d",
  "days": 30,
  "metrics": {
    "sent": 0,
    "received": 0,
    "bounced": 0,
    "blocked": 0,
    "delivered": 0,
    "opened": 0,
    "clicks": 0,
    "complaints": 0
  },
  "timeline": [],
  "domains": [],
  "topContent": []
}
GET/profile
ブラウザセッション

アカウント、使用量、積み重ねられたサブスクリプションの状態を取得する

アカウント、使用量、積み重ねられたサブスクリプションの状態を取得する

リクエスト
curl https://sendhq.cc/api/v1/profile \
  -X GET \
  -H "Cookie: sendhq_session_v2=…"
200 レスポンス
{
  "user": {},
  "usage": {},
  "access": {},
  "reputation": {},
  "billing": {},
  "plans": []
}
POST/billing/checkout
ブラウザセッション

まだ契約していないプラン(階層、メッセージ区分、請求間隔)のホスト型チェックアウトを開始する

まだ契約していないプラン(階層、メッセージ区分、請求間隔)のホスト型チェックアウトを開始する

リクエスト
curl https://sendhq.cc/api/v1/billing/checkout \
  -X POST \
  -H "Cookie: sendhq_session_v2=…" \
  -H "Content-Type: application/json" \
  -d '{"plan_key":"scaleup_marketing_annual"}'
200 レスポンス
{
  "url": "https://checkout.example/…",
  "session_id": "…"
}
POST/billing/cancel
ブラウザセッション

プロバイダー側に触れずに、現在のサブスクリプションをアプリ内で解約する

プロバイダー側に触れずに、現在のサブスクリプションをアプリ内で解約する

リクエスト
curl https://sendhq.cc/api/v1/billing/cancel \
  -X POST \
  -H "Cookie: sendhq_session_v2=…"
200 レスポンス
{
  "ok": true
}
POST/keys
ブラウザセッション

APIキーを作成する

APIキーを作成する

リクエスト
curl https://sendhq.cc/api/v1/keys \
  -X POST \
  -H "Cookie: sendhq_session_v2=…" \
  -H "Content-Type: application/json" \
  -d '{"name":"Production"}'
201 レスポンス
{
  "id": "key_…",
  "name": "Production",
  "key": "re_…",
  "prefix": "re_…"
}
GET/keys
APIキー

APIキーのメタデータを一覧表示する

キー名、秘密情報を含まないプレフィックス、最終使用日時を一覧表示します。キーの完全な値が返されることはありません。キーの作成と無効化にはダッシュボードのセッションが必要です。

リクエスト
curl https://sendhq.cc/api/v1/keys \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "data": [],
  "count": 0
}
DELETE/keys/:id
ブラウザセッション

APIキーを無効化する

APIキーを無効化する

リクエスト
curl https://sendhq.cc/api/v1/keys/id_value \
  -X DELETE \
  -H "Cookie: sendhq_session_v2=…"
200 レスポンス
{
  "ok": true
}