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/templates

Creates a draft.

Body parameters

namestringrequired

Template name.

htmlstringrequired

HTML with {{{VARIABLE}}} placeholders.

subjectstring

Default subject (can contain variables).

aliasstring

Stable name to send with instead of the id.

from / reply_tostring

Defaults 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}/publish

Makes 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}/duplicate

Creates 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 allowed

Pass 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"
}