WoyraDocs
Get an API key

Save an email template

POST/v1/templates

Emails · Requires an API key

A subject and an HTML and/or text body with {{placeholders}}. Send it with template_id and variables on POST /v1/emails. Names are one per account.

Body

FieldTypeDescription
namestring
subjectstring
htmlstring
textstring

Example

curl -X POST https://api.woyra.io/v1/templates \
  -H "Authorization: Bearer $WOYRA_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Receipt",
    "subject": "Your receipt, {{name}}",
    "html": "<p>Hi {{name}}, you paid {{amount}}.</p>"
  }'

Response

201 The saved template.

FieldTypeDescription
object"template"
idstring
namestring
subjectstring
htmlstring
textstring
variablesarray of stringThe placeholders the template uses.
created_attimestamp
updated_attimestamp

Errors

StatusCodes
400invalid_request, unsupported_version
401authentication_required, invalid_api_key

Also in Emails