Ir al contenido
Won.dev
DocumentaciónReferencia de la API
API de correo en frío

Crear una campaña

Crea una secuencia de hasta seis correos para una lista de personas y la inicia. Gratis: los correos salen de los dominios de envío del remitente.

Crea una secuencia de hasta seis correos para una lista de personas y, con start: true, empieza a enviarla. Envía desde los buzones de los dominios de envío propios del remitente (POST /email/domains), unos pocos correos por buzón al día, en el horario laboral de cada destinatario; cada destinatario recibe toda la secuencia desde un mismo buzón, y la secuencia se detiene para una persona en cuanto responde, rebota o se da de baja. Las campañas y los correos son gratis: lo que envían los dominios del remitente se paga con los dominios. Una campaña envía al día lo que permite su daily_limit, dentro de lo que envían los dominios juntos, que comparten todas las campañas del remitente. Usa primero dry_run: true: revisa los textos y la lista, muestra el primer correo tal como lo recibirían los primeros destinatarios y cuánto tarda la campaña con los dominios que tiene el remitente, sin crear nada. Iniciarla falla con no_domains mientras el remitente no tenga ninguno. Con un encabezado Idempotency-Key, un reintento nunca crea una segunda campaña. También puedes agregar destinatarios después con POST /email/campaigns/{id}/recipients.

  • Cobro: La llamada es gratis, y los correos también: salen de los dominios de envío del remitente, que se pagan por mes; consulta Dominios de envío.

Una clave de prueba (won_test_...) ejecuta esto en el sandbox: no se envía ni se cobra nada.

POST
/email/campaigns

Autenticación

apiKey
headerAuthorizationBearer <clave de API>

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

Parámetros de encabezado

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.

Longitudlength <= 255

Cuerpo de la solicitud

application/json
  1. body
sender_id*string

The sender the emails are for, from POST /email/senders.

Longitudlength <= 40
name*string

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

Longitud1 <= length <= 120
steps*array<>

The emails of the sequence, in order. Two to four work best.

Elementos1 <= items <= 6
recipients?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.

Elementositems <= 1000
schedule?

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?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.

Rango1 <= value <= 1000
Valor predeterminado50
stop_on_company_reply?boolean

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

Valor predeterminadotrue
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.

Valor predeterminadofalse
track_clicks?boolean

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

Valor predeterminadofalse
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. Returned as given, and in the events about it.

start?boolean

Start sending right away. Otherwise the campaign is a draft until POST /email/campaigns/{id}/start.

Valor predeterminadofalse
dry_run?boolean

Check everything and show a preview, without creating anything. Problems in the texts are listed instead of failing the call.

Valor predeterminadofalse

Cuerpo de la respuesta

The result.

application/json
  1. 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.

Solicitud de ejemplo
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}'
Respuesta de ejemplo
{  "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 actualización: