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

キャンペーンを変更する

終了していないキャンペーンの本文、スケジュール、上限を、次のメールから変更します。無料。

終了していないキャンペーン(draft、active、paused)を変更します。変わるのは指定したフィールドだけで、ほかはそのままです。送信のたびにキャンペーンを読み直すため、変更は次のメールから反映されます。steps はシーケンス全体を置き換えます。誰かに送ったステップは、送ったバージョンとともにシーケンスに残りますが、これから送るメールのために本文を変えることはできます。まだ誰にも送っていないステップは、変更、削除、追加ができます。すべてのステップを受け取った人は完了扱いで、あとから追加したステップは届きません。すでに始まった待ち時間は、その長さのまま続きます。新しい本文は作成時と同じようにチェックされ、フォールバックのないプレースホルダーは、まだ待っている人の誰かにその値がなければ拒否されます。ドライランはありません。チェックを通らなかった変更は何も変えません。無料です。

  • 課金: 無料。

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

PATCH
/email/campaigns/{id}

認証

apiKey
headerAuthorizationBearer <APIキー>

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

パスパラメータ

id*string

Campaign ID, such as cmp_7p1q8w3e5r4k2m9x.

長さlength <= 40

ヘッダーパラメータ

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
name?string

A name for your own reference. Recipients never see it.

長さ1 <= length <= 120
steps?array<>

The whole sequence as it is to be, in order. It replaces the one there is.

要素1 <= items <= 6
schedule?

The days and hours to send in. It replaces the whole schedule.

daily_limit?integer

The most emails the campaign sends on one day. It never sends more than the sender's domains may send, 45 a day each at full speed, which the sender's campaigns share.

範囲1 <= value <= 1000
stop_on_company_reply?boolean

When one person at a company answers, stop writing to the others at that company.

track_opens?boolean

Count opens with an invisible image. Off by default: it lowers inbox placement, and mail programs that fetch images themselves make the numbers unreliable.

track_clicks?boolean

Count clicks by sending links through our redirect. Off by default, for the same reason.

metadata?

Your own keys and values, such as {"customer_id": "c_812"}: up to 20 keys of at most 40 characters, each value a string of at most 500. It replaces the metadata there is; {} removes it. Events that already happened keep what they carried.

レスポンスボディ

The result.

application/json
  1. response
data*

The campaign as it is now, and what the checks found in its texts.

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 PATCH 'https://api.won.dev/v1/email/campaigns/cmp_7p1q8w3e5r4k2m9x' \  -H 'Content-Type: application/json' \  -d '{  "id": "cmp_7p1q8w3e5r4k2m9x",  "daily_limit": 80,  "steps": [    {      "subject": "Office chairs for {{company}}",      "body": "Hi {{first_name|there}},\n\nI saw that {{company}} imports office seating. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\n{{sender_first_name}}"    },    {      "delay_days": 4,      "body": "Hi {{first_name|there}},\n\nWe can ship samples within a week now. Shall I send one?\n\n{{sender_first_name}}"    }  ]}'
レスポンスの例
{  "data": {    "campaign": {      "id": "cmp_7p1q8w3e5r4k2m9x",      "name": "US chair importers, November",      "sender_id": "snd_4k2m9x7p1q8w3e5r",      "status": "active",      "pause_reason": null,      "waiting": null,      "steps": [        {          "delay_days": 0,          "versions": [            {              "subject": "Office chairs for {{company}}",              "body": "Hi {{first_name|there}},\n\nI saw that {{company}} imports office seating. We make mesh task chairs in Leeds and ship to the US in four weeks.\n\nWould a price list be useful?\n\n{{sender_first_name}}",              "weight": 1,              "stats": {                "sent": 42,                "opened": 0,                "clicked": 0,                "replied": 3              }            }          ]        },        {          "delay_days": 3,          "versions": [            {              "subject": null,              "body": "Hi {{first_name|there}},\n\nJust checking that my note reached the right person. Who looks after seating suppliers at {{company}}?\n\n{{sender_first_name}}",              "weight": 1,              "stats": {                "sent": 17,                "opened": 0,                "clicked": 0,                "replied": 1              }            }          ]        }      ],      "schedule": {        "timezone": "America/New_York",        "days": [          "mon",          "tue",          "wed",          "thu",          "fri"        ],        "start_hour": 9,        "end_hour": 17      },      "daily_limit": 80,      "stop_on_company_reply": true,      "track_opens": false,      "track_clicks": false,      "metadata": {        "customer_id": "c_812"      },      "stats": {        "recipients": 120,        "waiting": 74,        "in_sequence": 38,        "finished": 0,        "replied": 4,        "bounced": 1,        "unsubscribed": 1,        "excluded": 2,        "emails_sent": 59,        "emails_opened": 0,        "emails_clicked": 0      },      "test": false,      "created_at": "2026-11-18T14:03:10.000Z",      "started_at": "2026-11-18T14:03:11.000Z",      "completed_at": null,      "next_check_after": 1740    },    "content": {      "advice": [],      "variables": [        {          "name": "company",          "required": true        },        {          "name": "first_name",          "required": false        }      ]    }  },  "notice": null,  "usage": {    "cost": 0,    "balance": 48.08,    "replayed": false  }}

最終更新日