Riferimento API

Email e thread

Invia, recupera, cerca e rispondi alle email e consulta gli eventi di consegna.

POST/emails
Chiave API

Invia un'email

Invia contenuti transazionali in HTML, testo o da template ospitato da un dominio verificato del workspace. Gli invii diretti possono impostare message_class su marketing, se abilitato per il dominio mittente verificato. Marketing aggiunge intestazioni di disiscrizione gestite, a meno che un'integrazione proprietaria configurata non fornisca un proprio URL HTTPS visibile di disiscrizione con un clic.

Intestazioni facoltativeIdempotency-Key
Richiesta
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."}'
Risposta 201
{
  "id": "em_…",
  "providerMessageId": "provider-id",
  "threadId": "em_…"
}
POST/emails/batch
Chiave API

Invia fino a 100 messaggi personalizzati

Invia fino a 100 messaggi personalizzati

Intestazioni facoltativeIdempotency-Key
Richiesta
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."}]}'
Risposta 201
{
  "data": [
    {
      "index": 0,
      "ok": true,
      "id": "em_…"
    }
  ],
  "count": 1,
  "successful": 1,
  "failed": 0
}
GET/emails
Chiave API

Elenca le email inviate e ricevute

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
Richiesta
curl https://sendhq.cc/api/v1/emails \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Risposta 200
{
  "data": [],
  "count": 0
}
GET/emails/:id
Chiave API

Recupera un'email e i suoi allegati

Recupera un'email e i suoi allegati

Richiesta
curl https://sendhq.cc/api/v1/emails/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Risposta 200
{
  "id": "em_…",
  "direction": "out",
  "status": "sent",
  "attachments": []
}
PATCH/emails/:id
Chiave API

Aggiorna lettura, archiviazione, spam, categoria o importanza

Imposta `read`, `archived`, `category` (`primary`, `updates` o `spam`, solo per la posta ricevuta) e `important`. Modificare `category` o `important` insegna a SendHQ qualcosa sul mittente: lo spam segnalato manda in spam la posta futura di quel mittente, `Not spam` scavalca per lui i controlli antispam automatici e l'importanza resta associata al mittente. Passa `learn: false` per modificare solo questo messaggio.

Richiesta
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"}'
Risposta 200
{
  "id": "em_…",
  "readAt": "2026-08-23T12:00:00.000Z",
  "archivedAt": null,
  "category": "spam",
  "important": false,
  "classification": "you moved it here"
}
DELETE/emails/:id
Chiave API

Elimina un'email conservata

Elimina un'email conservata

Richiesta
curl https://sendhq.cc/api/v1/emails/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Risposta 200
{
  "ok": true
}
GET/emails/:id/events
Chiave API

Elenca gli eventi di consegna di un'email

Elenca gli eventi di consegna di un'email

Richiesta
curl https://sendhq.cc/api/v1/emails/id_value/events \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Risposta 200
{
  "data": [],
  "count": 0
}
GET/threads/:id
Chiave API

Recupera una conversazione in ordine cronologico

Recupera una conversazione in ordine cronologico

Richiesta
curl https://sendhq.cc/api/v1/threads/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Risposta 200
{
  "id": "em_…",
  "data": [],
  "count": 0
}
GET/emails/:id/delivery
Chiave API

Delivery timeline for one email, with bounce and complaint reasons

Delivery timeline for one email, with bounce and complaint reasons

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

Per-thread delivery counts and per-message failure reasons

Per-thread delivery counts and per-message failure reasons

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