Pular para o conteúdo
Won.dev
DocumentaçãoReferência da API
API de cold mail

Enviar um e-mail avulso

Escreva um e-mail fora da cadência, com arquivos se precisar. Grátis; conta para os e-mails do dia.

Envia um e-mail fora da cadência. Pode ser de novo para alguém para quem uma campanha já escreveu (recipient_id), como o orçamento que a pessoa pediu uma semana depois, ou para um colega indicado numa resposta (reply_id e to): alguém da mesma empresa de quem respondeu, ou um endereço citado na resposta. Sai da caixa em que a conversa acontece, com o mesmo nome. Sem subject, vai na conversa do último e-mail; com um, abre uma conversa nova. Os arquivos vão em attachments. É grátis, e conta para o que os domínios do remetente podem enviar hoje, junto com as campanhas: passado isso, falha com daily_limit_reached. Não dá para escrever para quem se descadastrou, deu bounce ou está numa lista de supressão, e alguém novo que nenhuma resposta indicou vai numa campanha: POST /email/campaigns/{id}/recipients. A mesma requisição em até 24 horas é tratada como repetição: você recebe a primeira resposta de volta e nada é enviado duas vezes.

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

POST
/email/messages

Autenticação

apiKey
headerAuthorizationBearer <chave de API>

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

Parâmetros de cabeçalho

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.

Tamanholength <= 255

Corpo da requisição

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.

Tamanholength <= 40
reply_id?string

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

Tamanholength <= 40
to?string

With reply_id: the colleague's email address.

Tamanholength <= 254
first_name?string

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

Tamanholength <= 80
last_name?string

With reply_id: the colleague's last name.

Tamanholength <= 80
subject?string

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

Tamanho1 <= 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.

Tamanho1 <= length <= 4000
attachments?array<>

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

Itensitems <= 3
Padrão[]

Corpo da resposta

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.

Requisição de exemplo
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"    }  ]}'
Resposta de exemplo
{  "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  }}

Última atualização em