本文へスキップ
Won.dev
ドキュメントAPIリファレンス
コールドメールAPI

単発メールを送る

シーケンスとは別にメールを1通送ります。添付ファイルもつけられます。無料で、その日の送信数に数えられます。

シーケンスとは別にメールを1通送ります。キャンペーンですでに連絡した人にもう一度送る(recipient_id)か、返信で紹介された同僚に送る(reply_id と to)かのどちらかです。たとえば、1週間後に頼まれていた見積もりを送るときに使います。同僚は、返信した人と同じ会社の人か、返信の中で挙げられたアドレスに限ります。メールはそのやりとりで使っているメールボックスから、同じ名前で送られます。subject を指定しなければ直前のメールのスレッドに続き、指定すれば新しいスレッドになります。ファイルは attachments に入れます。無料で、キャンペーンと合わせて、送信者のドメインが今日送れる数に数えられます。それを超えると daily_limit_reached で失敗します。配信停止した人、バウンスした人、送信停止リストにある人には送れません。返信で紹介されたわけではない新しい相手は、キャンペーンに入れてください:POST /email/campaigns/{id}/recipients。24時間以内の同じリクエストは繰り返しとみなされ、最初の結果が返り、二重に送られることはありません。

  • 課金: 呼び出しは無料で、メールも無料です。メールは送信者の送信ドメインから送られ、ドメインは月ごとに支払います。送信ドメインを参照してください。

テストキー(won_test_...)では、これはサンドボックスで動きます。何も送信されず、課金もされません。

POST
/email/messages

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

ヘッダーパラメータ

Idempotency-Key?string

Any unique string. A retry with the same key and the same body returns the first response and is not charged again.

長さlength <= 255

リクエストボディ

application/json
  1. body
recipient_id?string

Write again to this recipient, such as rcp_9x7p1q8w3e5r4k2m. They must have had an email of the campaign.

長さlength <= 40
reply_id?string

Instead of recipient_id: write to someone this reply pointed to, such as rpl_1q8w3e5r4k2m9x7p. Needs to.

長さlength <= 40
to?string

With reply_id: the colleague's email address.

長さlength <= 254
first_name?string

With reply_id: the colleague's first name, for {{first_name}}.

長さlength <= 80
last_name?string

With reply_id: the colleague's last name.

長さlength <= 80
subject?string

The subject line of a new thread. Leave it out to write in the thread of the last email.

長さ1 <= length <= 300
text*string

The email, as plain text. Placeholders such as {{first_name|there}} work as in a campaign. No signature block or unsubscribe line: every email ends with them.

長さ1 <= length <= 4000
attachments?array<>

Up to 3 files, 10 MB together: PDFs, pictures, office documents, CSV and text. Each needs content or url.

要素items <= 3
デフォルト[]

レスポンスボディ

The result.

application/json
  1. response
data*

The email, with who it went to.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X POST 'https://api.won.dev/v1/email/messages' \  -H 'Content-Type: application/json' \  -d '{  "recipient_id": "rcp_9x7p1q8w3e5r4k2m",  "text": "Hi Dana,\n\nAs promised, here is the quote for 40 chairs. It holds until the end of the month.\n\nAlex",  "attachments": [    {      "filename": "quote-harborline.pdf",      "url": "https://northwind-seating.example/q/2611.pdf"    }  ]}'
レスポンスの例
{  "data": {    "id": "msg_2k9x7p1q8w3e5r4m",    "campaign_id": "cmp_7p1q8w3e5r4k2m9x",    "recipient_id": "rcp_9x7p1q8w3e5r4k2m",    "from": "alex@northwindseating.example",    "to": "dana.whitfield@harborline-imports.example",    "kind": "single",    "step": null,    "version": 1,    "status": "sent",    "subject": "Re: Office chairs for Harborline Imports",    "opens": 0,    "clicks": 0,    "bounce_type": null,    "attachments": [      {        "filename": "quote-harborline.pdf",        "content_type": "application/pdf",        "size": 96540      }    ],    "sent_at": "2026-11-27T15:12:40.000Z",    "recipient": {      "id": "rcp_9x7p1q8w3e5r4k2m",      "campaign_id": "cmp_7p1q8w3e5r4k2m9x",      "email": "dana.whitfield@harborline-imports.example",      "first_name": "Dana",      "last_name": "Whitfield",      "company": "Harborline Imports",      "country": "US",      "contact_id": null,      "status": "active",      "reason": null,      "risky": false,      "emails_sent": 1,      "next_send_at": "2026-11-24T15:20:00.000Z",      "last_sent_at": "2026-11-27T15:12:40.000Z",      "metadata": {        "crm_id": "lead_4471"      },      "created_at": "2026-11-18T14:03:10.000Z"    }  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}

最終更新日