Criar uma campanha
Cria uma cadência de até seis e-mails para uma lista de pessoas e a inicia. Grátis: os e-mails saem dos domínios de envio do remetente.
Cria uma cadência de até seis e-mails para uma lista de pessoas e, com start: true, começa a enviá-la. Envia das caixas dos domínios de envio do próprio remetente (POST /email/domains), poucos e-mails por caixa por dia, no horário comercial de cada destinatário; cada destinatário recebe a cadência inteira da mesma caixa, e a cadência para para uma pessoa assim que ela responde, dá bounce ou se descadastra. Campanhas e e-mails são grátis: o que os domínios do remetente enviam é pago com os domínios. Uma campanha envia por dia o que o daily_limit dela permite, dentro do que os domínios enviam juntos, que todas as campanhas do remetente dividem. Use dry_run: true primeiro: ele confere os textos e a lista, mostra o primeiro e-mail como os primeiros destinatários o receberiam e quanto tempo a campanha leva com os domínios que o remetente tem, sem criar nada. Iniciar falha com no_domains enquanto o remetente não tiver nenhum. Com um cabeçalho Idempotency-Key, uma nova tentativa nunca cria uma segunda campanha. Também dá para adicionar destinatários depois com POST /email/campaigns/{id}/recipients.
- Cobrança: A chamada é grátis, e os e-mails também: eles saem dos domínios de envio do remetente, pagos por mês; veja Domínios de envio.
Uma chave de teste (won_test_...) roda isto no sandbox: nada é enviado e nada é cobrado.
apiKeyAuthorizationBearer <chave de API>Authorization: Bearer won_live_..., a key from the console.
Idempotency-Key?stringAny unique string. A retry with the same key and the same body returns the first response and is not charged again.
length <= 255application/json- body
sender_id*stringThe sender the emails are for, from POST /email/senders.
length <= 40name*stringA name for your own reference. Recipients never see it.
1 <= length <= 120steps*array<>The emails of the sequence, in order. Two to four work best.
1 <= items <= 6recipients?array<>Up to 1000 people to write to. Each is checked: bad addresses, people on a suppression list and people in regions the sender has not declared are left out and listed in the answer.
items <= 1000schedule?When emails go out. The hours are read in each recipient's own time zone when their country or time zone is known.
daily_limit?integerThe 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 <= 100050stop_on_company_reply?booleanWhen one person at a company answers, stop writing to the others at that company.
truetrack_opens?booleanCount opens with an invisible image. Off by default: it lowers inbox placement, and mail programs that fetch images themselves make the numbers unreliable.
falsetrack_clicks?booleanCount clicks by sending links through our redirect. Off by default, for the same reason.
falsemetadata?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. Returned as given, and in the events about it.
start?booleanStart sending right away. Otherwise the campaign is a draft until POST /email/campaigns/{id}/start.
falsedry_run?booleanCheck everything and show a preview, without creating anything. Problems in the texts are listed instead of failing the call.
falseThe result.
application/json- response
data*The campaign, and what the checks found in its list and 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 POST 'https://api.won.dev/v1/email/campaigns' \ -H 'Content-Type: application/json' \ -d '{ "sender_id": "snd_4k2m9x7p1q8w3e5r", "name": "US chair importers, November", "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": 3, "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}}" } ], "recipients": [ { "email": "dana.whitfield@harborline-imports.example", "first_name": "Dana", "company": "Harborline Imports", "country": "US" }, { "email": "info@coastal-office.example", "company": "Coastal Office Supply" } ], "daily_limit": 30, "start": false}'{ "data": { "dry_run": false, "campaign": { "id": "cmp_7p1q8w3e5r4k2m9x", "name": "US chair importers, November", "sender_id": "snd_4k2m9x7p1q8w3e5r", "status": "draft", "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": 0, "opened": 0, "clicked": 0, "replied": 0 } } ] }, { "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": 0, "opened": 0, "clicked": 0, "replied": 0 } } ] } ], "schedule": { "timezone": "America/New_York", "days": [ "mon", "tue", "wed", "thu", "fri" ], "start_hour": 9, "end_hour": 17 }, "daily_limit": 30, "stop_on_company_reply": true, "track_opens": false, "track_clicks": false, "metadata": { "customer_id": "c_812" }, "stats": { "recipients": 2, "waiting": 2, "in_sequence": 0, "finished": 0, "replied": 0, "bounced": 0, "unsubscribed": 0, "excluded": 0, "emails_sent": 0, "emails_opened": 0, "emails_clicked": 0 }, "test": false, "created_at": "2026-11-18T14:03:10.000Z", "started_at": null, "completed_at": null }, "recipients": { "accepted": 2, "duplicates": 0, "rejected": 0, "results": [ { "email": "info@coastal-office.example", "status": "accepted", "recipient_id": "rcp_5r4k2m9x7p1q8w3e", "reason": null, "message": null, "warnings": [ "shared_mailbox" ] } ] }, "content": { "problems": [], "advice": [], "variables": [ { "name": "company", "required": true }, { "name": "first_name", "required": false } ] }, "preview": [], "estimate": { "emails": 4, "per_day": 30, "days": 4, "domains_for_a_week": 1 } }, "notice": null, "usage": { "cost": 0, "balance": 48.08, "replayed": false }}Última atualização em