API reference · Emails
Send email
Queues an email. The response comes back in milliseconds with the id; follow it in the dashboard, with Get email or through webhooks.
POST
https://api.coffeemail.com.br/v1/product/emailsScope: sending_access202 AcceptedSDK: emails.send()
Headers
x-idempotency-key- Optional. The same key within 24 h returns the same email instead of sending again.
x-coffeemail-sandbox- Optional. With true, the email goes through validation and becomes events, but is not delivered to the recipient.
Request body
Request body
fromobjectrequired- Remetente do e-mail
from.emailstring (email)required- Endereço de e-mail
from.namestring≤ 200- Nome de exibição do contato
toarray<object>1+ itensaté 50 itensrequired- Lista de destinatários do e-mail
ccarray<object>até 50 itens- Lista de destinatários em cópia
bccarray<object>até 50 itens- Lista de destinatários em cópia oculta
replyToobject- Endereço para onde respostas devem ser enviadas
replyTo.emailstring (email)required- Endereço de e-mail
replyTo.namestring≤ 200- Nome de exibição do contato
subjectstring≥ 1≤ 998- Assunto do e-mail
htmlstring≤ 102400- Corpo do e-mail em HTML
textstring≤ 102400- Corpo do e-mail em texto puro
headersobject- Cabeçalhos SMTP customizados a incluir no envio
attachmentsarray<object>até 10 itens- Arquivos anexados ao e-mail
templateIdstring≥ 1≤ 100- Id ou alias do template usado para montar o e-mail
variablesobject- Variáveis para preencher o template
emailType"transactional" | "broadcast"- Categoria do envio para fins de rastreio e supressão
suppressionCategorystring≥ 1≤ 100- Categoria usada para checar a lista de supressão
tagsarray<object>até 10 itens- Tags para categorizar e filtrar o e-mail depois
scheduledAtstring (date-time)- Data/hora futura para o envio agendado do e-mail
metadataobject- Metadados customizados para rastreio ou webhook
Response
202 Accepted with the email id, the initial status (queued or scheduled) and when it entered the queue.
202 Accepted
Response 202
idstring (uuid)required- ID único do e-mail criado
status"queued" | "scheduled"required- Status inicial do e-mail após o envio
queuedAtstring (date-time)required- Data/hora em que o e-mail entrou na fila
Errors
| HTTP | code | When it happens |
|---|---|---|
| 400 | VALIDATION_FAILED | A body or query field is invalid; meta says which. |
| 400 | INVALID_RECIPIENT | The recipient is not a valid address. |
| 401 | UNAUTHORIZED | Missing, invalid or revoked key. |
| 409 | DOMAIN_NOT_VERIFIED | The sender domain has not passed DNS verification yet. |
| 422 | INVALID_FROM_DOMAIN | The from address uses a domain that does not belong to the organization. |
| 422 | SENDER_NOT_VERIFIED | The single sender has not confirmed the email yet. |
| 429 | PLAN_QUOTA_EXCEEDED | The plan quota ran out in the cycle; enable overage or change plans. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests; wait the retry-after time. |
| 500 | TEMPLATE_RENDER_ERROR | The template did not render with the variables sent. |