Referência da API

E-mails e threads

Envie, obtenha, pesquise e responda e-mails e inspecione eventos de entrega.

POST/emails
Chave de API

Enviar um e-mail

Envie conteúdo transacional em HTML, texto ou template hospedado a partir de um domínio verificado do workspace. Envios diretos podem definir message_class como marketing quando isso estiver habilitado para o domínio remetente verificado. E-mails de marketing recebem cabeçalhos de descadastro gerenciados, a menos que uma integração própria configurada forneça sua própria URL HTTPS visível de descadastro com um clique.

Cabeçalhos opcionaisIdempotency-Key
Requisição
curl https://sendhq.cc/api/v1/emails \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"Acme <hello@example.com>","to":["customer@example.net"],"subject":"Welcome aboard","html":"<h1>Welcome</h1><p>Your workspace is ready.</p>","text":"Welcome. Your workspace is ready."}'
Resposta 201
{
  "id": "em_…",
  "providerMessageId": "provider-id",
  "threadId": "em_…"
}
POST/emails/batch
Chave de API

Enviar até 100 mensagens individualizadas

Enviar até 100 mensagens individualizadas

Cabeçalhos opcionaisIdempotency-Key
Requisição
curl https://sendhq.cc/api/v1/emails/batch \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"emails":[{"from":"Acme <hello@example.com>","to":["customer@example.net"],"subject":"Welcome aboard","html":"<h1>Welcome</h1><p>Your workspace is ready.</p>","text":"Welcome. Your workspace is ready."}]}'
Resposta 201
{
  "data": [
    {
      "index": 0,
      "ok": true,
      "id": "em_…"
    }
  ],
  "count": 1,
  "successful": 1,
  "failed": 0
}
GET/emails
Chave de API

Listar e-mails enviados e recebidos

Newest-first list with filters. `query` searches subjects, bodies, participants, and attachment filenames. `label`, `domain`, and `category` accept one value or a comma-separated list (matches any); labels may be IDs or names. `outcome` filters sent mail to `bounced`, `complained`, `failed`, or `rejected` (comma-separated, matches any). `archived=false` returns the Inbox view for received mail. Received mail is classified as `primary`, `updates` (newsletters, bulk, and automated mail), or `spam`, and flagged `important`; spam is excluded unless `category=spam` or `include_spam=true`.

Query parametersdirectionstatusoutcomedomaininbox_idlabelarchivedcategoryimportantinclude_spamfromtounreadafterbeforequerylimitoffset
Requisição
curl https://sendhq.cc/api/v1/emails \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "data": [],
  "count": 0
}
GET/emails/:id
Chave de API

Obter um e-mail e seus anexos

Obter um e-mail e seus anexos

Requisição
curl https://sendhq.cc/api/v1/emails/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "id": "em_…",
  "direction": "out",
  "status": "sent",
  "attachments": []
}
PATCH/emails/:id
Chave de API

Atualizar leitura, arquivamento, spam, categoria ou importância

Defina `read`, `archived`, `category` (`primary`, `updates` ou `spam`, apenas para e-mails recebidos) e `important`. Alterar `category` ou `important` ensina o SendHQ sobre o remetente: marcar como spam envia os próximos e-mails desse remetente para o spam, `Not spam` ignora as verificações automáticas de spam para ele, e a importância passa a valer para o remetente. Passe `learn: false` para alterar apenas esta mensagem.

Requisição
curl https://sendhq.cc/api/v1/emails/id_value \
  -X PATCH \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"spam"}'
Resposta 200
{
  "id": "em_…",
  "readAt": "2026-08-23T12:00:00.000Z",
  "archivedAt": null,
  "category": "spam",
  "important": false,
  "classification": "you moved it here"
}
DELETE/emails/:id
Chave de API

Excluir um e-mail retido

Excluir um e-mail retido

Requisição
curl https://sendhq.cc/api/v1/emails/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "ok": true
}
GET/emails/:id/events
Chave de API

Listar os eventos de entrega de um e-mail

Listar os eventos de entrega de um e-mail

Requisição
curl https://sendhq.cc/api/v1/emails/id_value/events \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "data": [],
  "count": 0
}
GET/threads/:id
Chave de API

Obter uma conversa em ordem cronológica

Obter uma conversa em ordem cronológica

Requisição
curl https://sendhq.cc/api/v1/threads/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "id": "em_…",
  "data": [],
  "count": 0
}
GET/emails/:id/delivery
Chave de API

Delivery timeline for one email, with bounce and complaint reasons

Delivery timeline for one email, with bounce and complaint reasons

Requisição
curl https://sendhq.cc/api/v1/emails/id_value/delivery \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "emailId": "em_123",
  "status": "bounced",
  "timeline": [],
  "count": 0,
  "limit": 50,
  "offset": 0
}
GET/threads/:id/delivery
Chave de API

Per-thread delivery counts and per-message failure reasons

Per-thread delivery counts and per-message failure reasons

Requisição
curl https://sendhq.cc/api/v1/threads/id_value/delivery \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Resposta 200
{
  "threadId": "thr_123",
  "delivered": 0,
  "bounced": 0,
  "complained": 0,
  "failed": 0,
  "messages": []
}