API-Referenz
Gehostete Templates
Wiederverwendbare Inhalte entwerfen, rendern, testen, versionieren, veröffentlichen und senden.
Keine Operationen entsprechen diesem Filter.
GET
API-Schlüssel/templatesGehostete Templates auflisten
Gehostete Templates auflisten
curl https://sendhq.cc/api/v1/templates \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}POST
API-Schlüssel/templatesGehostetes Template anlegen
Gehostetes Template anlegen
curl https://sendhq.cc/api/v1/templates \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Account welcome","key":"account-welcome","starter":"welcome"}'{
"template": {
"id": "tmpl_…",
"key": "account-welcome"
}
}GET
API-Schlüssel/templates/:idEntwürfe, Releases und Nutzung abrufen
Entwürfe, Releases und Nutzung abrufen
curl https://sendhq.cc/api/v1/templates/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…"
},
"versions": [],
"draft": null,
"activeVersion": null,
"usage": []
}PUT
API-Schlüssel/templates/:id/draftTemplate-Entwurf automatisch speichern
Template-Entwurf automatisch speichern
curl https://sendhq.cc/api/v1/templates/id_value/draft \
-X PUT \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"revision":1,"name":"Account welcome","subjectTemplate":"Welcome, {{first_name}}","htmlTemplate":"<h1>Welcome, {{first_name}}</h1>","textTemplate":"Welcome, {{first_name}}","variables":[{"key":"first_name","type":"string","required":true}],"sampleData":{"first_name":"Asha"}}'{
"draft": {
"id": "tmplv_…",
"revision": 2
}
}POST
API-Schlüssel/templates/:id/draftNeuen Entwurf aus dem veröffentlichten Release erstellen
Neuen Entwurf aus dem veröffentlichten Release erstellen
curl https://sendhq.cc/api/v1/templates/id_value/draft \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"draft": {
"id": "tmplv_…",
"revision": 1
}
}POST
API-Schlüssel/templates/:id/renderExakte Server-Ausgabe rendern
Exakte Server-Ausgabe rendern
curl https://sendhq.cc/api/v1/templates/id_value/render \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"first_name":"Asha"}}'{
"subject": "Welcome, Asha",
"html": "<h1>Welcome, Asha</h1>",
"text": "Welcome, Asha",
"findings": []
}POST
API-Schlüssel/templates/:id/testTest-Snapshot senden
Test-Snapshot senden
curl https://sendhq.cc/api/v1/templates/id_value/test \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["owner@example.com"],"from":"hello@example.com","data":{"first_name":"Asha"}}'{
"id": "em_…",
"isTest": true
}POST
API-Schlüssel/templates/:id/publishUnveränderliches Template-Release veröffentlichen
Unveränderliches Template-Release veröffentlichen
curl https://sendhq.cc/api/v1/templates/id_value/publish \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"version": {
"id": "tmplv_…",
"state": "published"
}
}POST
API-Schlüssel/templates/:id/archiveTemplate archivieren
Template archivieren
curl https://sendhq.cc/api/v1/templates/id_value/archive \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…",
"lifecycle": "archived"
}
}POST
API-Schlüssel/templates/:id/restoreArchiviertes Template wiederherstellen
Archiviertes Template wiederherstellen
curl https://sendhq.cc/api/v1/templates/id_value/restore \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…",
"lifecycle": "active"
}
}