Справочник API
Письма и цепочки
Отправка, получение, поиск писем, ответы и просмотр событий доставки.
Нет операций, подходящих под этот фильтр.
/emailsОтправить одно письмо
Отправляет транзакционное письмо с HTML, текстом или содержимым хранимого шаблона с подтверждённого домена рабочего пространства. При прямой отправке можно указать message_class со значением marketing, если это включено для подтверждённого домена отправителя. Для маркетинговых писем добавляются управляемые заголовки отписки, если только настроенная собственная интеграция не передаёт свой видимый HTTPS-адрес для отписки в один клик.
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."}'{
"id": "em_…",
"providerMessageId": "provider-id",
"threadId": "em_…"
}/emails/batchОтправить до 100 индивидуальных писем
Отправить до 100 индивидуальных писем
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."}]}'{
"data": [
{
"index": 0,
"ok": true,
"id": "em_…"
}
],
"count": 1,
"successful": 1,
"failed": 0
}/emailsСписок отправленных и полученных писем
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`.
curl https://sendhq.cc/api/v1/emails \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}/emails/:idПолучить письмо и его вложения
Получить письмо и его вложения
curl https://sendhq.cc/api/v1/emails/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"id": "em_…",
"direction": "out",
"status": "sent",
"attachments": []
}/emails/:idИзменить статус прочтения, архивации, спама, категорию или важность
Задаёт `read`, `archived`, `category` (`primary`, `updates` или `spam` — только для полученных писем) и `important`. Изменение `category` или `important` обучает SendHQ в отношении отправителя: если пометить письмо как спам, будущие письма этого отправителя будут попадать в спам, отметка `Not spam` отменяет для него автоматические проверки на спам, а важность закрепляется за отправителем. Передайте `learn: false`, чтобы изменить только это письмо.
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"}'{
"id": "em_…",
"readAt": "2026-08-23T12:00:00.000Z",
"archivedAt": null,
"category": "spam",
"important": false,
"classification": "you moved it here"
}/emails/:idУдалить сохранённое письмо
Удалить сохранённое письмо
curl https://sendhq.cc/api/v1/emails/id_value \
-X DELETE \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"ok": true
}/emails/:id/eventsСписок событий доставки письма
Список событий доставки письма
curl https://sendhq.cc/api/v1/emails/id_value/events \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}/threads/:idПолучить переписку в хронологическом порядке
Получить переписку в хронологическом порядке
curl https://sendhq.cc/api/v1/threads/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"id": "em_…",
"data": [],
"count": 0
}/emails/:id/deliveryDelivery timeline for one email, with bounce and complaint reasons
Delivery timeline for one email, with bounce and complaint reasons
curl https://sendhq.cc/api/v1/emails/id_value/delivery \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"emailId": "em_123",
"status": "bounced",
"timeline": [],
"count": 0,
"limit": 50,
"offset": 0
}/threads/:id/deliveryPer-thread delivery counts and per-message failure reasons
Per-thread delivery counts and per-message failure reasons
curl https://sendhq.cc/api/v1/threads/id_value/delivery \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"threadId": "thr_123",
"delivered": 0,
"bounced": 0,
"complained": 0,
"failed": 0,
"messages": []
}