Retrieve a email template

GET/api/v1/email-templates/{email_template}
Requires anorganization API keywith the scopetemplates:read

Parameters

NameInTypeDescription
email_templaterequiredpathstringThe email template identifier.

Request

GET/api/v1/email-templates/{email_template}
curl -X GET 'https://app.mailyte.com/api/v1/email-templates/ada@example.com' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • objectstringemail_template
    • idstring
    • namestring

      Unique within your organization.

    • subjectstring

      May contain {{ variable }} placeholders, like the bodies. Required when the template is created and never null afterwards; an update that omits it keeps the stored one rather than clearing it.

    • htmlstring

      The HTML body. An empty body is "".

    • textstring

      The plain-text body. When you create or update a template, send it as plain_text.

    • variablesarray<string>

      The {{ }} placeholder names used in the subject and bodies. [] when there are none.

    • created_atstring

      When the template was created.

    • updated_atstring

      When the template was last saved.

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

Every status, with what causes it and what to do, is on the error reference.