APIリファレンス

メールとスレッド

メールの送信、取得、検索、返信、配信イベントの確認を行います。

POST/emails
APIキー

メールを1通送信する

ワークスペースの検証済みドメインから、トランザクション用のHTML、テキスト、またはホスト型テンプレートのコンテンツを送信します。検証済みの送信ドメインで有効になっている場合、直接送信ではmessage_classをmarketingに設定できます。マーケティングでは、設定済みのファーストパーティ連携が独自の表示可能なHTTPSワンクリックURLを提供しない限り、管理された配信停止ヘッダーが追加されます。

任意のヘッダーIdempotency-Key
リクエスト
curl https://sendhq.cc/api/v1/emails \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"Acme <hello@example.com>","to":["customer@example.net"],"subject":"Welcome aboard","html":"<h1>Welcome</h1><p>Your workspace is ready.</p>","text":"Welcome. Your workspace is ready."}'
201 レスポンス
{
  "id": "em_…",
  "providerMessageId": "provider-id",
  "threadId": "em_…"
}
POST/emails/batch
APIキー

個別化したメッセージを最大100通送信する

個別化したメッセージを最大100通送信する

任意のヘッダーIdempotency-Key
リクエスト
curl https://sendhq.cc/api/v1/emails/batch \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"emails":[{"from":"Acme <hello@example.com>","to":["customer@example.net"],"subject":"Welcome aboard","html":"<h1>Welcome</h1><p>Your workspace is ready.</p>","text":"Welcome. Your workspace is ready."}]}'
201 レスポンス
{
  "data": [
    {
      "index": 0,
      "ok": true,
      "id": "em_…"
    }
  ],
  "count": 1,
  "successful": 1,
  "failed": 0
}
GET/emails
APIキー

送信済みメールと受信メールを一覧表示する

Newest-first list with filters. `query` searches subjects, bodies, participants, and attachment filenames. `label`, `domain`, and `category` accept one value or a comma-separated list (matches any); labels may be IDs or names. `outcome` filters sent mail to `bounced`, `complained`, `failed`, or `rejected` (comma-separated, matches any). `archived=false` returns the Inbox view for received mail. Received mail is classified as `primary`, `updates` (newsletters, bulk, and automated mail), or `spam`, and flagged `important`; spam is excluded unless `category=spam` or `include_spam=true`.

Query parametersdirectionstatusoutcomedomaininbox_idlabelarchivedcategoryimportantinclude_spamfromtounreadafterbeforequerylimitoffset
リクエスト
curl https://sendhq.cc/api/v1/emails \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "data": [],
  "count": 0
}
GET/emails/:id
APIキー

メールとその添付ファイルを取得する

メールとその添付ファイルを取得する

リクエスト
curl https://sendhq.cc/api/v1/emails/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "id": "em_…",
  "direction": "out",
  "status": "sent",
  "attachments": []
}
PATCH/emails/:id
APIキー

既読、アーカイブ、迷惑メール、カテゴリ、重要度を更新する

`read`、`archived`、`category`(`primary`、`updates`、`spam` — 受信メールのみ)、`important`を設定します。`category`または`important`を変更すると、SendHQはその送信者について学習します。迷惑メールとして報告すると、その送信者からの今後のメールは迷惑メールに振り分けられます。`Not spam`を指定すると、その送信者に対する自動の迷惑メール判定が上書きされます。重要度はその送信者に対して維持されます。このメッセージだけを変更するには`learn: false`を渡してください。

リクエスト
curl https://sendhq.cc/api/v1/emails/id_value \
  -X PATCH \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"spam"}'
200 レスポンス
{
  "id": "em_…",
  "readAt": "2026-08-23T12:00:00.000Z",
  "archivedAt": null,
  "category": "spam",
  "important": false,
  "classification": "you moved it here"
}
DELETE/emails/:id
APIキー

保持されているメールを削除する

保持されているメールを削除する

リクエスト
curl https://sendhq.cc/api/v1/emails/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "ok": true
}
GET/emails/:id/events
APIキー

メールの配信イベントを一覧表示する

メールの配信イベントを一覧表示する

リクエスト
curl https://sendhq.cc/api/v1/emails/id_value/events \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "data": [],
  "count": 0
}
GET/threads/:id
APIキー

会話を時系列順に取得する

会話を時系列順に取得する

リクエスト
curl https://sendhq.cc/api/v1/threads/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "id": "em_…",
  "data": [],
  "count": 0
}
GET/emails/:id/delivery
APIキー

Delivery timeline for one email, with bounce and complaint reasons

Delivery timeline for one email, with bounce and complaint reasons

リクエスト
curl https://sendhq.cc/api/v1/emails/id_value/delivery \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "emailId": "em_123",
  "status": "bounced",
  "timeline": [],
  "count": 0,
  "limit": 50,
  "offset": 0
}
GET/threads/:id/delivery
APIキー

Per-thread delivery counts and per-message failure reasons

Per-thread delivery counts and per-message failure reasons

リクエスト
curl https://sendhq.cc/api/v1/threads/id_value/delivery \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
200 レスポンス
{
  "threadId": "thr_123",
  "delivered": 0,
  "bounced": 0,
  "complained": 0,
  "failed": 0,
  "messages": []
}