API-referentie

E-mails en threads

Verstuur, haal op, doorzoek en beantwoord e-mails en bekijk bezorgevents.

POST/emails
API-sleutel

Eén e-mail verzenden

Verstuur transactionele HTML, tekst of inhoud uit een gehoste template vanaf een geverifieerd domein van de workspace. Directe verzendingen mogen message_class op marketing zetten als dat voor het geverifieerde afzenderdomein is ingeschakeld. Bij marketing worden beheerde afmeldheaders toegevoegd, tenzij een geconfigureerde first-party-integratie een eigen zichtbare HTTPS-URL voor one-click unsubscribe meelevert.

Optionele headersIdempotency-Key
Request
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."}'
201-respons
{
  "id": "em_…",
  "providerMessageId": "provider-id",
  "threadId": "em_…"
}
POST/emails/batch
API-sleutel

Maximaal 100 individuele berichten verzenden

Maximaal 100 individuele berichten verzenden

Optionele headersIdempotency-Key
Request
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."}]}'
201-respons
{
  "data": [
    {
      "index": 0,
      "ok": true,
      "id": "em_…"
    }
  ],
  "count": 1,
  "successful": 1,
  "failed": 0
}
GET/emails
API-sleutel

Verzonden en ontvangen e-mail opvragen

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

Een e-mail en de bijlagen ophalen

Een e-mail en de bijlagen ophalen

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

Leesstatus, archivering, spam, categorie of belangrijkheid bijwerken

Stel `read`, `archived`, `category` (`primary`, `updates` of `spam`, alleen voor ontvangen e-mail) en `important` in. Als je `category` of `important` wijzigt, leert SendHQ iets over de afzender: gemelde spam stuurt toekomstige e-mail van die afzender naar spam, `Not spam` schakelt de automatische spamcontroles voor die afzender uit, en belangrijkheid blijft aan de afzender gekoppeld. Geef `learn: false` mee om alleen dit bericht te wijzigen.

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

Een bewaarde e-mail verwijderen

Een bewaarde e-mail verwijderen

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

Bezorgevents van een e-mail opvragen

Bezorgevents van een e-mail opvragen

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

Een conversatie in chronologische volgorde ophalen

Een conversatie in chronologische volgorde ophalen

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

Delivery timeline for one email, with bounce and complaint reasons

Delivery timeline for one email, with bounce and complaint reasons

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

Per-thread delivery counts and per-message failure reasons

Per-thread delivery counts and per-message failure reasons

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