API-referentie
Labels en sorteerregels
Orden verzonden en ontvangen e-mail automatisch of handmatig in mappen.
Geen operaties gevonden voor dit filter.
/emails/:id/labelsLabels aan een e-mail toevoegen of ervan verwijderen
Voeg labels toe en verwijder ze op naam of lbl_-ID. Onbekende namen in `add` worden aangemaakt, tenzij `create` false is. Een e-mail kan maximaal 10 labels hebben.
curl https://sendhq.cc/api/v1/emails/id_value/labels \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"add":["Billing"],"remove":["Support"]}'{
"id": "em_…",
"labels": [
{
"id": "lbl_…",
"name": "Billing",
"color": "#188038"
}
]
}/labelsLabels opvragen met aantallen berichten en sorteerregels
Labels opvragen met aantallen berichten en sorteerregels
curl https://sendhq.cc/api/v1/labels \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0,
"mailbox": {
"inboxUnread": 0,
"updatesUnread": 0,
"spamTotal": 0,
"importantUnread": 0,
"resortPending": 0
}
}/labelsEen label aanmaken, optioneel met automatische sorteerregels
Maak een label in mapstijl aan. Zet `skip_inbox: true` om er een bucket van te maken: ontvangen e-mail die dit label krijgt (via een regel, via een antwoord op een conversatie die met het label is verzonden, of handmatig) wordt gearchiveerd, zodat hij alleen in het label verschijnt en nooit in de Inbox. Optionele `rules` sorteren nieuwe verzonden of ontvangen e-mail automatisch: elke voorwaarde die op een regel is ingesteld moet overeenkomen (inbox_id, direction en hoofdletterongevoelige deelstrings van from/to/subject). Zet `apply_to_existing` om ook bewaarde e-mail te sorteren.
curl https://sendhq.cc/api/v1/labels \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Agent/Orders","color":"#188038","skip_inbox":true,"rules":[{"inbox_id":"inb_…"}],"apply_to_existing":true}'{
"id": "lbl_…",
"name": "Agent/Orders",
"color": "#188038",
"skipInbox": true,
"totalCount": 0,
"unreadCount": 0,
"rules": []
}/labels/:idEen label ophalen op ID of naam
Een label ophalen op ID of naam
curl https://sendhq.cc/api/v1/labels/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"id": "lbl_…",
"name": "Billing",
"color": "#188038",
"skipInbox": false,
"totalCount": 0,
"unreadCount": 0,
"rules": []
}/labels/:idEen label hernoemen, een andere kleur geven of er een bucket van maken
Wijzig `name`, `color` of `skip_inbox`. Als je `skip_inbox` inschakelt, wordt ook ontvangen e-mail die al in het label staat gearchiveerd, tenzij `apply_to_existing` false is.
curl https://sendhq.cc/api/v1/labels/id_value \
-X PATCH \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Finance/Billing","color":"#1a73e8","skip_inbox":true}'{
"id": "lbl_…",
"name": "Finance/Billing",
"color": "#1a73e8",
"skipInbox": true
}/labels/:idEen label verwijderen zonder de e-mail erin te verwijderen
Een label verwijderen zonder de e-mail erin te verwijderen
curl https://sendhq.cc/api/v1/labels/id_value \
-X DELETE \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"ok": true
}/labels/:id/rulesEen automatische sorteerregel aan een label toevoegen
Een automatische sorteerregel aan een label toevoegen
curl https://sendhq.cc/api/v1/labels/id_value/rules \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"direction":"in","from":"@stripe.com","subject":"invoice","skip_inbox":true,"apply_to_existing":false}'{
"id": "lrule_…",
"labelId": "lbl_…",
"direction": "in",
"inboxId": null,
"from": "@stripe.com",
"to": null,
"subject": "invoice",
"skipInbox": true
}/labels/:id/rules/:rule_idEen automatische sorteerregel verwijderen
Een automatische sorteerregel verwijderen
curl https://sendhq.cc/api/v1/labels/id_value/rules/rule_id_value \
-X DELETE \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"ok": true
}