Create a template

POST/v1/templates

Secret key — sk_… or sk_test_… · Base URL https://api.volanea.com

Stores reusable content addressed by templateId, so a send can name the template instead of carrying the markup.

subject, body, and the preheader support {{variable}} placeholders, resolved at send time against the per-call variables first and the contact's own fields second. fromEmail must sit on a verified domain or every send from this template fails.

Version 1 is written immediately. Every later content change bumps the version and keeps the previous one, which is what POST /v1/templates/{id}/rollback restores.

Body

Required · application/json

  • namestringrequired
  • typeenum

    Marketing templates get the unsubscribe footer and respect the subscribed flag.

    transactionalmarketing
  • subjectstringrequired
  • bodystringrequired

    HTML with `{{variable}}` placeholders.

  • fromNamestring
  • fromEmailemailrequired

Response

201 · Template

  • templateIdstringrequired
  • projectIdstring
  • namestringrequired
  • typeenumrequired
    transactionalmarketing
  • subjectstringrequired
  • bodystringrequired
  • fromNamestring | null
  • fromEmailemailrequired
  • versionintegerrequired

    Bumped on every content change; old versions are kept for rollback.

  • createdAtdate-timerequired
  • updatedAtdate-timerequired

Errors

Every failure returns the standard envelope — branch on `code`, never on the wording of `error`.

  • 401Missing or invalid API key.
  • 422Request validation failed (code `validation_error`, 422).

Request

curl https://api.volanea.com/v1/templates \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome",
    "subject": "Your order shipped",
    "body": "<p>On its way, {{firstName}}.</p>",
    "fromEmail": "hello@yourdomain.com",
    "type": "transactional",
    "fromName": "Acme"
  }'

Response

201 · application/json

{
  "success": true,
  "data": {
    "templateId": "tpl_9f2c",
    "projectId": "<projectId>",
    "name": "Welcome",
    "type": "transactional",
    "subject": "Your order shipped",
    "body": "<p>On its way, {{firstName}}.</p>",
    "fromName": "Acme",
    "fromEmail": "hello@yourdomain.com",
    "version": 1,
    "createdAt": "2026-01-01T09:00:00.000Z",
    "updatedAt": "2026-01-01T09:00:00.000Z"
  }
}

92 endpoints · OpenAPI document