API-Referenz

Entwürfe und Anhänge

Composer-Abläufe mit privater Anhangspeicherung aufbauen.

POST/drafts
API-Schlüssel

Composer-Entwurf erstellen

Composer-Entwurf erstellen

Anfrage
curl https://sendhq.cc/api/v1/drafts \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"hello@example.com","to":["customer@example.net"],"subject":"Hello"}'
Antwort 201
{
  "id": "dr_…",
  "attachments": []
}
GET/drafts
API-Schlüssel

Composer-Entwürfe auflisten

Composer-Entwürfe auflisten

Anfrage
curl https://sendhq.cc/api/v1/drafts \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Antwort 200
{
  "data": [],
  "count": 0
}
GET/drafts/:id
API-Schlüssel

Entwurf und Anhänge abrufen

Entwurf und Anhänge abrufen

Anfrage
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Antwort 200
{
  "id": "dr_…",
  "attachments": []
}
PUT/drafts/:id
API-Schlüssel

Entwurfsinhalt ersetzen

Entwurfsinhalt ersetzen

Anfrage
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X PUT \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"hello@example.com","to":["customer@example.net"],"subject":"Updated subject","text":"Updated body"}'
Antwort 200
{
  "id": "dr_…"
}
DELETE/drafts/:id
API-Schlüssel

Entwurf verwerfen

Entwurf verwerfen

Anfrage
curl https://sendhq.cc/api/v1/drafts/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Antwort 200
{
  "ok": true
}
POST/drafts/:id/attachments
API-Schlüssel

Anhang zu einem Entwurf hochladen

Laden Sie die rohen Dateibytes hoch. Setzen Sie Content-Type und X-Filename. Eine Nachricht kann höchstens 10 Dateien und insgesamt 10 MB enthalten.

Optionale HeaderX-Filename
Anfrage
curl https://sendhq.cc/api/v1/drafts/id_value/attachments \
  -X POST \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/pdf" \
  -H "X-Filename: invoice.pdf" \
  --data-binary @invoice.pdf
Antwort 201
{
  "id": "att_…",
  "filename": "invoice.pdf",
  "sizeBytes": 48231,
  "available": true
}
GET/attachments/:id
API-Schlüssel

Privaten Anhang herunterladen

Privaten Anhang herunterladen

Anfrage
curl https://sendhq.cc/api/v1/attachments/id_value \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
DELETE/attachments/:id
API-Schlüssel

Privaten Anhang löschen

Privaten Anhang löschen

Anfrage
curl https://sendhq.cc/api/v1/attachments/id_value \
  -X DELETE \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Antwort 200
{
  "ok": true
}
GET/sending-identities
API-Schlüssel

Verifizierte Absenderidentitäten auflisten

Verifizierte Absenderidentitäten auflisten

Anfrage
curl https://sendhq.cc/api/v1/sending-identities \
  -X GET \
  -H "Authorization: Bearer $SENDHQ_API_KEY"
Antwort 200
{
  "domains": [],
  "addresses": [],
  "localParts": []
}