Developer API
Templates
Use {{{VARIABLE}}} placeholders (raw) or {{VARIABLE}} (HTML-escaped). Templates must be published before sending; send with template: { id, variables } using the id or alias.
Create template
POST
/templatesCreates a draft.
Body parameters
namestringrequiredTemplate name.
htmlstringrequiredHTML with {{{VARIABLE}}} placeholders.
subjectstringDefault subject (can contain variables).
aliasstringStable name to send with instead of the id.
from / reply_tostringDefaults used when the send omits them.
variablesarray{ key, type: "string" | "number", fallback_value }.
Request
curl -X POST 'https://api.iresendly.com/templates' \
-H 'Authorization: Bearer irs_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"name": "Welcome",
"alias": "welcome",
"subject": "Welcome, {{{NAME}}}!",
"html": "<p>Hi {{{NAME}}}</p>",
"variables": [
{
"key": "NAME",
"type": "string",
"fallback_value": "there"
}
]
}'Response
{
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"object": "template"
}Publish template
POST
/templates/{id}/publishMakes the current version sendable.
Request
curl -X POST 'https://api.iresendly.com/templates/{id}/publish' \
-H 'Authorization: Bearer irs_xxxxxxxxx'Response
{
"id": "34a080c9-…",
"object": "template"
}Retrieve template
GET
/templates/{id|alias}Full template.
Request
curl -X GET 'https://api.iresendly.com/templates/{id|alias}' \
-H 'Authorization: Bearer irs_xxxxxxxxx'Response
{
"object": "template",
"id": "34a080c9-…",
"name": "Welcome",
"status": "published"
}Update template
PATCH
/templates/{id|alias}Publish again to send the new version.
Request
curl -X PATCH 'https://api.iresendly.com/templates/{id|alias}' \
-H 'Authorization: Bearer irs_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"subject": "Welcome aboard, {{{NAME}}}!"
}'Response
{
"id": "34a080c9-…",
"object": "template"
}Duplicate template
POST
/templates/{id|alias}/duplicateCreates a draft copy.
Request
curl -X POST 'https://api.iresendly.com/templates/{id|alias}/duplicate' \
-H 'Authorization: Bearer irs_xxxxxxxxx'Response
{
"id": "b8f5…",
"object": "template"
}Delete template
DELETE
/templates/{id|alias}Removes it permanently.
Request
curl -X DELETE 'https://api.iresendly.com/templates/{id|alias}' \
-H 'Authorization: Bearer irs_xxxxxxxxx'Response
{
"object": "template",
"id": "34a080c9-…",
"deleted": true
}Send with a template
POST
/emailssending keys allowedPass template instead of html/text.
Request
curl -X POST 'https://api.iresendly.com/emails' \
-H 'Authorization: Bearer irs_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"from": "Acme <hello@acme.com>",
"to": [
"jane@example.com"
],
"template": {
"id": "welcome",
"variables": {
"NAME": "Jane"
}
}
}'Response
{
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c"
}